- 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.
This commit is contained in:
Christoph Oelckers 2020-11-09 20:56:28 +01:00
parent 51115e75df
commit 601680d08e
2 changed files with 21 additions and 20 deletions

View file

@ -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 */

View file

@ -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);