Downgrade project to C++17

hotfix/mipmap-alpha-fix
Andrew Cassidy 3 years ago
parent 2618faadfc
commit f2873f3a38

@ -25,12 +25,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Set linux compiler
if: runner.os == 'Linux'
run: |
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
- name: Install libomp
if: runner.os == 'macOS'
# openMP isnt part of core apple clang for some reason?
@ -82,12 +76,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Set linux compiler
if: runner.os == 'Linux'
run: |
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
- name: Install libomp
if: runner.os == 'macOS'
# openMP isnt part of core apple clang for some reason?

@ -59,8 +59,8 @@ if (OpenMP_CXX_FOUND)
endif ()
# Set module features, like C/C++ standards
target_compile_features(_quicktex PUBLIC cxx_std_20 c_std_11)
target_compile_features(test_quicktex PUBLIC cxx_std_20 c_std_11)
target_compile_features(_quicktex PUBLIC cxx_std_17 c_std_11)
target_compile_features(test_quicktex PUBLIC cxx_std_17 c_std_11)
set_project_warnings(_quicktex)
set_project_warnings(test_quicktex)

@ -122,4 +122,7 @@ uint16_t Color::Pack565Unscaled() const { return Pack565Unscaled(r, g, b); }
Color Color::ScaleTo565() const { return Color(scale8To5(r), scale8To6(g), scale8To5(b)); }
Color Color::ScaleFrom565() const { return Color(scale5To8(r), scale6To8(g), scale5To8(b)); }
bool Color::operator==(const Color &Rhs) const { return r == Rhs.r && g == Rhs.g && b == Rhs.b && a == Rhs.a; }
bool Color::operator!=(const Color &Rhs) const { return !(Rhs == *this); }
} // namespace quicktex

@ -51,7 +51,8 @@ class Color {
static Color Min(const Color &A, const Color &B);
static Color Max(const Color &A, const Color &B);
bool operator==(const Color &Rhs) const { return r == Rhs.r && g == Rhs.g && b == Rhs.b && a == Rhs.a; }
bool operator==(const Color &Rhs) const;
bool operator!=(const Color &Rhs) const;
uint8_t operator[](size_t index) const {
assert(index < 4);

@ -41,4 +41,7 @@ void BC1Block::SetSelectors(const BC1Block::SelectorArray& unpacked) {
_selectors = MapArray(unpacked, Pack<uint8_t, uint8_t, SelectorBits, Width>);
}
bool BC1Block::operator==(const BC1Block& Rhs) const { return _color0 == Rhs._color0 && _color1 == Rhs._color1 && _selectors == Rhs._selectors; }
bool BC1Block::operator!=(const BC1Block& Rhs) const { return !(Rhs == *this); }
} // namespace quicktex::s3tc

@ -121,7 +121,7 @@ class alignas(8) BC1Block {
bool Is3Color() const { return GetColor0Raw() <= GetColor1Raw(); }
bool operator==(const BC1Block& other) const = default;
bool operator!=(const BC1Block& other) const = default;
bool operator==(const BC1Block& Rhs) const;
bool operator!=(const BC1Block& Rhs) const;
};
} // namespace quicktex::s3tc

@ -54,7 +54,7 @@ class alignas(8) BC3Block {
color_block = blocks.second;
}
bool operator==(const BC3Block &other) const = default;
bool operator!=(const BC3Block &other) const = default;
bool operator==(const BC3Block &Rhs) const { return alpha_block == Rhs.alpha_block && color_block == Rhs.color_block; }
bool operator!=(const BC3Block &Rhs) const { return !(Rhs == *this); }
};
} // namespace quicktex::s3tc

@ -19,8 +19,8 @@
#include "BC4Block.h"
#include <stdexcept>
#include <algorithm>
#include <stdexcept>
#include "../../util.h"
@ -63,4 +63,7 @@ std::array<uint8_t, 8> BC4Block::GetValues8() const {
static_cast<uint8_t>((alpha0 * 2 + alpha1 * 5) / 7),
static_cast<uint8_t>((alpha0 + alpha1 * 6) / 7)};
}
bool BC4Block::operator==(const BC4Block& Rhs) const { return alpha0 == Rhs.alpha0 && alpha1 == Rhs.alpha1 && _selectors == Rhs._selectors; }
bool BC4Block::operator!=(const BC4Block& Rhs) const { return !(Rhs == *this); }
} // namespace quicktex::s3tc

@ -97,8 +97,8 @@ class alignas(8) BC4Block {
/// The interpolated values of this block as an array of 8 integers.
std::array<uint8_t, 8> GetValues() const { return Is6Value() ? GetValues6() : GetValues8(); }
bool operator==(const BC4Block& other) const = default;
bool operator!=(const BC4Block& other) const = default;
bool operator==(const BC4Block& Rhs) const;
bool operator!=(const BC4Block& Rhs) const;
private:
std::array<uint8_t, 8> GetValues6() const;

@ -53,7 +53,7 @@ class alignas(8) BC5Block {
chan1_block = pair.second;
}
bool operator==(const BC5Block &other) const = default;
bool operator!=(const BC5Block &other) const = default;
bool operator==(const BC5Block &Rhs) const { return chan0_block == Rhs.chan0_block && chan1_block == Rhs.chan1_block; }
bool operator!=(const BC5Block &Rhs) const { return !(Rhs == *this); }
};
} // namespace quicktex::s3tc
Loading…
Cancel
Save