tilemap.c: Respect gfx_element::colors() just like drawgfx.c does. Add temporary assert to catch regressions (i.e. drivers that didn't define their gfx elements correctly) (nw)

This commit is contained in:
Alex W. Jackson 2014-11-07 04:14:12 -05:00
parent f4b87dcd55
commit 4fe7a56192

View file

@ -443,8 +443,9 @@ struct tile_data
{
gfx_element *gfx = decoder->gfx(_gfxnum);
int code = rawcode % gfx->elements();
assert(rawcolor < gfx->colors()); // TEMPORARY ASSERT
pen_data = gfx->get_data(code);
palette_base = gfx->colorbase() + gfx->granularity() * rawcolor;
palette_base = gfx->colorbase() + gfx->granularity() * (rawcolor % gfx->colors());
flags = _flags;
gfxnum = _gfxnum;
}