mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +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);
|
graphics->blueToPlayersAdv(bg, my->owner);
|
||||||
//SDL_UpdateRect(bg, 0, 0, 0, 0);
|
//SDL_UpdateRect(bg, 0, 0, 0, 0);
|
||||||
SDL_Rect temp_rect = genRect(bg->h, bg->w, pos.x, pos.y);
|
//SDL_Rect temp_rect = genRect(bg->h, bg->w, pos.x, pos.y);
|
||||||
CSDL_Ext::blit8bppAlphaTo24bpp(bg, NULL, to, &temp_rect);
|
//CSDL_Ext::blit8bppAlphaTo24bpp(bg, NULL, to, &temp_rect);
|
||||||
//blitAt(bg, pos, to);
|
blitAt(bg, pos, to);
|
||||||
blitAt(graphics->bigImgs[my->getCreature()->idNumber], pos.x +9, pos.y + 1, 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);
|
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)
|
if (!ret)
|
||||||
tlog1<<"Failed to open "<<fname<<" via SDL_Image\n";
|
tlog1<<"Failed to open "<<fname<<" via SDL_Image\n";
|
||||||
delete [] file;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ void Graphics::loadPaletteAndColors()
|
|||||||
col.r = pals[startPoint++];
|
col.r = pals[startPoint++];
|
||||||
col.g = pals[startPoint++];
|
col.g = pals[startPoint++];
|
||||||
col.b = pals[startPoint++];
|
col.b = pals[startPoint++];
|
||||||
col.unused = !pals[startPoint++];
|
col.unused = pals[startPoint++];
|
||||||
playerColorPalette[i] = col;
|
playerColorPalette[i] = col;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace Channels
|
|||||||
struct channel_empty
|
struct channel_empty
|
||||||
{
|
{
|
||||||
static STRONG_INLINE void set(Uint8*, Uint8) {}
|
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
|
// channel which uses whole pixel
|
||||||
|
Loading…
Reference in New Issue
Block a user