mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
* small changes
This commit is contained in:
parent
9ec606a40b
commit
b75161788e
@ -303,20 +303,12 @@ void CBattleInterface::show(SDL_Surface * to)
|
||||
//printing amount
|
||||
if(stacks[stackDeadByHex[b][v]].amount > 0) //don't print if stack is not alive
|
||||
{
|
||||
if(stacks[stackDeadByHex[b][v]].attackerOwned)
|
||||
{
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(amountNormal, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[stackDeadByHex[b][v]]->pos.x + 220, creAnims[stackDeadByHex[b][v]]->pos.y + 260));
|
||||
std::stringstream ss;
|
||||
ss<<stacks[stackDeadByHex[b][v]].amount;
|
||||
CSDL_Ext::printAtMiddleWB(ss.str(), creAnims[stackDeadByHex[b][v]]->pos.x + 220 + 14, creAnims[stackDeadByHex[b][v]]->pos.y + 260 + 4, GEOR13, 20, zwykly, to);
|
||||
}
|
||||
else
|
||||
{
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(amountNormal, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[stackDeadByHex[b][v]]->pos.x + 202, creAnims[stackDeadByHex[b][v]]->pos.y + 260));
|
||||
std::stringstream ss;
|
||||
ss<<stacks[stackDeadByHex[b][v]].amount;
|
||||
CSDL_Ext::printAtMiddleWB(ss.str(), creAnims[stackDeadByHex[b][v]]->pos.x + 202 + 14, creAnims[stackDeadByHex[b][v]]->pos.y + 260 + 4, GEOR13, 20, zwykly, to);
|
||||
}
|
||||
int xAdd = stacks[stackDeadByHex[b][v]].attackerOwned ? 220 : 202;
|
||||
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(amountNormal, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[stackDeadByHex[b][v]]->pos.x + xAdd, creAnims[stackDeadByHex[b][v]]->pos.y + 260));
|
||||
std::stringstream ss;
|
||||
ss<<stacks[stackDeadByHex[b][v]].amount;
|
||||
CSDL_Ext::printAtMiddleWB(ss.str(), creAnims[stackDeadByHex[b][v]]->pos.x + xAdd + 14, creAnims[stackDeadByHex[b][v]]->pos.y + 260 + 4, GEOR13, 20, zwykly, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -328,20 +320,12 @@ void CBattleInterface::show(SDL_Surface * to)
|
||||
//printing amount
|
||||
if(stacks[stackAliveByHex[b][v]].amount > 0) //don't print if stack is not alive
|
||||
{
|
||||
if(stacks[stackAliveByHex[b][v]].attackerOwned)
|
||||
{
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(amountNormal, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[stackAliveByHex[b][v]]->pos.x + 220, creAnims[stackAliveByHex[b][v]]->pos.y + 260));
|
||||
std::stringstream ss;
|
||||
ss<<stacks[stackAliveByHex[b][v]].amount;
|
||||
CSDL_Ext::printAtMiddleWB(ss.str(), creAnims[stackAliveByHex[b][v]]->pos.x + 220 + 14, creAnims[stackAliveByHex[b][v]]->pos.y + 260 + 4, GEOR13, 20, zwykly, to);
|
||||
}
|
||||
else
|
||||
{
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(amountNormal, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[stackAliveByHex[b][v]]->pos.x + 202, creAnims[stackAliveByHex[b][v]]->pos.y + 260));
|
||||
std::stringstream ss;
|
||||
ss<<stacks[stackAliveByHex[b][v]].amount;
|
||||
CSDL_Ext::printAtMiddleWB(ss.str(), creAnims[stackAliveByHex[b][v]]->pos.x + 202 + 14, creAnims[stackAliveByHex[b][v]]->pos.y + 260 + 4, GEOR13, 20, zwykly, to);
|
||||
}
|
||||
int xAdd = stacks[stackAliveByHex[b][v]].attackerOwned ? 220 : 202;
|
||||
|
||||
CSDL_Ext::blit8bppAlphaTo24bpp(amountNormal, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[stackAliveByHex[b][v]]->pos.x + xAdd, creAnims[stackAliveByHex[b][v]]->pos.y + 260));
|
||||
std::stringstream ss;
|
||||
ss<<stacks[stackAliveByHex[b][v]].amount;
|
||||
CSDL_Ext::printAtMiddleWB(ss.str(), creAnims[stackAliveByHex[b][v]]->pos.x + xAdd + 14, creAnims[stackAliveByHex[b][v]]->pos.y + 260 + 4, GEOR13, 20, zwykly, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -398,6 +382,7 @@ void CBattleInterface::bSurrenderf()
|
||||
void CBattleInterface::bFleef()
|
||||
{
|
||||
giveCommand(4,0,0);
|
||||
CGI->curh->changeGraphic(0, 0);
|
||||
}
|
||||
|
||||
void CBattleInterface::bAutofightf()
|
||||
|
@ -595,6 +595,9 @@ int CSDL_Ext::blit8bppAlphaTo24bpp(SDL_Surface * src, SDL_Rect * srcRect, SDL_Su
|
||||
sr.w = dstRect->w = w;
|
||||
sr.h = dstRect->h = h;
|
||||
|
||||
if(SDL_LockSurface(dst))
|
||||
return -1; //if we cannot lock the surface
|
||||
|
||||
if(dst->format->Rshift==0) //like in most surfaces
|
||||
{
|
||||
for(int y=0; y<sr.h; ++y)
|
||||
@ -679,6 +682,7 @@ int CSDL_Ext::blit8bppAlphaTo24bpp(SDL_Surface * src, SDL_Rect * srcRect, SDL_Su
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_UnlockSurface(dst);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -5,7 +5,7 @@
|
||||
9 SMBALX.DEF 1
|
||||
18 PELFX.DEF 0
|
||||
19 PELFX.DEF 0
|
||||
29 CPGRE.DEF 1
|
||||
29 CPRGRE.DEF 1
|
||||
34 PMAGX.DEF 1
|
||||
35 PMAGX.DEF 1
|
||||
41 SMBALX.DEF 0
|
||||
|
Loading…
Reference in New Issue
Block a user