feat(engine): support map background colour#214
Merged
Conversation
The 2014 zmap format fills each room with a header background colour before painting tiles — the ported maps only stored the tiles, so sparse maps (Field is ~19% tiles) rendered as void in the editor. - MapData.backgroundColor (optional #rrggbb, below all layers) - engine: map colour -> GL clear colour on loadMap (a colour Actor would raster through the 2D-canvas path; clear colour is pure GL and matches the original game's fill-the-screen semantic) - MapPreview: fill the map bounds in the widget paint + the bake - games/oot2d-2014: backgroundColor injected into all 19 maps from the zmap headers (exporter: PixelRPG/oot-2d e3ea382)
JumpLink
added a commit
that referenced
this pull request
Jun 12, 2026
…219) No behaviour change — the preview/card pair grew through several review iterations (#214-#218); this consolidates: map-preview: - constants moved above the class JSDoc so it documents the class - cache key derived forward (_cacheKeyBase + _cacheKey()) instead of string-parsing the composed key backwards; the stored-key field is gone — _runBake computes the key when it stores - _bakedCenter folded into _viewportBake (single last-viewport-bake record; _baked stays the is-current marker for both modes) - _clampCenter takes the widget extent instead of a horizontal flag - _populateFromMap renamed _setSource (no key parameter anymore) scene-card: - _moveDeltaInParent extracts the parent-space delta math that was duplicated between drag-update and drag-end - _suppressTrailingClick extracts the idle-reset click suppression shared by drag-end and the lock-click handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The mass-ported OoT2D-2014 maps (#212) showed a hard render defect: large void areas and 'strange artifacts'. Root cause: the original
.zmapformat carries a per-room background colour in its header — the 2014 game fills the whole screen with it before painting tiles, so sparse maps (Field stores tiles for only ~19% of its 372×380 cells) rely on it for the grass/floor. Our converter dropped it.Changes
MapData.backgroundColor— optional#rrggbb, documented as a fill below all tile layers.loadMapmaps it onto the Excalibur GL clear colour (reset to transparent for maps without one). A colourActorwas tried first but goes through Excalibur'sRectangleRaster (2D-canvas rasterise + texture upload) — the clear colour is pure GL and matches the original game's fill-the-screen semantic.MapPreview: fills the map bounds with the colour in both the direct paint and the baked texture — atlas cards + welcome thumbnails now show the real room colours.backgroundColorinjected into all 19games/oot2d-2014maps from their zmap headers (exporter updated in PixelRPG/oot-2d@e3ea382; values range from Field's grass#409740to SMB's classic sky#5C94FC).Verification
tools/export-maps.py).@pixelrpg/enginecheck + 748 tests green,@pixelrpg/gjscheck green.Loading map:never logged), so it is unrelated to this change.