mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
fix compilation
* may not even run * text input disabled
This commit is contained in:
@ -70,7 +70,11 @@ SDL_Surface * BitmapHandler::loadH3PCX(ui8 * pcx, size_t size)
|
||||
tp.r = pcx[it++];
|
||||
tp.g = pcx[it++];
|
||||
tp.b = pcx[it++];
|
||||
#if 0
|
||||
tp.unused = SDL_ALPHA_OPAQUE;
|
||||
#else
|
||||
tp.a = SDL_ALPHA_OPAQUE;
|
||||
#endif // 0
|
||||
ret->format->palette->colors[i] = tp;
|
||||
}
|
||||
}
|
||||
@ -122,7 +126,11 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
|
||||
if(ret->format->BytesPerPixel == 1 && setKey)
|
||||
{
|
||||
const SDL_Color &c = ret->format->palette->colors[0];
|
||||
#if 0
|
||||
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,SDL_MapRGB(ret->format, c.r, c.g, c.b));
|
||||
#else
|
||||
SDL_SetColorKey(ret,SDL_TRUE,SDL_MapRGB(ret->format, c.r, c.g, c.b));
|
||||
#endif // 0
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -143,7 +151,11 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
|
||||
{
|
||||
//set correct value for alpha\unused channel
|
||||
for (int i=0; i< ret->format->palette->ncolors; i++)
|
||||
#if 0
|
||||
ret->format->palette->colors[i].unused = 255;
|
||||
#else
|
||||
ret->format->palette->colors[i].a = 255;
|
||||
#endif // 0
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -166,11 +178,19 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
|
||||
|
||||
// set color key only if exactly such color was found
|
||||
if (color.r == 0 && color.g == 255 && color.b == 255)
|
||||
#if 0
|
||||
SDL_SetColorKey(ret, SDL_SRCCOLORKEY, colorID);
|
||||
#else
|
||||
SDL_SetColorKey(ret, SDL_TRUE, colorID);
|
||||
#endif // 0
|
||||
}
|
||||
else // always set
|
||||
{
|
||||
#if 0
|
||||
SDL_SetColorKey(ret, SDL_SRCCOLORKEY, colorID);
|
||||
#else
|
||||
SDL_SetColorKey(ret, SDL_TRUE, colorID);
|
||||
#endif // 0
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user