From 601680d08efd96ae685e05fa6e67c92e9cd17d3c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Nov 2020 20:56:28 +0100 Subject: [PATCH] - moved widthBits and heightBits into engine. These functions will go away with the rest of the renderer when the time comes, so this is the right place. --- source/build/src/engine_priv.h | 21 +++++++++++++++++++++ source/core/textures/buildtiles.h | 20 -------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index ec9d814c4..7679b35ba 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -245,4 +245,25 @@ static inline void get_floorspr_points(T const * const spr, int32_t px, int32_t *y3 = *y2 + ofs.y, *y4 = *y1 + ofs.y; } +inline int widthBits(int num) +{ + int w = tileWidth(num); + int j = 15; + + while ((j > 1) && ((1 << j) > w)) + j--; + return j; +} + +inline int heightBits(int num) +{ + int w = tileHeight(num); + int j = 15; + + while ((j > 1) && ((1 << j) > w)) + j--; + return j; +} + + #endif /* ENGINE_PRIV_H */ diff --git a/source/core/textures/buildtiles.h b/source/core/textures/buildtiles.h index d8e445422..8a9348e14 100644 --- a/source/core/textures/buildtiles.h +++ b/source/core/textures/buildtiles.h @@ -481,26 +481,6 @@ inline int tileTopOffset(int num) return (int)TileFiles.tiledata[num].texture->GetDisplayTopOffset(); } -inline int widthBits(int num) -{ - int w = tileWidth(num); - int j = 15; - - while ((j > 1) && ((1 << j) > w)) - j--; - return j; -} - -inline int heightBits(int num) -{ - int w = tileHeight(num); - int j = 15; - - while ((j > 1) && ((1 << j) > w)) - j--; - return j; -} - inline rottile_t& RotTile(int tile) { assert(tile < MAXTILES);