Skip to content
Myr

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

2 files+13 added−12 removed

modified:tests/test_c_compilation.c+3 added-2 removed
2 unmodified lines
3#include "stb_sprintf.h"45#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_IMEPLEMENTATIOn
6 unmodified lines
17#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"2526#define STB_DXT_IMPLEMENTATION27#include "stb_dxt.h"2829#define STBVOX_CONFIG_MODE 130#include "stb_voxel_render.h"3132#define STBTE_DRAW_RECT(x0,y0,x1,y1,color) 0
11 unmodified lines
modified: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 lines
3132#ifndef STB_INCLUDE_STB_DXT_H33#define STB_INCLUDE_STB_DXT_H3435// 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.3935#ifdef __cplusplus36extern "C" {37#endif38
2 unmodified lines
41#else42#define STBDDEF extern43#endif4445// 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.4950STBDDEF void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src_rgba_four_bytes_per_pixel, int alpha, int mode);51STBDDEF void stb_compress_bc4_block(unsigned char *dest, const unsigned char *src_r_one_byte_per_pixel);52STBDDEF void stb_compress_bc5_block(unsigned char *dest, const unsigned char *src_rg_two_byte_per_pixel);5354#define STB_COMPRESS_DXT_BLOCK5556#ifdef __cplusplus57}58#endif59#endif // STB_INCLUDE_STB_DXT_H6058#define STB_COMPRESS_DXT_BLOCK5961#ifdef STB_DXT_IMPLEMENTATION6263// configuration options for DXT encoder. set them in the project/makefile or just define64// them at the top.
585 unmodified lines
650}651652void 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 lines
683 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_H687688/*689------------------------------------------------------------------------------690This software is available under 2 licenses -- choose whichever you prefer.
38 unmodified lines