Add 1 pixel tall and wide texture support to the renderer

- These require manual detection and overriding of the scaling factors to
  0, because a right shift of (32-0) bits wraps around to 0 and results in
  no shift at all rather than leaving the register zeroed out.
This commit is contained in:
Marisa Heit 2016-11-01 00:08:16 -05:00
commit 9388597443
4 changed files with 59 additions and 12 deletions

View file

@ -210,8 +210,9 @@ void FTexture::CalcBitSize ()
}
WidthMask = (1 << WidthBits) - 1;
// The minimum height is 2, because we cannot shift right 32 bits.
for (i = 1; (1 << i) < Height; ++i)
// <hr>The minimum height is 2, because we cannot shift right 32 bits.</hr>
// Scratch that. Somebody actually made a 1x1 texture, so now we have to handle it.
for (i = 0; (1 << i) < Height; ++i)
{ }
HeightBits = i;