agb icon indicating copy to clipboard operation
agb copied to clipboard

Affine tilemaps show gaps

Open kouta-kun opened this issue 1 year ago • 2 comments

At least in mGBA, affine tilemaps leave a gap between each tile as they are being set with a "tile setting" of 0 which goes unused in affine backgrounds. This can be reproduced with the "affine_background.rs" example.

In mGBA debugger: image Notice how there is a gap between tiles in the map view.

This can be fixed by applying the following patch to display/tiled/map.rs, however it is sort of a kludge and a restructuring of the TiledMap might be a better solution. https://github.com/kouta-kun/agb/commit/cf2b8be6e0535b269b1fa5fa0bac8389c68afd52

After applying the fix, it now looks like this: image

kouta-kun avatar Jul 07 '24 03:07 kouta-kun

I always wonderered why there were gaps and assumed it was just some weirdness with the tiles themselves... I haven't needed affine backgrounds myself yet so didn't run into this problem yet.

I'm happy with a kludge fix for now.

I'm planning on refactoring backgrounds entirely to look a bit more like ObjectUnmanaged and remove the current link between background tiles in vram and the background itself. That should allow for easier effects and management of vram. I've got a branch for it here which I'll probably finish after game jam season.

So if it fixes the current API I'll be happy to take it. Would you like to create a PR for it? The solution you have there seems perfectly reasonable to me and I'll make sure to integrate it in my refactor when I get round to completing it :)

gwilymk avatar Jul 09 '24 18:07 gwilymk

@gwilymk I've created a PR for it now :)

kouta-kun avatar Jul 09 '24 20:07 kouta-kun

Fixed in #735

gwilymk avatar Jul 11 '24 20:07 gwilymk