Some minor ports for Linux. No idea how it worked at all in Windows with STB_RESIZE_IMPLEMENTATION instead of STB_RESAMPLE_IMPLEMENTATION.

pull/32/head
Jorge Rodriguez 2014-07-30 17:30:25 -07:00
parent c5de2f3298
commit fdc979e48b
1 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@
#define STBR_ASSERT(x) \ #define STBR_ASSERT(x) \
if (!(x)) \ if (!(x)) \
__debugbreak(); __debugbreak();
#else
#include <assert.h>
#define STBR_ASSERT(x) assert(x)
#endif #endif
#define STB_RESAMPLE_IMPLEMENTATION #define STB_RESAMPLE_IMPLEMENTATION
@ -28,7 +31,7 @@ int main(int argc, char** argv)
int n; int n;
int out_w, out_h, out_stride; int out_w, out_h, out_stride;
#if 1 #if 0
test_suite(); test_suite();
return 0; return 0;
#endif #endif
@ -210,7 +213,7 @@ void test_float(const char* file, float width_percent, float height_percent, stb
free(output_data); free(output_data);
} }
void test_channels(char* file, float width_percent, float height_percent, int channels) void test_channels(const char* file, float width_percent, float height_percent, int channels)
{ {
int w, h, n; int w, h, n;
unsigned char* input_data = stbi_load(file, &w, &h, &n, 0); unsigned char* input_data = stbi_load(file, &w, &h, &n, 0);