1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Refactoring towards backward compatibility (WiP)

This commit is contained in:
AlexVinS
2014-05-23 14:51:38 +04:00
committed by AlexVinS
parent 1597254399
commit 0ef16feca9
15 changed files with 136 additions and 170 deletions

View File

@ -294,12 +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);
#if 0
SDL_SetColorKey(bg,SDL_SRCCOLORKEY,SDL_MapRGB(bg->format,0,255,255));
#else
SDL_SetColorKey(bg,SDL_TRUE,SDL_MapRGB(bg->format,0,255,255));
#endif
graphics->blueToPlayersAdv(bg,LOCPLINT->playerID);
pos = genRect(bg->h, bg->w, pos.x+x, pos.y+y);
@ -318,11 +313,7 @@ CResDataBar::CResDataBar(const std::string &defname, int x, int y, int offx, int
CResDataBar::CResDataBar()
{
bg = BitmapHandler::loadBitmap(ADVOPT.resdatabarG);
#if 0
SDL_SetColorKey(bg,SDL_SRCCOLORKEY,SDL_MapRGB(bg->format,0,255,255));
#else
SDL_SetColorKey(bg,SDL_TRUE,SDL_MapRGB(bg->format,0,255,255));
#endif
graphics->blueToPlayersAdv(bg,LOCPLINT->playerID);
pos = genRect(bg->h,bg->w,ADVOPT.resdatabarX,ADVOPT.resdatabarY);
@ -930,7 +921,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
if(CGuiHandler::isArrowKey(SDLKey(k)))
k = CGuiHandler::arrowToNum(SDLKey(k));
#if 0
#ifdef VCMI_SDL1
k -= SDLK_KP0 + 1;
#else
k -= SDL_SCANCODE_KP_0 + 1;