added missing cast in PL_CreateIconMask() to fix compilation using g++

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@680 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-05-30 10:55:35 +00:00
parent fd2bafc1b1
commit 7985762713

View file

@ -36,7 +36,7 @@ static Uint8 *PL_CreateIconMask(SDL_Surface *icon)
Uint8 *mask; Uint8 *mask;
/* Note that this sets all pixels to invisible in the mask. */ /* Note that this sets all pixels to invisible in the mask. */
mask = calloc(((icon->w + 7) / 8) * icon->h, sizeof(Uint8)); mask = (Uint8 *) calloc(((icon->w + 7) / 8) * icon->h, sizeof(Uint8));
if (!mask) if (!mask)
return NULL; return NULL;
@ -46,12 +46,14 @@ static Uint8 *PL_CreateIconMask(SDL_Surface *icon)
/* The top-left pixel and identical pixels will remain invisible. */ /* The top-left pixel and identical pixels will remain invisible. */
topleft_pixel = (Uint8 *)icon->pixels; topleft_pixel = (Uint8 *)icon->pixels;
for (x = 0; x < icon->w; x++) for (x = 0; x < icon->w; x++)
{
for (y = 0; y < icon->h; y++) for (y = 0; y < icon->h; y++)
{ {
current_pixel = (Uint8 *)icon->pixels + current_pixel = (Uint8 *)icon->pixels +
y * icon->pitch + y * icon->pitch +
x * icon->format->BytesPerPixel; x * icon->format->BytesPerPixel;
for (i = 0; i < icon->format->BytesPerPixel; i++) for (i = 0; i < icon->format->BytesPerPixel; i++)
{
/* If the current pixel is not identical to /* If the current pixel is not identical to
* the top-left pixel, set it to visible in * the top-left pixel, set it to visible in
* the mask. */ * the mask. */
@ -60,7 +62,9 @@ static Uint8 *PL_CreateIconMask(SDL_Surface *icon)
mask[y * ((icon->w + 7) / 8) + x / 8] |= 128 >> x % 8; mask[y * ((icon->w + 7) / 8) + x / 8] |= 128 >> x % 8;
break; break;
} }
}
} }
}
if (SDL_MUSTLOCK(icon)) if (SDL_MUSTLOCK(icon))
SDL_UnlockSurface(icon); SDL_UnlockSurface(icon);
@ -93,7 +97,5 @@ void PL_VID_Shutdown (void)
void PL_ErrorDialog (const char *errorMsg) void PL_ErrorDialog (const char *errorMsg)
{ {
// TODO: we can dlopen gtk for an error
// dialog window. would it be worth it?
} }