Skip to content

Commit

Permalink
fix: _tex1.dds alpha generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jochumdev committed Dec 17, 2023
1 parent 3115672 commit 0d320df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ bool Image::threedo_to_s3o() {
for (std::size_t pw = 0; pw < width_; pw++) {
if (data_ptr[1] < 60) {
// trunk-ignore(clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic)
data_ptr[3] = std::clamp((255 - data_ptr[1]) * 1.5, 0.0, 255.0);
data_ptr[3] = std::clamp(255 - data_ptr[1], 0, 255);
} else {
// TODO(jochumdev): is that needed?
data_ptr[3] = 0;
Expand All @@ -233,7 +233,7 @@ bool Image::threedo_to_s3o() {
data_ptr[1] = data_ptr[0];

// trunk-ignore(clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic)
data_ptr[3] = std::clamp((255 - data_ptr[3]) * 1.5, 0.0, 255.0);
data_ptr[3] = std::clamp(255 - data_ptr[3], 0, 255);

// trunk-ignore(clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic)
*data_pptr += bpp_;
Expand Down

0 comments on commit 0d320df

Please sign in to comment.