From e00603b5118d0944b014a284b81382d064d9b0da Mon Sep 17 00:00:00 2001 From: lzwdgc Date: Mon, 22 Apr 2024 02:20:53 +0300 Subject: [PATCH] Misc. --- .gitignore | 4 +++- src/common/dxt5.h | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 89320d5..b471a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,6 @@ doc *.dat *.ind *.tab -*.json \ No newline at end of file +*.json + +*.bmp \ No newline at end of file diff --git a/src/common/dxt5.h b/src/common/dxt5.h index c4b77fe..9e43183 100644 --- a/src/common/dxt5.h +++ b/src/common/dxt5.h @@ -24,6 +24,10 @@ #include "color.h" #include "mat.h" +// https://en.wikipedia.org/wiki/S3_Texture_Compression +// decompressor https://github.com/Benjamin-Dobell/s3tc-dxt-decompression +// compressor https://github.com/nothings/stb/blob/master/stb_dxt.h +// or modified https://github.com/Cyan4973/RygsDXTc/blob/master/stb_dxt.h struct dxt5_block { union @@ -99,7 +103,7 @@ struct dxt5_block pixels[p].a = a[(alpha_part >> (16 + p * 3)) & 0b111]; } } - color interpolate(color c0, color c1, float m) + static color interpolate(color c0, color c1, float m) { color r; for (int i = 0; i < 4; i++)