1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

centralize key color management

This commit is contained in:
AlexVinS
2014-07-02 22:20:54 +04:00
parent 082c9a506e
commit 638dac90af
6 changed files with 48 additions and 22 deletions

View File

@ -294,7 +294,7 @@ void CResDataBar::clickRight(tribool down, bool previousState)
CResDataBar::CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist)
{
bg = BitmapHandler::loadBitmap(defname);
SDL_SetColorKey(bg,SDL_SRCCOLORKEY,SDL_MapRGB(bg->format,0,255,255));
CSDL_Ext::setDefaultColorKey(bg);
graphics->blueToPlayersAdv(bg,LOCPLINT->playerID);
pos = genRect(bg->h, bg->w, pos.x+x, pos.y+y);
@ -313,7 +313,7 @@ CResDataBar::CResDataBar(const std::string &defname, int x, int y, int offx, int
CResDataBar::CResDataBar()
{
bg = BitmapHandler::loadBitmap(ADVOPT.resdatabarG);
SDL_SetColorKey(bg,SDL_SRCCOLORKEY,SDL_MapRGB(bg->format,0,255,255));
CSDL_Ext::setDefaultColorKey(bg);
graphics->blueToPlayersAdv(bg,LOCPLINT->playerID);
pos = genRect(bg->h,bg->w,ADVOPT.resdatabarX,ADVOPT.resdatabarY);