mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- fixed #982:
-- replaced 8to24 bilt with sdl blit -- fixed alpha values for images loaded via SDL
This commit is contained in:
parent
7ddf76a081
commit
c512069177
@ -700,9 +700,9 @@ void CStackQueue::StackBox::showAll(SDL_Surface * to)
|
||||
{
|
||||
graphics->blueToPlayersAdv(bg, my->owner);
|
||||
//SDL_UpdateRect(bg, 0, 0, 0, 0);
|
||||
SDL_Rect temp_rect = genRect(bg->h, bg->w, pos.x, pos.y);
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(bg, NULL, to, &temp_rect);
|
||||
//blitAt(bg, pos, to);
|
||||
//SDL_Rect temp_rect = genRect(bg->h, bg->w, pos.x, pos.y);
|
||||
//CSDL_Ext::blit8bppAlphaTo24bpp(bg, NULL, to, &temp_rect);
|
||||
blitAt(bg, pos, to);
|
||||
blitAt(graphics->bigImgs[my->getCreature()->idNumber], pos.x +9, pos.y + 1, to);
|
||||
printAtMiddleLoc(makeNumberShort(my->count), pos.w/2, pos.h - 12, FONT_MEDIUM, Colors::Cornsilk, to);
|
||||
}
|
||||
|
@ -170,6 +170,12 @@ SDL_Surface * BitmapHandler::loadBitmapFromLod(CLodHandler *lod, std::string fna
|
||||
if (!ret)
|
||||
tlog1<<"Failed to open "<<fname<<" via SDL_Image\n";
|
||||
delete [] file;
|
||||
if (ret->format->palette)
|
||||
{
|
||||
//set correct value for alpha\unused channel
|
||||
for (int i=0; i< ret->format->palette->ncolors; i++)
|
||||
ret->format->palette->colors[i].unused = 255;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ void Graphics::loadPaletteAndColors()
|
||||
col.r = pals[startPoint++];
|
||||
col.g = pals[startPoint++];
|
||||
col.b = pals[startPoint++];
|
||||
col.unused = !pals[startPoint++];
|
||||
col.unused = pals[startPoint++];
|
||||
playerColorPalette[i] = col;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace Channels
|
||||
struct channel_empty
|
||||
{
|
||||
static STRONG_INLINE void set(Uint8*, Uint8) {}
|
||||
static STRONG_INLINE Uint8 get(const Uint8 *) { return 0;}
|
||||
static STRONG_INLINE Uint8 get(const Uint8 *) { return 255;}
|
||||
};
|
||||
|
||||
// channel which uses whole pixel
|
||||
|
Loading…
Reference in New Issue
Block a user