mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* next part of exchange window
* minor changes
This commit is contained in:
parent
cb1c31ac49
commit
7932a9e8ad
@ -225,6 +225,7 @@ void CHeroWindow::setHero(const CGHeroInstance *Hero)
|
||||
}
|
||||
curHero = hero;
|
||||
|
||||
//pos temporarily switched, restored later
|
||||
pos.x -= 65;
|
||||
pos.y -= 8;
|
||||
|
||||
@ -513,6 +514,7 @@ void CHeroWindow::redrawCurBack()
|
||||
SDL_FreeSurface(curBack);
|
||||
curBack = SDL_DisplayFormat(background);
|
||||
|
||||
//primary skills & morale and luck graphics
|
||||
blitAt(graphics->pskillsm->ourImages[0].bitmap, 32, 111, curBack);
|
||||
blitAt(graphics->pskillsm->ourImages[1].bitmap, 102, 111, curBack);
|
||||
blitAt(graphics->pskillsm->ourImages[2].bitmap, 172, 111, curBack);
|
||||
@ -520,10 +522,13 @@ void CHeroWindow::redrawCurBack()
|
||||
blitAt(graphics->pskillsm->ourImages[4].bitmap, 20, 230, curBack);
|
||||
blitAt(graphics->pskillsm->ourImages[3].bitmap, 162, 230, curBack);
|
||||
|
||||
//blitting portrait
|
||||
blitAt(graphics->portraitLarge[curHero->portrait], 19, 19, curBack);
|
||||
|
||||
//printing hero's name
|
||||
CSDL_Ext::printAtMiddle(curHero->name, 190, 40, GEORXX, tytulowy, curBack);
|
||||
|
||||
//printing hero's level
|
||||
std::stringstream secondLine;
|
||||
secondLine<<"Level "<<curHero->level<<" "<<curHero->type->heroClass->name;
|
||||
CSDL_Ext::printAtMiddle(secondLine.str(), 190, 66, TNRB16, zwykly, curBack);
|
||||
|
@ -3240,8 +3240,31 @@ CExchangeWindow::CExchangeWindow(si32 hero1, si32 hero2) //c-tor
|
||||
hero1inst = LOCPLINT->cb->getHeroInfo(hero1, 2);
|
||||
hero2inst = LOCPLINT->cb->getHeroInfo(hero2, 2);
|
||||
|
||||
bg = BitmapHandler::loadBitmap("TRADE2.BMP");
|
||||
graphics->blueToPlayersAdv(bg, hero1inst->tempOwner);
|
||||
SDL_Surface * bgtemp; //loaded as 8bpp surface
|
||||
bgtemp = BitmapHandler::loadBitmap("TRADE2.BMP");
|
||||
graphics->blueToPlayersAdv(bgtemp, hero1inst->tempOwner);
|
||||
bg = SDL_ConvertSurface(bgtemp, screen->format, screen->flags); //to 24 bpp
|
||||
SDL_FreeSurface(bgtemp);
|
||||
|
||||
//printing heroes' names and levels
|
||||
std::ostringstream os, os2;
|
||||
os<<hero1inst->name<<", Level "<<hero1inst->level<<" "<<hero1inst->type->heroClass->name;
|
||||
CSDL_Ext::printAtMiddle(os.str(), 147, 23, GEOR13, zwykly, bg);
|
||||
os2<<hero2inst->name<<", Level "<<hero2inst->level<<" "<<hero2inst->type->heroClass->name;
|
||||
CSDL_Ext::printAtMiddle(os2.str(), 653, 23, GEOR13, zwykly, bg);
|
||||
|
||||
//printing primary skills' graphics
|
||||
CDefHandler * skilldef = CDefHandler::giveDef("PSKIL32.DEF");
|
||||
for(int g=0; g<4; ++g)
|
||||
{
|
||||
blitAt(skilldef->ourImages[g].bitmap, genRect(32, 32, 385, 19 + 36 * g), bg);
|
||||
}
|
||||
|
||||
//printing portraits
|
||||
blitAt(graphics->portraitLarge[hero1inst->portrait], 257, 13, bg);
|
||||
blitAt(graphics->portraitLarge[hero2inst->portrait], 485, 13, bg);
|
||||
|
||||
//buttons
|
||||
quit = new AdventureMapButton(CGI->generaltexth->tcommands[8], "", boost::bind(&CExchangeWindow::close, this), pos.x+732, pos.y+567, "IOKAY.DEF", SDLK_RETURN);
|
||||
}
|
||||
|
||||
|
@ -50,11 +50,11 @@ void blitAt(SDL_Surface * src, int x, int y, SDL_Surface * dst)
|
||||
SDL_Rect pom = genRect(src->h,src->w,x,y);
|
||||
SDL_BlitSurface(src,NULL,dst,&pom);
|
||||
}
|
||||
void blitAtWR(SDL_Surface * src, SDL_Rect pos, SDL_Surface * dst)
|
||||
void blitAtWR(SDL_Surface * src, const SDL_Rect & pos, SDL_Surface * dst)
|
||||
{
|
||||
blitAtWR(src,pos.x,pos.y,dst);
|
||||
}
|
||||
void blitAt(SDL_Surface * src, SDL_Rect pos, SDL_Surface * dst)
|
||||
void blitAt(SDL_Surface * src, const SDL_Rect & pos, SDL_Surface * dst)
|
||||
{
|
||||
blitAt(src,pos.x,pos.y,dst);
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ extern SDL_Color tytulowy, tlo, zwykly ;
|
||||
extern TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM;
|
||||
void blitAtWR(SDL_Surface * src, int x, int y, SDL_Surface * dst=screen);
|
||||
void blitAt(SDL_Surface * src, int x, int y, SDL_Surface * dst=screen);
|
||||
void blitAtWR(SDL_Surface * src, SDL_Rect pos, SDL_Surface * dst=screen);
|
||||
void blitAt(SDL_Surface * src, SDL_Rect pos, SDL_Surface * dst=screen);
|
||||
void blitAtWR(SDL_Surface * src, const SDL_Rect & pos, SDL_Surface * dst=screen);
|
||||
void blitAt(SDL_Surface * src, const SDL_Rect & pos, SDL_Surface * dst=screen);
|
||||
void updateRect (SDL_Rect * rect, SDL_Surface * scr = screen);
|
||||
bool isItIn(const SDL_Rect * rect, int x, int y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user