Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alternate palette support #1

Open
city41 opened this issue Dec 24, 2021 · 1 comment
Open

alternate palette support #1

city41 opened this issue Dec 24, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@city41
Copy link
Owner

city41 commented Dec 24, 2021

Enable generating alternate palettes for a given set of tiles. The user could render the set of tiles to a sprite using the alternate palette for things like player 2 palette swaps, stuff like that.

the approach

Each input should have an alternatePaletteImageFiles: string[] key. When a generator first creates the tile with the canvas source, if it sees this key, that tile will also have alternatePaletteSources: Canvas[] set.

"cromAnimations": {
  "inputs": [
    {
        "name": "player",
        "animations": [
            {
              "name": "spawn",
              "imageFile": "./player1_spawn.png",
              "alternatePaletteImageFiles": ["./player2_spawn.png"]
            }
         ]
    }
]

Immediately after main palette generation is done, these alternate palette sources are consulted, using the main generated palettes, to generate the alternate palettes. For each tile, the tile's main Canvas source, the palette it got assigned and the alternate palette sources are cross referenced to generate the alternate palette.

During palette code emit, more metadata about palettes is needed. Currently just the palette data is provided, but also need to specify whether the palette is an alternate, and if so, which tiles it is an alternate for.

@city41 city41 added the enhancement New feature or request label Dec 24, 2021
@city41
Copy link
Owner Author

city41 commented Jan 12, 2022

Possibly a better approach is to provide a "color map" image. it would be x by 2, with the first row being the palette that is used in the image, and the second row being the alternate palette(s). sromcrom would add the alternate palettes into the pool and ensure that the two sets of palettes maintain the same indices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant