Skip to content

Commit

Permalink
Updated the Windows build to:
Browse files Browse the repository at this point in the history
Visual Studio 2008
jpeg-8c
libpng-1.5.7
libwebp-0.1.3
tiff-4.0.0
zlib-1.2.5

All Windows binaries have been rebuilt with mingw-w32-1.0
  • Loading branch information
slouken committed Jan 2, 2012
1 parent 4df12aa commit 148cb6c
Show file tree
Hide file tree
Showing 42 changed files with 6,332 additions and 6,331 deletions.
2 changes: 1 addition & 1 deletion IMG_gif.c
Expand Up @@ -177,7 +177,7 @@ IMG_LoadGIF_RW(SDL_RWops *src)
RWSetMsg("not a GIF file");
goto done;
}
strncpy(version, (char *) buf + 3, 3);
memcpy(version, (char *) buf + 3, 3);
version[3] = '\0';

if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
Expand Down
2 changes: 1 addition & 1 deletion IMG_jpg.c
Expand Up @@ -260,7 +260,7 @@ static void init_source (j_decompress_ptr cinfo)
/*
* Fill the input buffer --- called whenever buffer is emptied.
*/
static int fill_input_buffer (j_decompress_ptr cinfo)
static boolean fill_input_buffer (j_decompress_ptr cinfo)
{
my_source_mgr * src = (my_source_mgr *) cinfo->src;
int nbytes;
Expand Down
19 changes: 11 additions & 8 deletions IMG_webp.c
Expand Up @@ -124,6 +124,7 @@ void IMG_QuitWEBP()
static int webp_getinfo( SDL_RWops *src, int *datasize ) {
int start;
int is_WEBP;
int data;
Uint8 magic[20];

if ( !src )
Expand All @@ -144,7 +145,7 @@ static int webp_getinfo( SDL_RWops *src, int *datasize ) {
magic[14] == '8' &&
magic[15] == ' ' ) {
is_WEBP = 1;
int data = magic[16] | magic[17]<<8 | magic[18]<<16 | magic[19]<<24;
data = magic[16] | magic[17]<<8 | magic[18]<<16 | magic[19]<<24;
if ( datasize )
*datasize = data;
}
Expand All @@ -168,6 +169,11 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
WebPBitstreamFeatures features;
int raw_data_size;
uint8_t *raw_data;
int r;
uint8_t *ret;

if ( !src ) {
/* The error message has been set in SDL_RWFromFile */
Expand All @@ -181,7 +187,7 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)
}


int raw_data_size = -1;
raw_data_size = -1;
if ( !webp_getinfo( src, &raw_data_size ) ) {
error = "Invalid WEBP";
goto error;
Expand All @@ -190,13 +196,13 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)
// skip header
SDL_RWseek(src, start+20, RW_SEEK_SET );

uint8_t *raw_data = (uint8_t*) malloc( raw_data_size );
raw_data = (uint8_t*) malloc( raw_data_size );
if ( raw_data == NULL ) {
error = "Failed to allocate enought buffer for WEBP";
goto error;
}

int r = SDL_RWread(src, raw_data, 1, raw_data_size );
r = SDL_RWread(src, raw_data, 1, raw_data_size );
if ( r != raw_data_size ) {
error = "Failed to read WEBP";
goto error;
Expand All @@ -211,8 +217,7 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)
}
#endif

WebPBitstreamFeatures features;
if ( lib.webp_get_features_internal( raw_data, raw_data_size, &features, WEBP_DECODER_ABI_VERSION ) != VP8_STATUS_OK ) {
if ( lib.webp_get_features_internal( raw_data, raw_data_size, &features, WEBP_DECODER_ABI_VERSION ) != VP8_STATUS_OK ) {
error = "WebPGetFeatures has failed";
return NULL;
}
Expand All @@ -231,8 +236,6 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)
goto error;
}


uint8_t *ret = NULL;
if ( features.has_alpha ) {
ret = lib.webp_decode_rgba_into( raw_data, raw_data_size, surface->pixels, surface->pitch * surface->h, surface->pitch );
} else {
Expand Down
6 changes: 4 additions & 2 deletions IMG_xpm.c
Expand Up @@ -245,6 +245,8 @@ static char *error;
*/
static char *get_next_line(char ***lines, SDL_RWops *src, int len)
{
char *linebufnew;

if(lines) {
return *(*lines)++;
} else {
Expand All @@ -260,7 +262,7 @@ static char *get_next_line(char ***lines, SDL_RWops *src, int len)
len += 4; /* "\",\n\0" */
if(len > buflen){
buflen = len;
char *linebufnew = realloc(linebuf, buflen);
linebufnew = realloc(linebuf, buflen);
if(!linebufnew) {
free(linebuf);
error = "Out of memory";
Expand All @@ -280,7 +282,7 @@ static char *get_next_line(char ***lines, SDL_RWops *src, int len)
if(buflen == 0)
buflen = 16;
buflen *= 2;
char *linebufnew = realloc(linebuf, buflen);
linebufnew = realloc(linebuf, buflen);
if(!linebufnew) {
free(linebuf);
error = "Out of memory";
Expand Down
164 changes: 0 additions & 164 deletions VisualC/SDL_image.dsp

This file was deleted.

41 changes: 0 additions & 41 deletions VisualC/SDL_image.dsw

This file was deleted.

4 changes: 2 additions & 2 deletions VisualC/SDL_image.sln
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL_image", "SDL_image.vcproj", "{2BD5534E-00E2-4BEA-AC96-D9A92EA24696}"
EndProject
Global
Expand Down

0 comments on commit 148cb6c

Please sign in to comment.