diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index fe3937a..b573305 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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? diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b6d02c..6bd8d01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/quicktex/Color.cpp b/quicktex/Color.cpp index 15eeac3..5ebe072 100644 --- a/quicktex/Color.cpp +++ b/quicktex/Color.cpp @@ -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 \ No newline at end of file diff --git a/quicktex/Color.h b/quicktex/Color.h index e4b0b84..53bc3ef 100644 --- a/quicktex/Color.h +++ b/quicktex/Color.h @@ -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); diff --git a/quicktex/s3tc/bc1/BC1Block.cpp b/quicktex/s3tc/bc1/BC1Block.cpp index 42ce407..53f3d86 100644 --- a/quicktex/s3tc/bc1/BC1Block.cpp +++ b/quicktex/s3tc/bc1/BC1Block.cpp @@ -41,4 +41,7 @@ void BC1Block::SetSelectors(const BC1Block::SelectorArray& unpacked) { _selectors = MapArray(unpacked, Pack); } +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 diff --git a/quicktex/s3tc/bc1/BC1Block.h b/quicktex/s3tc/bc1/BC1Block.h index 4bde4b1..9aa6dbf 100644 --- a/quicktex/s3tc/bc1/BC1Block.h +++ b/quicktex/s3tc/bc1/BC1Block.h @@ -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 \ No newline at end of file diff --git a/quicktex/s3tc/bc3/BC3Block.h b/quicktex/s3tc/bc3/BC3Block.h index 07d005b..c91ac0b 100644 --- a/quicktex/s3tc/bc3/BC3Block.h +++ b/quicktex/s3tc/bc3/BC3Block.h @@ -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 \ No newline at end of file diff --git a/quicktex/s3tc/bc4/BC4Block.cpp b/quicktex/s3tc/bc4/BC4Block.cpp index ff33bf9..75ed739 100644 --- a/quicktex/s3tc/bc4/BC4Block.cpp +++ b/quicktex/s3tc/bc4/BC4Block.cpp @@ -19,8 +19,8 @@ #include "BC4Block.h" -#include #include +#include #include "../../util.h" @@ -63,4 +63,7 @@ std::array BC4Block::GetValues8() const { static_cast((alpha0 * 2 + alpha1 * 5) / 7), static_cast((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 diff --git a/quicktex/s3tc/bc4/BC4Block.h b/quicktex/s3tc/bc4/BC4Block.h index c4fbfa0..f51fb12 100644 --- a/quicktex/s3tc/bc4/BC4Block.h +++ b/quicktex/s3tc/bc4/BC4Block.h @@ -97,8 +97,8 @@ class alignas(8) BC4Block { /// The interpolated values of this block as an array of 8 integers. std::array 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 GetValues6() const; diff --git a/quicktex/s3tc/bc5/BC5Block.h b/quicktex/s3tc/bc5/BC5Block.h index 17edadb..ba5807a 100644 --- a/quicktex/s3tc/bc5/BC5Block.h +++ b/quicktex/s3tc/bc5/BC5Block.h @@ -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 \ No newline at end of file