fix stb_dxt.h; fix misspelled STB_DXT_IMPLEMENTATION in test jig
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parent f2974f6 · Browse files · 2 files·+13 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+13 added−12 removed
- tests:+3 added−2 removed
- other:+10 added−10 removed
Provenance
- Commit
06feddd- Tree
a87225b- Author
Sean Barrett <sean@nothings.org>- Committer
Sean Barrett <sean@nothings.org>- Parent
f2974f6
2 files changed+13 added−12 removed
modified:tests/test_c_compilation.c+3 added-2 removed
2 unmodified lines3 #include "stb_sprintf.h"4 5 #define STB_PERLIN_IMPLEMENTATION6 #define STB_IMAGE_WRITE_IMPLEMENTATION7-#define STB_DXT_IMPLEMENATION7 #define STB_C_LEXER_IMPLEMENTATIOn8 #define STB_DIVIDE_IMPLEMENTATION9 #define STB_IMAGE_IMPLEMENTATION10 #define STB_HERRINGBONE_WANG_TILE_IMEPLEMENTATIOn6 unmodified lines17 #include "stb_herringbone_wang_tile.h"18 #include "stb_image.h"19 #include "stb_image_write.h"20 #include "stb_perlin.h"22-#include "stb_dxt.h"21 #include "stb_c_lexer.h"22 #include "stb_divide.h"23 #include "stb_image_resize.h"24 #include "stb_rect_pack.h"25 26+#define STB_DXT_IMPLEMENTATION27+#include "stb_dxt.h"28+29 #define STBVOX_CONFIG_MODE 130 #include "stb_voxel_render.h"31 32 #define STBTE_DRAW_RECT(x0,y0,x1,y1,color) 011 unmodified linesmodified:stb_dxt.h+10 added-10 removed
1-// stb_dxt.h - v1.08 - DXT1/DXT5 compressor - public domain1+// stb_dxt.h - v1.08b - DXT1/DXT5 compressor - public domain2 // original by fabian "ryg" giesen - ported to C by stb3 // use '#define STB_DXT_IMPLEMENTATION' before including to create the implementation4 //5 // USAGE:25 unmodified lines31 32 #ifndef STB_INCLUDE_STB_DXT_H33 #define STB_INCLUDE_STB_DXT_H34 35-// compression mode (bitflags)36-#define STB_DXT_NORMAL 037-#define STB_DXT_DITHER 1 // use dithering. dubious win. never use for normal maps and the like!38-#define STB_DXT_HIGHQUAL 2 // high quality mode, does two refinement steps instead of 1. ~30-40% slower.39-35 #ifdef __cplusplus36 extern "C" {37 #endif38 2 unmodified lines41 #else42 #define STBDDEF extern43 #endif44 45+// compression mode (bitflags)46+#define STB_DXT_NORMAL 047+#define STB_DXT_DITHER 1 // use dithering. dubious win. never use for normal maps and the like!48+#define STB_DXT_HIGHQUAL 2 // high quality mode, does two refinement steps instead of 1. ~30-40% slower.49+50 STBDDEF void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src_rgba_four_bytes_per_pixel, int alpha, int mode);51 STBDDEF void stb_compress_bc4_block(unsigned char *dest, const unsigned char *src_r_one_byte_per_pixel);52 STBDDEF void stb_compress_bc5_block(unsigned char *dest, const unsigned char *src_rg_two_byte_per_pixel);53 54+#define STB_COMPRESS_DXT_BLOCK55+56 #ifdef __cplusplus57 }58 #endif59+#endif // STB_INCLUDE_STB_DXT_H60 58-#define STB_COMPRESS_DXT_BLOCK59-61 #ifdef STB_DXT_IMPLEMENTATION62 63 // configuration options for DXT encoder. set them in the project/makefile or just define64 // them at the top.585 unmodified lines650 }651 652 void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src, int alpha, int mode)653 {653- unsigned char *data[16][4];654+ unsigned char data[16][4];655 static int init=1;656 if (init) {657 stb__InitDXT();658 init=0;24 unmodified lines683 stb__CompressAlphaBlock(dest,(unsigned char*) src,2);684 stb__CompressAlphaBlock(dest + 8,(unsigned char*) src+1,2);685 }686 #endif // STB_DXT_IMPLEMENTATION686-#endif // STB_INCLUDE_STB_DXT_H687 688 /*689 ------------------------------------------------------------------------------690 This software is available under 2 licenses -- choose whichever you prefer.38 unmodified lines