Commit bb11c757 authored by Sam Lantinga's avatar Sam Lantinga

Update for Visual C++ 6.0

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401432
parent 90e00973
No preview for this file type
...@@ -34,6 +34,9 @@ typedef __int32 int32_t; ...@@ -34,6 +34,9 @@ typedef __int32 int32_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef __int64 int64_t; typedef __int64 int64_t;
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
#if _MSC_VER <= 1200
typedef unsigned long uintptr_t;
#endif
#endif #endif
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
......
...@@ -47,7 +47,7 @@ void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format) ...@@ -47,7 +47,7 @@ void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
if ( sample > 255 ) { if ( sample > 255 ) {
*dst = 255; *dst = 255;
} else { } else {
*dst = sample; *dst = (Uint8)sample;
} }
src += 2; src += 2;
dst += 1; dst += 1;
...@@ -68,7 +68,7 @@ void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format) ...@@ -68,7 +68,7 @@ void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
if ( sample < -128 ) { if ( sample < -128 ) {
*dst = -128; *dst = -128;
} else { } else {
*dst = sample; *dst = (Sint8)sample;
} }
src += 2; src += 2;
dst += 1; dst += 1;
...@@ -185,10 +185,8 @@ void SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format) ...@@ -185,10 +185,8 @@ void SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format)
src = cvt->buf; src = cvt->buf;
dst = cvt->buf; dst = cvt->buf;
for ( i=cvt->len_cvt/6; i; --i ) { for ( i=cvt->len_cvt/6; i; --i ) {
lsample = src[0]; dst[0] = src[0];
rsample = src[1]; dst[1] = src[1];
dst[0] = lsample;
dst[1] = rsample;
src += 6; src += 6;
dst += 2; dst += 2;
} }
...@@ -201,10 +199,8 @@ void SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format) ...@@ -201,10 +199,8 @@ void SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format)
src = (Sint8 *)cvt->buf; src = (Sint8 *)cvt->buf;
dst = (Sint8 *)cvt->buf; dst = (Sint8 *)cvt->buf;
for ( i=cvt->len_cvt/6; i; --i ) { for ( i=cvt->len_cvt/6; i; --i ) {
lsample = src[0]; dst[0] = src[0];
rsample = src[1]; dst[1] = src[1];
dst[0] = lsample;
dst[1] = rsample;
src += 6; src += 6;
dst += 2; dst += 2;
} }
...@@ -305,10 +301,8 @@ void SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format) ...@@ -305,10 +301,8 @@ void SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format)
src = cvt->buf; src = cvt->buf;
dst = cvt->buf; dst = cvt->buf;
for ( i=cvt->len_cvt/4; i; --i ) { for ( i=cvt->len_cvt/4; i; --i ) {
lsample = src[0]; dst[0] = src[0];
rsample = src[1]; dst[1] = src[1];
dst[0] = lsample;
dst[1] = rsample;
src += 4; src += 4;
dst += 2; dst += 2;
} }
...@@ -321,10 +315,8 @@ void SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format) ...@@ -321,10 +315,8 @@ void SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format)
src = (Sint8 *)cvt->buf; src = (Sint8 *)cvt->buf;
dst = (Sint8 *)cvt->buf; dst = (Sint8 *)cvt->buf;
for ( i=cvt->len_cvt/4; i; --i ) { for ( i=cvt->len_cvt/4; i; --i ) {
lsample = src[0]; dst[0] = src[0];
rsample = src[1]; dst[1] = src[1];
dst[0] = lsample;
dst[1] = rsample;
src += 4; src += 4;
dst += 2; dst += 2;
} }
......
...@@ -108,9 +108,9 @@ static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state, ...@@ -108,9 +108,9 @@ static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state,
if ( delta < 16 ) { if ( delta < 16 ) {
delta = 16; delta = 16;
} }
state->iDelta = delta; state->iDelta = (Uint16)delta;
state->iSamp2 = state->iSamp1; state->iSamp2 = state->iSamp1;
state->iSamp1 = new_sample; state->iSamp1 = (Sint16)new_sample;
return(new_sample); return(new_sample);
} }
...@@ -371,8 +371,8 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) ...@@ -371,8 +371,8 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
} }
/* Store the initial sample we start with */ /* Store the initial sample we start with */
decoded[0] = state[c].sample&0xFF; decoded[0] = (Uint8)(state[c].sample&0xFF);
decoded[1] = state[c].sample>>8; decoded[1] = (Uint8)(state[c].sample>>8);
decoded += 2; decoded += 2;
} }
......
...@@ -110,9 +110,9 @@ ...@@ -110,9 +110,9 @@
#define PIXEL_COPY(to, from, len, bpp) \ #define PIXEL_COPY(to, from, len, bpp) \
do { \ do { \
if(bpp == 4) { \ if(bpp == 4) { \
SDL_memcpy4(to, from, (unsigned)(len)); \ SDL_memcpy4(to, from, (size_t)(len)); \
} else { \ } else { \
SDL_memcpy(to, from, (unsigned)(len) * (bpp)); \ SDL_memcpy(to, from, (size_t)(len) * (bpp)); \
} \ } \
} while(0) } while(0)
...@@ -423,7 +423,7 @@ do { \ ...@@ -423,7 +423,7 @@ do { \
d = (d | d << 16) & 0x07e0f81f; \ d = (d | d << 16) & 0x07e0f81f; \
d += (s - d) * ALPHA >> 5; \ d += (s - d) * ALPHA >> 5; \
d &= 0x07e0f81f; \ d &= 0x07e0f81f; \
*dst++ = d | d >> 16; \ *dst++ = (Uint16)(d | d >> 16); \
} \ } \
} while(0) } while(0)
...@@ -440,7 +440,7 @@ do { \ ...@@ -440,7 +440,7 @@ do { \
d = (d | d << 16) & 0x03e07c1f; \ d = (d | d << 16) & 0x03e07c1f; \
d += (s - d) * ALPHA >> 5; \ d += (s - d) * ALPHA >> 5; \
d &= 0x03e07c1f; \ d &= 0x03e07c1f; \
*dst++ = d | d >> 16; \ *dst++ = (Uint16)(d | d >> 16); \
} \ } \
} while(0) } while(0)
...@@ -482,17 +482,17 @@ do { \ ...@@ -482,17 +482,17 @@ do { \
PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \ PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \
switch(bpp) { \ switch(bpp) { \
case 2: \ case 2: \
*(Uint16 *)dst = d; \ *(Uint16 *)dst = (Uint16)d; \
break; \ break; \
case 3: \ case 3: \
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \
dst[0] = d >> 16; \ dst[0] = (Uint8)(d >> 16); \
dst[1] = d >> 8; \ dst[1] = (Uint8)(d >> 8); \
dst[2] = d; \ dst[2] = (Uint8)(d); \
} else { \ } else { \
dst[0] = d; \ dst[0] = (Uint8)d; \
dst[1] = d >> 8; \ dst[1] = (Uint8)(d >> 8); \
dst[2] = d >> 16; \ dst[2] = (Uint8)(d >> 16); \
} \ } \
break; \ break; \
case 4: \ case 4: \
...@@ -575,10 +575,10 @@ do { \ ...@@ -575,10 +575,10 @@ do { \
/* helper: blend a single 16 bit pixel at 50% */ /* helper: blend a single 16 bit pixel at 50% */
#define BLEND16_50(dst, src, mask) \ #define BLEND16_50(dst, src, mask) \
do { \ do { \
Uint32 s = *src++; \ Uint32 s = *src++; \
Uint32 d = *dst; \ Uint32 d = *dst; \
*dst++ = (((s & mask) + (d & mask)) >> 1) \ *dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) + \
+ (s & d & (~mask & 0xffff)); \ (s & d & (~mask & 0xffff))); \
} while(0) } while(0)
/* basic 16bpp blender. mask is the pixels to keep when adding. */ /* basic 16bpp blender. mask is the pixels to keep when adding. */
...@@ -971,32 +971,32 @@ done: ...@@ -971,32 +971,32 @@ done:
*/ */
#define BLIT_TRANSL_565(src, dst) \ #define BLIT_TRANSL_565(src, dst) \
do { \ do { \
Uint32 s = src; \ Uint32 s = src; \
Uint32 d = dst; \ Uint32 d = dst; \
unsigned alpha = (s & 0x3e0) >> 5; \ unsigned alpha = (s & 0x3e0) >> 5; \
s &= 0x07e0f81f; \ s &= 0x07e0f81f; \
d = (d | d << 16) & 0x07e0f81f; \ d = (d | d << 16) & 0x07e0f81f; \
d += (s - d) * alpha >> 5; \ d += (s - d) * alpha >> 5; \
d &= 0x07e0f81f; \ d &= 0x07e0f81f; \
dst = d | d >> 16; \ dst = (Uint16)(d | d >> 16); \
} while(0) } while(0)
#define BLIT_TRANSL_555(src, dst) \ #define BLIT_TRANSL_555(src, dst) \
do { \ do { \
Uint32 s = src; \ Uint32 s = src; \
Uint32 d = dst; \ Uint32 d = dst; \
unsigned alpha = (s & 0x3e0) >> 5; \ unsigned alpha = (s & 0x3e0) >> 5; \
s &= 0x03e07c1f; \ s &= 0x03e07c1f; \
d = (d | d << 16) & 0x03e07c1f; \ d = (d | d << 16) & 0x03e07c1f; \
d += (s - d) * alpha >> 5; \ d += (s - d) * alpha >> 5; \
d &= 0x03e07c1f; \ d &= 0x03e07c1f; \
dst = d | d >> 16; \ dst = (Uint16)(d | d >> 16); \
} while(0) } while(0)
/* used to save the destination format in the encoding. Designed to be /* used to save the destination format in the encoding. Designed to be
macro-compatible with SDL_PixelFormat but without the unneeded fields */ macro-compatible with SDL_PixelFormat but without the unneeded fields */
typedef struct { typedef struct {
Uint8 BytesPerPixel; Uint8 BytesPerPixel;
Uint8 Rloss; Uint8 Rloss;
Uint8 Gloss; Uint8 Gloss;
Uint8 Bloss; Uint8 Bloss;
......
...@@ -1483,9 +1483,9 @@ static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask) ...@@ -1483,9 +1483,9 @@ static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask)
if(w) { if(w) {
Uint16 d = *dstp, s; Uint16 d = *dstp, s;
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
s = prev_sw; s = (Uint16)prev_sw;
else else
s = prev_sw >> 16; s = (Uint16)(prev_sw >> 16);
*dstp = BLEND16_50(d, s, mask); *dstp = BLEND16_50(d, s, mask);
srcp++; srcp++;
dstp++; dstp++;
...@@ -1858,7 +1858,7 @@ static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info) ...@@ -1858,7 +1858,7 @@ static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
d = (d | d << 16) & 0x07e0f81f; d = (d | d << 16) & 0x07e0f81f;
d += (s - d) * alpha >> 5; d += (s - d) * alpha >> 5;
d &= 0x07e0f81f; d &= 0x07e0f81f;
*dstp++ = d | d >> 16; *dstp++ = (Uint16)(d | d >> 16);
}, width); }, width);
srcp += srcskip; srcp += srcskip;
dstp += dstskip; dstp += dstskip;
...@@ -1894,7 +1894,7 @@ static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) ...@@ -1894,7 +1894,7 @@ static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
d = (d | d << 16) & 0x03e07c1f; d = (d | d << 16) & 0x03e07c1f;
d += (s - d) * alpha >> 5; d += (s - d) * alpha >> 5;
d &= 0x03e07c1f; d &= 0x03e07c1f;
*dstp++ = d | d >> 16; *dstp++ = (Uint16)(d | d >> 16);
}, width); }, width);
srcp += srcskip; srcp += srcskip;
dstp += dstskip; dstp += dstskip;
...@@ -1922,8 +1922,7 @@ static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) ...@@ -1922,8 +1922,7 @@ static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
Benchmark this! */ Benchmark this! */
if(alpha) { if(alpha) {
if(alpha == (SDL_ALPHA_OPAQUE >> 3)) { if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
*dstp = (s >> 8 & 0xf800) + (s >> 5 & 0x7e0) *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3 & 0x1f));
+ (s >> 3 & 0x1f);
} else { } else {
Uint32 d = *dstp; Uint32 d = *dstp;
/* /*
...@@ -1935,7 +1934,7 @@ static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) ...@@ -1935,7 +1934,7 @@ static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
d = (d | d << 16) & 0x07e0f81f; d = (d | d << 16) & 0x07e0f81f;
d += (s - d) * alpha >> 5; d += (s - d) * alpha >> 5;
d &= 0x07e0f81f; d &= 0x07e0f81f;
*dstp = d | d >> 16; *dstp = (Uint16)(d | d >> 16);
} }
} }
srcp++; srcp++;
...@@ -1967,8 +1966,7 @@ static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) ...@@ -1967,8 +1966,7 @@ static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
Benchmark this! */ Benchmark this! */
if(alpha) { if(alpha) {
if(alpha == (SDL_ALPHA_OPAQUE >> 3)) { if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
*dstp = (s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3 & 0x1f));
+ (s >> 3 & 0x1f);
} else { } else {
Uint32 d = *dstp; Uint32 d = *dstp;
/* /*
...@@ -1980,7 +1978,7 @@ static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) ...@@ -1980,7 +1978,7 @@ static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
d = (d | d << 16) & 0x03e07c1f; d = (d | d << 16) & 0x03e07c1f;
d += (s - d) * alpha >> 5; d += (s - d) * alpha >> 5;
d &= 0x03e07c1f; d &= 0x03e07c1f;
*dstp = d | d >> 16; *dstp = (Uint16)(d | d >> 16);
} }
} }
srcp++; srcp++;
......
...@@ -858,9 +858,9 @@ static Uint32 GetBlitFeatures( void ) ...@@ -858,9 +858,9 @@ static Uint32 GetBlitFeatures( void )
/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ /* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
#define RGB888_RGB332(dst, src) { \ #define RGB888_RGB332(dst, src) { \
dst = (((src)&0x00E00000)>>16)| \ dst = (Uint8)((((src)&0x00E00000)>>16)| \
(((src)&0x0000E000)>>11)| \ (((src)&0x0000E000)>>11)| \
(((src)&0x000000C0)>>6); \ (((src)&0x000000C0)>>6)); \
} }
static void Blit_RGB888_index8(SDL_BlitInfo *info) static void Blit_RGB888_index8(SDL_BlitInfo *info)
{ {
...@@ -962,9 +962,9 @@ static void Blit_RGB888_index8(SDL_BlitInfo *info) ...@@ -962,9 +962,9 @@ static void Blit_RGB888_index8(SDL_BlitInfo *info)
} }
/* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */ /* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */
#define RGB888_RGB555(dst, src) { \ #define RGB888_RGB555(dst, src) { \
*(Uint16 *)(dst) = (((*src)&0x00F80000)>>9)| \ *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \
(((*src)&0x0000F800)>>6)| \ (((*src)&0x0000F800)>>6)| \
(((*src)&0x000000F8)>>3); \ (((*src)&0x000000F8)>>3)); \
} }
#define RGB888_RGB555_TWO(dst, src) { \ #define RGB888_RGB555_TWO(dst, src) { \
*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \ *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \
...@@ -1082,9 +1082,9 @@ static void Blit_RGB888_RGB555(SDL_BlitInfo *info) ...@@ -1082,9 +1082,9 @@ static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
} }
/* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */ /* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */
#define RGB888_RGB565(dst, src) { \ #define RGB888_RGB565(dst, src) { \
*(Uint16 *)(dst) = (((*src)&0x00F80000)>>8)| \ *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
(((*src)&0x0000FC00)>>5)| \ (((*src)&0x0000FC00)>>5)| \
(((*src)&0x000000F8)>>3); \ (((*src)&0x000000F8)>>3)); \
} }
#define RGB888_RGB565_TWO(dst, src) { \ #define RGB888_RGB565_TWO(dst, src) { \
*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \ *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \
...@@ -2101,7 +2101,7 @@ static void BlitNto1Key(SDL_BlitInfo *info) ...@@ -2101,7 +2101,7 @@ static void BlitNto1Key(SDL_BlitInfo *info)
Uint32 rgbmask = ~srcfmt->Amask; Uint32 rgbmask = ~srcfmt->Amask;
int srcbpp; int srcbpp;
Uint32 Pixel; Uint32 Pixel;
Uint8 sR, sG, sB; unsigned sR, sG, sB;
/* Set up some basic variables */ /* Set up some basic variables */
srcbpp = srcfmt->BytesPerPixel; srcbpp = srcfmt->BytesPerPixel;
...@@ -2115,9 +2115,9 @@ static void BlitNto1Key(SDL_BlitInfo *info) ...@@ -2115,9 +2115,9 @@ static void BlitNto1Key(SDL_BlitInfo *info)
sR, sG, sB); sR, sG, sB);
if ( (Pixel & rgbmask) != ckey ) { if ( (Pixel & rgbmask) != ckey ) {
/* Pack RGB into 8bit pixel */ /* Pack RGB into 8bit pixel */
*dst = ((sR>>5)<<(3+2))| *dst = (Uint8)(((sR>>5)<<(3+2))|
((sG>>5)<<(2)) | ((sG>>5)<<(2)) |
((sB>>6)<<(0)) ; ((sB>>6)<<(0)));
} }
dst++; dst++;
src += srcbpp; src += srcbpp;
...@@ -2134,9 +2134,9 @@ static void BlitNto1Key(SDL_BlitInfo *info) ...@@ -2134,9 +2134,9 @@ static void BlitNto1Key(SDL_BlitInfo *info)
sR, sG, sB); sR, sG, sB);
if ( (Pixel & rgbmask) != ckey ) { if ( (Pixel & rgbmask) != ckey ) {
/* Pack RGB into 8bit pixel */ /* Pack RGB into 8bit pixel */
*dst = palmap[((sR>>5)<<(3+2))| *dst = (Uint8)palmap[((sR>>5)<<(3+2))|
((sG>>5)<<(2)) | ((sG>>5)<<(2)) |
((sB>>6)<<(0)) ]; ((sB>>6)<<(0)) ];
} }
dst++; dst++;
src += srcbpp; src += srcbpp;
...@@ -2232,7 +2232,7 @@ static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info) ...@@ -2232,7 +2232,7 @@ static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
Uint8 srcbpp; Uint8 srcbpp;
Uint8 dstbpp; Uint8 dstbpp;
Uint32 Pixel; Uint32 Pixel;
Uint8 sR, sG, sB, sA; unsigned sR, sG, sB, sA;
/* Set up some basic variables */ /* Set up some basic variables */
srcbpp = srcfmt->BytesPerPixel; srcbpp = srcfmt->BytesPerPixel;
......
...@@ -331,7 +331,7 @@ void SDL_MoveCursor(int x, int y) ...@@ -331,7 +331,7 @@ void SDL_MoveCursor(int x, int y)
/* Keep track of the current cursor colors */ /* Keep track of the current cursor colors */
static int palette_changed = 1; static int palette_changed = 1;
static Uint32 pixels8[2]; static Uint8 pixels8[2];
void SDL_CursorPaletteChanged(void) void SDL_CursorPaletteChanged(void)
{ {
...@@ -377,8 +377,8 @@ static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) ...@@ -377,8 +377,8 @@ static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area)
int dstskip; int dstskip;
if ( palette_changed ) { if ( palette_changed ) {
pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255); pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0); pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
palette_changed = 0; palette_changed = 0;
} }
dst = (Uint8 *)screen->pixels + dst = (Uint8 *)screen->pixels +
...@@ -419,7 +419,7 @@ static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) ...@@ -419,7 +419,7 @@ static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area)
datab = *data++; datab = *data++;
for ( i=0; i<8; ++i ) { for ( i=0; i<8; ++i ) {
if ( maskb & 0x80 ) { if ( maskb & 0x80 ) {
*dst = pixels[datab>>7]; *dst = (Uint16)pixels[datab>>7];
} }
maskb <<= 1; maskb <<= 1;
datab <<= 1; datab <<= 1;
...@@ -509,8 +509,8 @@ static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area) ...@@ -509,8 +509,8 @@ static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area)
maxx = area->x+area->w; maxx = area->x+area->w;
if ( screen->format->BytesPerPixel == 1 ) { if ( screen->format->BytesPerPixel == 1 ) {
if ( palette_changed ) { if ( palette_changed ) {
pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255); pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0); pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
palette_changed = 0; palette_changed = 0;
} }
for ( h=area->h; h; h-- ) { for ( h=area->h; h; h-- ) {
......
...@@ -687,7 +687,7 @@ int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) ...@@ -687,7 +687,7 @@ int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
case 2: case 2:
for ( y=dstrect->h; y; --y ) { for ( y=dstrect->h; y; --y ) {
Uint16 *pixels = (Uint16 *)row; Uint16 *pixels = (Uint16 *)row;
Uint16 c = color; Uint16 c = (Uint16)color;
Uint32 cc = (Uint32)c << 16 | c; Uint32 cc = (Uint32)c << 16 | c;
int n = dstrect->w; int n = dstrect->w;
if((unsigned long)pixels & 3) { if((unsigned long)pixels & 3) {
......
...@@ -995,10 +995,10 @@ void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h) ...@@ -995,10 +995,10 @@ void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
return; return;
/* Fill the rectangle */ /* Fill the rectangle */
rect.x = x; rect.x = (Sint16)x;
rect.y = y; rect.y = (Sint16)y;
rect.w = w; rect.w = (Uint16)w;
rect.h = h; rect.h = (Uint16)h;
SDL_UpdateRects(screen, 1, &rect); SDL_UpdateRects(screen, 1, &rect);
} }
} }
......
...@@ -167,27 +167,27 @@ static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, ...@@ -167,27 +167,27 @@ static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
++cr; ++cb; ++cr; ++cb;
L = *lum++; L = *lum++;
*row1++ = (rgb_2_pix[ L + cr_r ] | *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
rgb_2_pix[ L + crb_g ] | rgb_2_pix[ L + crb_g ] |
rgb_2_pix[ L + cb_b ]); rgb_2_pix[ L + cb_b ]);
L = *lum++; L = *lum++;
*row1++ = (rgb_2_pix[ L + cr_r ] | *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
rgb_2_pix[ L + crb_g ] | rgb_2_pix[ L + crb_g ] |
rgb_2_pix[ L + cb_b ]); rgb_2_pix[ L + cb_b ]);
/* Now, do second row. */ /* Now, do second row. */
L = *lum2++; L = *lum2++;
*row2++ = (rgb_2_pix[ L + cr_r ] | *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
rgb_2_pix[ L + crb_g ] | rgb_2_pix[ L + crb_g ] |
rgb_2_pix[ L + cb_b ]); rgb_2_pix[ L + cb_b ]);
L = *lum2++; L = *lum2++;
*row2++ = (rgb_2_pix[ L + cr_r ] | *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
rgb_2_pix[ L + crb_g ] | rgb_2_pix[ L + crb_g ] |
rgb_2_pix[ L + cb_b ]); rgb_2_pix[ L + cb_b ]);
} }
/* /*
...@@ -638,14 +638,14 @@ static void Color16DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, ...@@ -638,14 +638,14 @@ static void Color16DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
cr += 4; cb += 4; cr += 4; cb += 4;
L = *lum; lum += 2; L = *lum; lum += 2;
*row++ = (rgb_2_pix[ L + cr_r ] | *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
rgb_2_pix[ L + crb_g ] | rgb_2_pix[ L + crb_g ] |
rgb_2_pix[ L + cb_b ]); rgb_2_pix[ L + cb_b ]);
L = *lum; lum += 2; L = *lum; lum += 2;
*row++ = (rgb_2_pix[ L + cr_r ] | *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
rgb_2_pix[ L + crb_g ] | rgb_2_pix[ L + crb_g ] |
rgb_2_pix[ L + cb_b ]); rgb_2_pix[ L + cb_b ]);
} }
......
...@@ -78,7 +78,7 @@ extern void DIB_SwapGamma(_THIS); ...@@ -78,7 +78,7 @@ extern void DIB_SwapGamma(_THIS);
static int codepage; static int codepage;
static int Is9xME(); static int Is9xME();
static int GetCodePage(); static int GetCodePage();
static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, BYTE *keystate, Uint16 *wchars, int wsize, UINT flags); static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, BYTE *keystate, LPWSTR wchars, int wsize, UINT flags);
ToUnicodeFN SDL_ToUnicode = ToUnicode9xME; ToUnicodeFN SDL_ToUnicode = ToUnicode9xME;
#endif /* !NO_GETKEYBOARDSTATE */ #endif /* !NO_GETKEYBOARDSTATE */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment