1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00
Michał W. Urbańczyk 2009-09-20 19:17:28 +00:00
parent a424032ec3
commit 22a74ea781
2 changed files with 15 additions and 8 deletions

View File

@ -630,6 +630,7 @@ void CBattleStackMoved::endAnim()
else if(!endMoving && twoTiles && (! bool(movedStack->attackerOwned) ) && (owner->creDir[stackID] != bool(movedStack->attackerOwned) )) //big defender creature is reversed else if(!endMoving && twoTiles && (! bool(movedStack->attackerOwned) ) && (owner->creDir[stackID] != bool(movedStack->attackerOwned) )) //big defender creature is reversed
owner->creAnims[stackID]->pos.x += 44; owner->creAnims[stackID]->pos.x += 44;
owner->creAnims[stackID]->pos.y = coords.second; owner->creAnims[stackID]->pos.y = coords.second;
owner->creAnims[stackID]->pos += LOCPLINT->battleInt->pos;
} }
if(owner->moveSh >= 0) if(owner->moveSh >= 0)
@ -1059,7 +1060,7 @@ CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, C
//preparing menu background and terrain //preparing menu background and terrain
if(siegeH) if(siegeH)
{ {
background = BitmapHandler::loadBitmap( siegeH->getSiegeName(0) ); background = BitmapHandler::loadBitmap( siegeH->getSiegeName(0), false );
ui8 siegeLevel = LOCPLINT->cb->battleGetSiegeLevel(); ui8 siegeLevel = LOCPLINT->cb->battleGetSiegeLevel();
if(siegeLevel >= 2) //citadel or castle if(siegeLevel >= 2) //citadel or castle
{ {
@ -1082,7 +1083,7 @@ CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, C
else else
{ {
std::vector< std::string > & backref = graphics->battleBacks[ LOCPLINT->cb->battleGetBattlefieldType() ]; std::vector< std::string > & backref = graphics->battleBacks[ LOCPLINT->cb->battleGetBattlefieldType() ];
background = BitmapHandler::loadBitmap(backref[ rand() % backref.size()] ); background = BitmapHandler::loadBitmap(backref[ rand() % backref.size()], false );
} }
//preparing menu background //preparing menu background
@ -1235,6 +1236,11 @@ CBattleInterface::CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, C
SDL_SetColorKey(idToObstacle[obst[t].ID]->ourImages[n].bitmap, SDL_SRCCOLORKEY, SDL_MapRGB(idToObstacle[obst[t].ID]->ourImages[n].bitmap->format,0,255,255)); SDL_SetColorKey(idToObstacle[obst[t].ID]->ourImages[n].bitmap, SDL_SRCCOLORKEY, SDL_MapRGB(idToObstacle[obst[t].ID]->ourImages[n].bitmap->format,0,255,255));
} }
} }
for (int i = 0; i < ARRAY_COUNT(bfield); i++)
{
children.push_back(&bfield[i]);
}
} }
CBattleInterface::~CBattleInterface() CBattleInterface::~CBattleInterface()
@ -2056,7 +2062,7 @@ void CBattleInterface::newStack(int stackID)
creAnims[stackID] = new CCreatureAnimation(newStack->creature->animDefName); creAnims[stackID] = new CCreatureAnimation(newStack->creature->animDefName);
} }
creAnims[stackID]->setType(2); creAnims[stackID]->setType(2);
creAnims[stackID]->pos = genRect(creAnims[newStack->ID]->fullHeight, creAnims[newStack->ID]->fullWidth, coords.first, coords.second); creAnims[stackID]->pos = Rect(coords.first, coords.second, creAnims[newStack->ID]->fullWidth, creAnims[newStack->ID]->fullHeight) + pos;
creDir[stackID] = newStack->attackerOwned; creDir[stackID] = newStack->attackerOwned;
} }
@ -2682,7 +2688,7 @@ void CBattleInterface::showAliveStack(int ID, const std::map<int, CStack> & stac
} }
} }
creAnims[ID]->nextFrame(to, creAnims[ID]->pos.x + pos.x, creAnims[ID]->pos.y + pos.y, creDir[ID], animCount, incrementFrame, ID==activeStack, ID==mouseHoveredStack); //increment always when moving, never if stack died creAnims[ID]->nextFrame(to, creAnims[ID]->pos.x, creAnims[ID]->pos.y, creDir[ID], animCount, incrementFrame, ID==activeStack, ID==mouseHoveredStack); //increment always when moving, never if stack died
//printing amount //printing amount
if(curStack.amount > 0 //don't print if stack is not alive if(curStack.amount > 0 //don't print if stack is not alive
@ -2723,12 +2729,12 @@ void CBattleInterface::showAliveStack(int ID, const std::map<int, CStack> & stac
amountBG = amountEffNeutral; amountBG = amountEffNeutral;
} }
} }
SDL_BlitSurface(amountBG, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[ID]->pos.x + xAdd + pos.x, creAnims[ID]->pos.y + 260 + pos.y)); SDL_BlitSurface(amountBG, NULL, to, &genRect(amountNormal->h, amountNormal->w, creAnims[ID]->pos.x + xAdd, creAnims[ID]->pos.y + 260));
//blitting amount //blitting amount
CSDL_Ext::printAtMiddle( CSDL_Ext::printAtMiddle(
makeNumberShort(curStack.amount), makeNumberShort(curStack.amount),
creAnims[ID]->pos.x + xAdd + 15 + pos.x, creAnims[ID]->pos.x + xAdd + 15,
creAnims[ID]->pos.y + 260 + 5 + pos.y, creAnims[ID]->pos.y + 260 + 5,
FONT_TINY, FONT_TINY,
zwykly, zwykly,
to to
@ -3813,7 +3819,7 @@ void CStackQueue::StackBox::showAll( SDL_Surface *to )
if(bg) if(bg)
{ {
graphics->blueToPlayersAdv(bg, my->owner); graphics->blueToPlayersAdv(bg, my->owner);
//SDL_UpdateRect(bg, 0, 0, 0, 0); SDL_UpdateRect(bg, 0, 0, 0, 0);
blitAt(bg, pos, to); blitAt(bg, pos, to);
blitAt(graphics->bigImgs[my->creature->idNumber], pos.x +9, pos.y + 1, to); blitAt(graphics->bigImgs[my->creature->idNumber], pos.x +9, pos.y + 1, to);
printAtMiddleLoc(makeNumberShort(my->amount), pos.w/2, pos.h - 12, FONT_MEDIUM, zwykly, to); printAtMiddleLoc(makeNumberShort(my->amount), pos.w/2, pos.h - 12, FONT_MEDIUM, zwykly, to);

View File

@ -142,6 +142,7 @@ void RemoveObject::applyFirstCl( CClient *cl )
void RemoveObject::applyCl( CClient *cl ) void RemoveObject::applyCl( CClient *cl )
{ {
GS(cl)->calculatePaths(cl->pathInfo->hero, *cl->pathInfo);
} }
void TryMoveHero::applyFirstCl( CClient *cl ) void TryMoveHero::applyFirstCl( CClient *cl )