Updated Visual C++ project with dynamic image library loading
authorSam Lantinga <slouken@libsdl.org>
Fri, 12 May 2006 19:06:09 +0000
changeset 1456d65a8d8b1d1
parent 144 2ea01e919685
child 146 aaa5876f41ab
Updated Visual C++ project with dynamic image library loading
IMG_tif.c
VisualC.zip
showimage.c
     1.1 --- a/IMG_tif.c	Fri May 12 06:01:24 2006 +0000
     1.2 +++ b/IMG_tif.c	Fri May 12 19:06:09 2006 +0000
     1.3 @@ -204,7 +204,7 @@
     1.4  	TIFF* tiff;
     1.5  	SDL_Surface* surface = NULL;
     1.6  	Uint32 img_width, img_height;
     1.7 -	Uint32 Rmask, Gmask, Bmask, Amask, mask;
     1.8 +	Uint32 Rmask, Gmask, Bmask, Amask;
     1.9  	Uint32 x, y;
    1.10  	Uint32 half;
    1.11  
     2.1 Binary file VisualC.zip has changed
     3.1 --- a/showimage.c	Fri May 12 06:01:24 2006 +0000
     3.2 +++ b/showimage.c	Fri May 12 19:06:09 2006 +0000
     3.3 @@ -49,21 +49,21 @@
     3.4  	    Uint32 c = col[((x ^ y) >> 3) & 1];
     3.5  	    switch(bpp) {
     3.6  	    case 1:
     3.7 -		dst[x] = c;
     3.8 +		dst[x] = (Uint8)c;
     3.9  		break;
    3.10  	    case 2:
    3.11 -		((Uint16 *)dst)[x] = c;
    3.12 +		((Uint16 *)dst)[x] = (Uint16)c;
    3.13  		break;
    3.14  	    case 3:
    3.15 -		if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {
    3.16 -		    dst[x * 3] = c;
    3.17 -		    dst[x * 3 + 1] = c >> 8;
    3.18 -		    dst[x * 3 + 2] = c >> 16;
    3.19 -		} else {
    3.20 -		    dst[x * 3] = c >> 16;
    3.21 -		    dst[x * 3 + 1] = c >> 8;
    3.22 -		    dst[x * 3 + 2] = c;
    3.23 -		}
    3.24 +#if SDL_BYTEORDER == SDL_LIL_ENDIAN
    3.25 +		dst[x * 3]     = (Uint8)(c);
    3.26 +		dst[x * 3 + 1] = (Uint8)(c >> 8);
    3.27 +		dst[x * 3 + 2] = (Uint8)(c >> 16);
    3.28 +#else
    3.29 +		dst[x * 3]     = (Uint8)(c >> 16);
    3.30 +		dst[x * 3 + 1] = (Uint8)(c >> 8);
    3.31 +		dst[x * 3 + 2] = (Uint8)(c);
    3.32 +#endif
    3.33  		break;
    3.34  	    case 4:
    3.35  		((Uint32 *)dst)[x] = c;