summaryrefslogtreecommitdiff
path: root/thirdparty/basis_universal/basisu_pvrtc1_4.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-13 15:56:46 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-13 16:09:00 +0100
commitb6d684ec65428e3c2989340ad079f796cd3e1cd3 (patch)
tree272ed1829364d56b36a2a8bf434f3618f9b3a564 /thirdparty/basis_universal/basisu_pvrtc1_4.cpp
parentef51726ff3cd60e0caf9ce55c9c85cc47bfe0420 (diff)
basis_universal: Update to upstream commit from Jan 4, 2020
BinomialLLC/basis_universal@895ee8ee7e04f22267f8d16d46de04d5a01d63ac.
Diffstat (limited to 'thirdparty/basis_universal/basisu_pvrtc1_4.cpp')
-rw-r--r--thirdparty/basis_universal/basisu_pvrtc1_4.cpp42
1 files changed, 12 insertions, 30 deletions
diff --git a/thirdparty/basis_universal/basisu_pvrtc1_4.cpp b/thirdparty/basis_universal/basisu_pvrtc1_4.cpp
index 5a732b2ceb..f0122fcb6c 100644
--- a/thirdparty/basis_universal/basisu_pvrtc1_4.cpp
+++ b/thirdparty/basis_universal/basisu_pvrtc1_4.cpp
@@ -193,21 +193,12 @@ namespace basisu
int block_x1 = block_x0 + 1;
int block_y0 = (static_cast<int>(y) - 2) >> 2;
int block_y1 = block_y0 + 1;
- if (m_wrap_addressing)
- {
- block_x0 = posmod(block_x0, m_block_width);
- block_x1 = posmod(block_x1, m_block_width);
- block_y0 = posmod(block_y0, m_block_height);
- block_y1 = posmod(block_y1, m_block_height);
- }
- else
- {
- block_x0 = clamp<int>(block_x0, 0, m_block_width - 1);
- block_x1 = clamp<int>(block_x1, 0, m_block_width - 1);
- block_y0 = clamp<int>(block_y0, 0, m_block_height - 1);
- block_y1 = clamp<int>(block_y1, 0, m_block_height - 1);
- }
-
+
+ block_x0 = posmod(block_x0, m_block_width);
+ block_x1 = posmod(block_x1, m_block_width);
+ block_y0 = posmod(block_y0, m_block_height);
+ block_y1 = posmod(block_y1, m_block_height);
+
pColors[0] = interpolate(x, y, m_blocks(block_x0, block_y0).get_endpoint_5554(0), m_blocks(block_x1, block_y0).get_endpoint_5554(0), m_blocks(block_x0, block_y1).get_endpoint_5554(0), m_blocks(block_x1, block_y1).get_endpoint_5554(0));
pColors[3] = interpolate(x, y, m_blocks(block_x0, block_y0).get_endpoint_5554(1), m_blocks(block_x1, block_y0).get_endpoint_5554(1), m_blocks(block_x0, block_y1).get_endpoint_5554(1), m_blocks(block_x1, block_y1).get_endpoint_5554(1));
@@ -240,21 +231,12 @@ namespace basisu
int block_x1 = block_x0 + 1;
int block_y0 = (static_cast<int>(y) - 2) >> 2;
int block_y1 = block_y0 + 1;
- if (m_wrap_addressing)
- {
- block_x0 = posmod(block_x0, m_block_width);
- block_x1 = posmod(block_x1, m_block_width);
- block_y0 = posmod(block_y0, m_block_height);
- block_y1 = posmod(block_y1, m_block_height);
- }
- else
- {
- block_x0 = clamp<int>(block_x0, 0, m_block_width - 1);
- block_x1 = clamp<int>(block_x1, 0, m_block_width - 1);
- block_y0 = clamp<int>(block_y0, 0, m_block_height - 1);
- block_y1 = clamp<int>(block_y1, 0, m_block_height - 1);
- }
-
+
+ block_x0 = posmod(block_x0, m_block_width);
+ block_x1 = posmod(block_x1, m_block_width);
+ block_y0 = posmod(block_y0, m_block_height);
+ block_y1 = posmod(block_y1, m_block_height);
+
if (get_block_uses_transparent_modulation(x >> 2, y >> 2))
{
if (m == 0)