From f6ca5fa650a02cc66a852d6d6c0b06598266a9fe Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 28 May 2020 18:42:26 +0200 Subject: [PATCH] - fixed writable tiles. --- source/core/textures/buildtiles.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/core/textures/buildtiles.h b/source/core/textures/buildtiles.h index 6e1bfbc6b..04a423fcc 100644 --- a/source/core/textures/buildtiles.h +++ b/source/core/textures/buildtiles.h @@ -379,8 +379,9 @@ inline bool tileLoad(int tileNum) inline uint8_t* tileData(int num) { - auto tex = TileFiles.tiledata[num].texture; - auto p = dynamic_cast(tex->GetTexture()); + auto tex = dynamic_cast(TileFiles.tiledata[num].texture->GetTexture()); + if (!tex) return nullptr; + auto p = dynamic_cast(tex->GetImage()); return p ? p->GetRawData() : nullptr; }