Merge branch 'master' of https://github.com/LysanderGG/stb into working

This commit is contained in:
Sean Barrett 2014-07-09 23:03:32 -07:00
commit 70de0adb28
7 changed files with 29 additions and 25 deletions

View File

@ -12,6 +12,7 @@ library | lastest version | category | description
**stretchy_buffer.h** | 1.01 | utility | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++
**stb_textedit.h** | 1.3 | UI | guts of a text editor for games etc implementing them from scratch
**stb_dxt.h** | 1.04 | 3D&nbsp;graphics | Fabian "ryg" Giesen's real-time DXT compressor
**stb_herringbone_wang_tile.h** | 0.5 | games | herringbone Wang tile map generator
**stb_perlin.h** | 0.2 | 3D&nbsp;graphics | revised Perlin noise (3D input, 1D output)
**stb_c_lexer.h** | 0.06 | parsing | simplify writing parsers for C-like languages
**stb_divide.h** | 0.91 | math | more useful 32-bit modulus e.g. "euclidean divide"

View File

@ -1,4 +1,4 @@
/* stbhw - v0.5 - http://nothings.org/stb/stb_herringbone_wang_tile.h
/* stbhw - v0.5 - http://nothings.org/gamedev/herringbone
Herringbone Wang Tile Generator - Sean Barrett 2014 - public domain
This file is in the public domain. In case that declaration is ineffective,

View File

@ -553,6 +553,7 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);
static unsigned char *stbi_load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
s->img_n = 0;
if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp);
if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp);
if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp);
@ -1807,8 +1808,9 @@ static void stbi__cleanup_jpeg(stbi__jpeg *j)
{
int i;
for (i=0; i < j->s->img_n; ++i) {
if (j->img_comp[i].data) {
if (j->img_comp[i].raw_data) {
free(j->img_comp[i].raw_data);
j->img_comp[i].raw_data = NULL;
j->img_comp[i].data = NULL;
}
if (j->img_comp[i].linebuf) {

View File

@ -378,7 +378,7 @@ int main(int arg, char **argv)
#ifndef STBTT_malloc
#include <stdlib.h>
#define STBTT_malloc(x,u) ((void)(u),malloc(x))
#define STBTT_free(x,u) free(x)
#define STBTT_free(x,u) ((void)(u),free(x))
#endif
#ifndef STBTT_assert

View File

@ -1084,7 +1084,7 @@ static void compute_accelerated_huffman(Codebook *c)
}
}
static int uint32_compare(const void *p, const void *q)
static int __cdecl uint32_compare(const void *p, const void *q)
{
uint32 x = * (uint32 *) p;
uint32 y = * (uint32 *) q;
@ -1240,7 +1240,7 @@ typedef struct
uint16 x,y;
} Point;
int point_compare(const void *p, const void *q)
int __cdecl point_compare(const void *p, const void *q)
{
Point *a = (Point *) p;
Point *b = (Point *) q;

View File

@ -5,6 +5,7 @@ stb_image_write.h | graphics | image writing to disk: PNG, TGA, BMP
stretchy_buffer.h | utility | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++
stb_textedit.h | UI | guts of a text editor for games etc implementing them from scratch
stb_dxt.h | 3D graphics | Fabian "ryg" Giesen's real-time DXT compressor
stb_herringbone_wang_tile.h | games | herringbone Wang tile map generator
stb_perlin.h | 3D graphics | revised Perlin noise (3D input, 1D output)
stb_c_lexer.h | parsing | simplify writing parsers for C-like languages
stb_divide.h | math | more useful 32-bit modulus e.g. "euclidean divide"