|
@@ -21,7 +21,7 @@
|
|
|
#include "timeHandler.h"
|
|
|
#include <boost/algorithm/string.hpp>
|
|
|
#include <boost/algorithm/string/replace.hpp>
|
|
|
-#include "hch\CPreGameTextHandler.h"
|
|
|
+#include "hch/CPreGameTextHandler.h"
|
|
|
#include "CBattleInterface.h"
|
|
|
#include "CLua.h"
|
|
|
#include <cmath>
|
|
@@ -227,7 +227,7 @@ void CGarrisonSlot::show()
|
|
|
if(creature)
|
|
|
{
|
|
|
char* buf = new char[15];
|
|
|
- itoa(count,buf,10);
|
|
|
+ SDL_itoa(count,buf,10);
|
|
|
blitAt(CGI->creh->bigImgs[creature->idNumber],pos);
|
|
|
printTo(buf,pos.x+56,pos.y+62,GEOR16,zwykly);
|
|
|
if(owner->highlighted==this)
|
|
@@ -332,7 +332,7 @@ void CGarrisonInt::createSlots()
|
|
|
(std::map<int,std::pair<CCreature*,int> >::const_iterator i=set1->slots.begin();
|
|
|
i!=set1->slots.end(); i++)
|
|
|
{
|
|
|
- (*sup)[i->first] =
|
|
|
+ (*sup)[i->first] =
|
|
|
new CGarrisonSlot(this, pos.x + (i->first*(58+interx)), pos.y,i->first, 0, i->second.first,i->second.second);
|
|
|
}
|
|
|
for(int i=0; i<sup->size(); i++)
|
|
@@ -340,13 +340,13 @@ void CGarrisonInt::createSlots()
|
|
|
(*sup)[i] = new CGarrisonSlot(this, pos.x + (i*(58+interx)), pos.y,i,0,NULL, 0);
|
|
|
}
|
|
|
if(set2)
|
|
|
- {
|
|
|
+ {
|
|
|
sdown = new std::vector<CGarrisonSlot*>(7,(CGarrisonSlot *)(NULL));
|
|
|
for
|
|
|
(std::map<int,std::pair<CCreature*,int> >::const_iterator i=set2->slots.begin();
|
|
|
i!=set2->slots.end(); i++)
|
|
|
{
|
|
|
- (*sdown)[i->first] =
|
|
|
+ (*sdown)[i->first] =
|
|
|
new CGarrisonSlot(this, pos.x + (i->first*(58+interx)), pos.y + 64 + intery,i->first,1, i->second.first,i->second.second);
|
|
|
}
|
|
|
for(int i=0; i<sup->size(); i++)
|
|
@@ -591,7 +591,7 @@ CSelectableComponent::CSelectableComponent(Etype Type, int Sub, int Val, CSelWin
|
|
|
{
|
|
|
SDL_Surface * symb = SComponent::getImg();
|
|
|
myBitmap = CSDL_Ext::newSurface(symb->w+2,symb->h+2,screen);
|
|
|
- SDL_SetColorKey(myBitmap,SDL_SRCCOLORKEY,SDL_MapRGB(myBitmap->format,0,255,255));
|
|
|
+ SDL_SetColorKey(myBitmap,SDL_SRCCOLORKEY,SDL_MapRGB(myBitmap->format,0,255,255));
|
|
|
blitAt(symb,1,1,myBitmap);
|
|
|
if (Border) //use custom border
|
|
|
{
|
|
@@ -613,7 +613,7 @@ CSelectableComponent::CSelectableComponent(Etype Type, int Sub, int Val, CSelWin
|
|
|
SDL_PutPixel(border,0,i,239,215,123);
|
|
|
SDL_PutPixel(border,(border->w)-1,i,239,215,123);
|
|
|
}
|
|
|
- SDL_SetColorKey(border,SDL_SRCCOLORKEY,SDL_MapRGB(border->format,0,255,255));
|
|
|
+ SDL_SetColorKey(border,SDL_SRCCOLORKEY,SDL_MapRGB(border->format,0,255,255));
|
|
|
}
|
|
|
selected = false;
|
|
|
}
|
|
@@ -650,7 +650,7 @@ void CSelectableComponent::select(bool on)
|
|
|
selected = on;
|
|
|
return;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -705,7 +705,7 @@ void CSelWindow::close()
|
|
|
ret = i;
|
|
|
}
|
|
|
components[i]->deactivate();
|
|
|
- }
|
|
|
+ }
|
|
|
components.clear();
|
|
|
okb.deactivate();
|
|
|
SDL_FreeSurface(bitmap);
|
|
@@ -736,7 +736,7 @@ template <typename T> void CSCButton<T>::clickLeft (tribool down)
|
|
|
{
|
|
|
state=1;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
state=0;
|
|
|
}
|
|
@@ -745,16 +745,16 @@ template <typename T> void CSCButton<T>::clickLeft (tribool down)
|
|
|
if (delg)
|
|
|
(delg->*func)(down);
|
|
|
}
|
|
|
-template <typename T> void CSCButton<typename T>::activate()
|
|
|
+template <typename T> void CSCButton<T>::activate()
|
|
|
{
|
|
|
ClickableL::activate();
|
|
|
}
|
|
|
-template <typename T> void CSCButton<typename T>::deactivate()
|
|
|
+template <typename T> void CSCButton<T>::deactivate()
|
|
|
{
|
|
|
ClickableL::deactivate();
|
|
|
}
|
|
|
|
|
|
-template <typename T> void CSCButton<typename T>::show(SDL_Surface * to)
|
|
|
+template <typename T> void CSCButton<T>::show(SDL_Surface * to)
|
|
|
{
|
|
|
if (delg) //we blit on our owner's bitmap
|
|
|
{
|
|
@@ -792,7 +792,7 @@ void CButtonBase::show(SDL_Surface * to)
|
|
|
if (abs)
|
|
|
{
|
|
|
blitAt(imgs[curimg]
|
|
|
- [( (state+bitmapOffset) < (imgs[curimg].size()) ) ?
|
|
|
+ [( (state+bitmapOffset) < (imgs[curimg].size()) ) ?
|
|
|
(state+bitmapOffset) :
|
|
|
(imgs[curimg].size()-1) ]
|
|
|
,pos.x,pos.y,to);
|
|
@@ -801,11 +801,11 @@ void CButtonBase::show(SDL_Surface * to)
|
|
|
else
|
|
|
{
|
|
|
blitAt(imgs[curimg]
|
|
|
- [( (state+bitmapOffset) < (imgs[curimg].size()) ) ?
|
|
|
+ [( (state+bitmapOffset) < (imgs[curimg].size()) ) ?
|
|
|
(state+bitmapOffset) :
|
|
|
(imgs[curimg].size()-1) ],pos.x+ourObj->pos.x,pos.y+ourObj->pos.y,to);
|
|
|
//updateRect(&genRect(pos.h,pos.w,pos.x+ourObj->pos.x,pos.y+ourObj->pos.y),to);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
ClickableL::ClickableL()
|
|
@@ -981,7 +981,7 @@ void CPlayerInterface::yourTurn()
|
|
|
// CGI->mh->reader->defs[wnumber]->ourImages[g].bitmap->format->palette->colors[160 + i] = tab[i];
|
|
|
// }
|
|
|
// //SDL_SaveBMP(CGI->mh->reader->defs[wnumber]->ourImages[g].bitmap,"t2.bmp");
|
|
|
- // CSDL_Ext::update(CGI->mh->reader->defs[wnumber]->ourImages[g].bitmap);
|
|
|
+ // CSDL_Ext::update(CGI->mh->reader->defs[wnumber]->ourImages[g].bitmap);
|
|
|
// }
|
|
|
//}
|
|
|
//water tiles updated
|
|
@@ -1067,7 +1067,7 @@ void CPlayerInterface::yourTurn()
|
|
|
adventureInt->hide();
|
|
|
}
|
|
|
|
|
|
-inline void subRect(const int & x, const int & y, const int & z, SDL_Rect & r, const int & hid)
|
|
|
+inline void subRect(const int & x, const int & y, const int & z, const SDL_Rect & r, const int & hid)
|
|
|
{
|
|
|
TerrainTile2 & hlp = CGI->mh->ttiles[x][y][z];
|
|
|
for(int h=0; h<hlp.objects.size(); ++h)
|
|
@@ -1089,7 +1089,7 @@ inline void delObjRect(const int & x, const int & y, const int & z, const int &
|
|
|
}
|
|
|
}
|
|
|
int getDir(int3 src, int3 dst)
|
|
|
-{
|
|
|
+{
|
|
|
int ret = -1;
|
|
|
if(dst.x+1 == src.x && dst.y+1 == src.y) //tl
|
|
|
{
|
|
@@ -1566,7 +1566,7 @@ SDL_Surface * CPlayerInterface::drawPrimarySkill(const CGHeroInstance *curh, SDL
|
|
|
char * buf = new char[10];
|
|
|
for (int i=from;i<to;i++)
|
|
|
{
|
|
|
- itoa(curh->primSkills[i],buf,10);
|
|
|
+ SDL_itoa(curh->primSkills[i],buf,10);
|
|
|
printAtMiddle(buf,84+28*i,68,GEOR13,zwykly,ret);
|
|
|
}
|
|
|
delete[] buf;
|
|
@@ -1583,11 +1583,11 @@ SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
|
|
for (std::map<int,std::pair<CCreature*,int> >::const_iterator i=curh->army.slots.begin(); i!=curh->army.slots.end();i++)
|
|
|
{
|
|
|
blitAt(CGI->creh->smallImgs[(*i).second.first->idNumber],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret);
|
|
|
- itoa((*i).second.second,buf,10);
|
|
|
+ SDL_itoa((*i).second.second,buf,10);
|
|
|
printAtMiddle(buf,slotsPos[(*i).first].first+17,slotsPos[(*i).first].second+39,GEORM,zwykly,ret);
|
|
|
}
|
|
|
blitAt(curh->type->portraitLarge,11,12,ret);
|
|
|
- itoa(curh->mana,buf,10);
|
|
|
+ SDL_itoa(curh->mana,buf,10);
|
|
|
printAtMiddle(buf,166,109,GEORM,zwykly,ret); //mana points
|
|
|
delete[] buf;
|
|
|
blitAt(morale22->ourImages[curh->getCurrentMorale()+3].bitmap,14,84,ret);
|
|
@@ -1608,14 +1608,14 @@ SDL_Surface * CPlayerInterface::drawTownInfoWin(const CGTownInstance * curh)
|
|
|
blitAt(forts->ourImages[pom].bitmap,115,42,ret);
|
|
|
if((pom=curh->hallLevel())>=0)
|
|
|
blitAt(halls->ourImages[pom].bitmap,77,42,ret);
|
|
|
- itoa(curh->dailyIncome(),buf,10);
|
|
|
+ SDL_itoa(curh->dailyIncome(),buf,10);
|
|
|
printAtMiddle(buf,167,70,GEORM,zwykly,ret);
|
|
|
for (std::map<int,std::pair<CCreature*,int> >::const_iterator i=curh->army.slots.begin(); i!=curh->army.slots.end();i++)
|
|
|
{
|
|
|
if(!i->second.first)
|
|
|
continue;
|
|
|
blitAt(CGI->creh->smallImgs[(*i).second.first->idNumber],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret);
|
|
|
- itoa((*i).second.second,buf,10);
|
|
|
+ SDL_itoa((*i).second.second,buf,10);
|
|
|
printAtMiddle(buf,slotsPos[(*i).first].first+17,slotsPos[(*i).first].second+39,GEORM,zwykly,ret);
|
|
|
}
|
|
|
|
|
@@ -1827,13 +1827,13 @@ void CPlayerInterface::handleEvent(SDL_Event *sEvent)
|
|
|
CGI->curh->cursorMove(sEvent->motion.x, sEvent->motion.y);
|
|
|
}
|
|
|
|
|
|
- if(sEvent->type==SDL_QUIT)
|
|
|
+ if(sEvent->type==SDL_QUIT)
|
|
|
exit(0);
|
|
|
else if (sEvent->type==SDL_KEYDOWN)
|
|
|
{
|
|
|
handleKeyDown(sEvent);
|
|
|
} //keydown end
|
|
|
- else if(sEvent->type==SDL_KEYUP)
|
|
|
+ else if(sEvent->type==SDL_KEYUP)
|
|
|
{
|
|
|
handleKeyUp(sEvent);
|
|
|
}//keyup end
|
|
@@ -1956,12 +1956,12 @@ void CPlayerInterface::garrisonChanged(const CGObjectInstance * obj)
|
|
|
hw->garInt->recreateSlots();
|
|
|
hw->garInt->show();
|
|
|
}
|
|
|
- else if(castleInt == curint) //opened town window - redraw town garrsion slots (change is within hero garr)
|
|
|
+ else if(castleInt == curint) //opened town window - redraw town garrsion slots (change is within hero garr)
|
|
|
{
|
|
|
castleInt->garr->highlighted = NULL;
|
|
|
castleInt->garr->recreateSlots();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else if (obj->ID == 98) //town
|
|
|
{
|
|
@@ -1971,7 +1971,7 @@ void CPlayerInterface::garrisonChanged(const CGObjectInstance * obj)
|
|
|
SDL_FreeSurface(townWins[tt->identifier]);
|
|
|
townWins[tt->identifier] = infoWin(tt);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const CCastleInterface *ci = dynamic_cast<CCastleInterface*>(curint);
|
|
|
if(ci)
|
|
|
{
|
|
@@ -2040,7 +2040,7 @@ BattleAction CPlayerInterface::activeStack(int stackID) //called when it's turn
|
|
|
objsToBlit[i]->show();
|
|
|
//SDL_Flip(screen);
|
|
|
CSDL_Ext::update(screen);
|
|
|
-
|
|
|
+
|
|
|
/*timeHandler th;
|
|
|
th.getDif();
|
|
|
int tv = th.getDif();
|
|
@@ -2181,7 +2181,7 @@ void CList::activate()
|
|
|
Hoverable::activate();
|
|
|
KeyInterested::activate();
|
|
|
MotionInterested::activate();
|
|
|
-};
|
|
|
+};
|
|
|
void CList::deactivate()
|
|
|
{
|
|
|
ClickableL::deactivate();
|
|
@@ -2189,7 +2189,7 @@ void CList::deactivate()
|
|
|
Hoverable::deactivate();
|
|
|
KeyInterested::deactivate();
|
|
|
MotionInterested::deactivate();
|
|
|
-};
|
|
|
+};
|
|
|
void CList::clickLeft(tribool down)
|
|
|
{
|
|
|
};
|
|
@@ -2201,7 +2201,7 @@ CHeroList::CHeroList(int Size)
|
|
|
:CList(Size)
|
|
|
{
|
|
|
pos = genRect(192,64,609,196);
|
|
|
-
|
|
|
+
|
|
|
arrupp = genRect(16,64,609,196);
|
|
|
arrdop = genRect(16,64,609,372);
|
|
|
//32px per hero
|
|
@@ -2211,7 +2211,7 @@ CHeroList::CHeroList(int Size)
|
|
|
pospory = 212;
|
|
|
posmanx = 666;
|
|
|
posmany = 213;
|
|
|
-
|
|
|
+
|
|
|
arrup = CGI->spriteh->giveDef("IAM012.DEF");
|
|
|
arrdo = CGI->spriteh->giveDef("IAM013.DEF");
|
|
|
mobile = CGI->spriteh->giveDef("IMOBIL.DEF");
|
|
@@ -2245,7 +2245,7 @@ void CHeroList::select(int which)
|
|
|
draw();
|
|
|
LOCPLINT->adventureInt->infoBar.draw(NULL);
|
|
|
}
|
|
|
- if (which>=items.size())
|
|
|
+ if (which>=items.size())
|
|
|
return;
|
|
|
selected = which;
|
|
|
LOCPLINT->adventureInt->centerOn(items[which].first->pos);
|
|
@@ -2254,7 +2254,7 @@ void CHeroList::select(int which)
|
|
|
LOCPLINT->adventureInt->terrain.currentPath = items[which].second;
|
|
|
draw();
|
|
|
LOCPLINT->adventureInt->townList.draw();
|
|
|
-
|
|
|
+
|
|
|
LOCPLINT->adventureInt->infoBar.draw(NULL);
|
|
|
}
|
|
|
void CHeroList::clickLeft(tribool down)
|
|
@@ -2410,7 +2410,7 @@ void CHeroList::updateMove(const CGHeroInstance* which) //draws move points bar
|
|
|
blitAt(mobile->ourImages[pom].bitmap,posmobx,posmoby+ser*32); //move point
|
|
|
}
|
|
|
void CHeroList::draw()
|
|
|
-{
|
|
|
+{
|
|
|
for (int iT=0+from;iT<5+from;iT++)
|
|
|
{
|
|
|
int i = iT-from;
|
|
@@ -2477,7 +2477,7 @@ CTownList::CTownList(int Size, SDL_Rect * Pos, int arupx, int arupy, int ardox,
|
|
|
pressed = indeterminate;
|
|
|
|
|
|
from = 0;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void CTownList::genList()
|
|
@@ -2491,7 +2491,7 @@ void CTownList::genList()
|
|
|
|
|
|
void CTownList::select(int which)
|
|
|
{
|
|
|
- if (which>=items.size())
|
|
|
+ if (which>=items.size())
|
|
|
return;
|
|
|
selected = which;
|
|
|
if(!fun.empty())
|
|
@@ -2593,7 +2593,7 @@ void CTownList::clickLeft(tribool down)
|
|
|
}
|
|
|
|
|
|
void CTownList::clickRight(tribool down)
|
|
|
-{
|
|
|
+{
|
|
|
if (down)
|
|
|
{
|
|
|
/***************************ARROWS*****************************************/
|
|
@@ -2635,7 +2635,7 @@ void CTownList::keyPressed (SDL_KeyboardEvent & key)
|
|
|
}
|
|
|
|
|
|
void CTownList::draw()
|
|
|
-{
|
|
|
+{
|
|
|
for (int iT=0+from;iT<SIZE+from;iT++)
|
|
|
{
|
|
|
int i = iT-from;
|
|
@@ -2718,7 +2718,7 @@ void CRecrutationWindow::clickLeft(tribool down)
|
|
|
{
|
|
|
if(isItIn(&genRect(132,102,pos.x+curx,pos.y+64),LOCPLINT->current->motion.x,LOCPLINT->current->motion.y))
|
|
|
{
|
|
|
- which = i;
|
|
|
+ which = i;
|
|
|
int newAmount = std::min(amounts[i],creatures[i].amount);
|
|
|
slider->amount = newAmount;
|
|
|
if(slider->value > newAmount)
|
|
@@ -2766,9 +2766,9 @@ void CRecrutationWindow::show(SDL_Surface * to)
|
|
|
cancel->show();
|
|
|
slider->show();
|
|
|
char pom[15];
|
|
|
- itoa(creatures[which].amount,pom,10); //available
|
|
|
+ SDL_itoa(creatures[which].amount,pom,10); //available
|
|
|
printAtMiddle(pom,pos.x+205,pos.y+252,GEOR13,zwykly,screen);
|
|
|
- itoa(slider->value,pom,10); //recruit
|
|
|
+ SDL_itoa(slider->value,pom,10); //recruit
|
|
|
printAtMiddle(pom,pos.x+279,pos.y+252,GEOR13,zwykly,screen);
|
|
|
printAtMiddle(CGI->generaltexth->allTexts[16] + " " + CGI->creh->creatures[creatures[which].ID].namePl,pos.x+243,pos.y+32,GEOR16,tytulowy,screen); //eg "Recruit Dragon flies"
|
|
|
int curx = pos.x+115-creatures[which].res.size()*16;
|
|
@@ -2776,9 +2776,9 @@ void CRecrutationWindow::show(SDL_Surface * to)
|
|
|
{
|
|
|
blitAt(CGI->townh->resources->ourImages[creatures[which].res[i].first].bitmap,curx,pos.y+243,screen);
|
|
|
blitAt(CGI->townh->resources->ourImages[creatures[which].res[i].first].bitmap,curx+258,pos.y+243,screen);
|
|
|
- itoa(creatures[which].res[i].second,pom,10);
|
|
|
+ SDL_itoa(creatures[which].res[i].second,pom,10);
|
|
|
printAtMiddle(pom,curx+12,pos.y+286,GEOR13,zwykly,screen);
|
|
|
- itoa(creatures[which].res[i].second * slider->value,pom,10);
|
|
|
+ SDL_itoa(creatures[which].res[i].second * slider->value,pom,10);
|
|
|
printAtMiddle(pom,curx+12+258,pos.y+286,GEOR13,zwykly,screen);
|
|
|
curx+=32;
|
|
|
}
|
|
@@ -2849,7 +2849,7 @@ CRecrutationWindow::CRecrutationWindow(const std::vector<std::pair<int,int> > &C
|
|
|
buy = new AdventureMapButton("","",boost::bind(&CRecrutationWindow::Buy,this),pos.x+212,pos.y+313,"IBY6432.DEF");
|
|
|
cancel = new AdventureMapButton("","",boost::bind(&CRecrutationWindow::Cancel,this),pos.x+290,pos.y+313,"ICN6432.DEF");
|
|
|
LOCPLINT->curint->deactivate();
|
|
|
- //AdventureMapButton( std::string Name, std::string HelpBox, void(T::*Function)(),
|
|
|
+ //AdventureMapButton( std::string Name, std::string HelpBox, void(T::*Function)(),
|
|
|
//int x, int y, std::string defName, T* Owner, bool activ=false, std::vector<std::string> * add = NULL, bool playerColoredButton = true );//c-tor
|
|
|
}//(int x, int y, int totalw, T*Owner,void(T::*Moved)(int to), int Capacity, int Amount, int Value, bool Horizontal)
|
|
|
CRecrutationWindow::~CRecrutationWindow()
|
|
@@ -2922,7 +2922,7 @@ void CSplitWindow::close()
|
|
|
deactivate();
|
|
|
delete this;
|
|
|
LOCPLINT->curint->activate();
|
|
|
-
|
|
|
+
|
|
|
CCastleInterface *c = dynamic_cast<CCastleInterface*>(LOCPLINT->curint);
|
|
|
if(c) c->showAll();
|
|
|
}
|
|
@@ -2939,16 +2939,16 @@ void CSplitWindow::show(SDL_Surface * to)
|
|
|
ok->show();
|
|
|
cancel->show();
|
|
|
slider->show();
|
|
|
- itoa(a1,pom,10);
|
|
|
+ SDL_itoa(a1,pom,10);
|
|
|
printAtMiddle(pom,pos.x+70,pos.y+237,GEOR16,zwykly,screen);
|
|
|
- itoa(a2,pom,10);
|
|
|
+ SDL_itoa(a2,pom,10);
|
|
|
printAtMiddle(pom,pos.x+233,pos.y+237,GEOR16,zwykly,screen);
|
|
|
anim->blitPic(screen,pos.x+20,pos.y+54,false);
|
|
|
anim->blitPic(screen,pos.x+177,pos.y+54,false);
|
|
|
}
|
|
|
void CSplitWindow::keyPressed (SDL_KeyboardEvent & key)
|
|
|
{
|
|
|
- //TODO: make manual typing possible
|
|
|
+ //TODO: make manual typing possible
|
|
|
}
|
|
|
|
|
|
void CCreInfoWindow::show(SDL_Surface * to)
|
|
@@ -2985,12 +2985,12 @@ CCreInfoWindow::CCreInfoWindow
|
|
|
|
|
|
//atttack
|
|
|
printAt(CGI->preth->zelp[435].first,155,48,GEOR13,zwykly,bitmap);
|
|
|
- itoa(c->attack,pom,10);
|
|
|
+ SDL_itoa(c->attack,pom,10);
|
|
|
if(State && State->attackBonus)
|
|
|
{
|
|
|
int hlp = log10f(c->attack)+2;
|
|
|
pom[hlp-1] = ' '; pom[hlp] = '(';
|
|
|
- itoa(c->attack+State->attackBonus,pom+hlp+1,10);
|
|
|
+ SDL_itoa(c->attack+State->attackBonus,pom+hlp+1,10);
|
|
|
hlp += 2+(int)log10f(State->attackBonus+c->attack);
|
|
|
pom[hlp] = ')'; pom[hlp+1] = '\0';
|
|
|
}
|
|
@@ -2998,12 +2998,12 @@ CCreInfoWindow::CCreInfoWindow
|
|
|
|
|
|
//defense
|
|
|
printAt(CGI->preth->zelp[436].first,155,67,GEOR13,zwykly,bitmap);
|
|
|
- itoa(c->defence,pom,10);
|
|
|
+ SDL_itoa(c->defence,pom,10);
|
|
|
if(State && State->defenseBonus)
|
|
|
{
|
|
|
int hlp = log10f(c->defence)+2;
|
|
|
pom[hlp-1] = ' '; pom[hlp] = '(';
|
|
|
- itoa(c->defence+State->defenseBonus,pom+hlp+1,10);
|
|
|
+ SDL_itoa(c->defence+State->defenseBonus,pom+hlp+1,10);
|
|
|
pom[hlp+2+(int)log10f(State->defenseBonus+c->defence)] = ')';
|
|
|
}
|
|
|
printToWR(pom,276,80,GEOR13,zwykly,bitmap);
|
|
@@ -3012,21 +3012,21 @@ CCreInfoWindow::CCreInfoWindow
|
|
|
if(c->shots)
|
|
|
{
|
|
|
printAt(CGI->generaltexth->allTexts[198],155,86,GEOR13,zwykly,bitmap);
|
|
|
- itoa(c->shots,pom,10);
|
|
|
+ SDL_itoa(c->shots,pom,10);
|
|
|
printToWR(pom,276,99,GEOR13,zwykly,bitmap);
|
|
|
}
|
|
|
|
|
|
//damage
|
|
|
printAt(CGI->generaltexth->allTexts[199],155,105,GEOR13,zwykly,bitmap);
|
|
|
- itoa(c->damageMin,pom,10);
|
|
|
+ SDL_itoa(c->damageMin,pom,10);
|
|
|
hlp=log10f(c->damageMin)+2;
|
|
|
pom[hlp-1]=' '; pom[hlp]='-'; pom[hlp+1]=' ';
|
|
|
- itoa(c->damageMax,pom+hlp+2,10);
|
|
|
+ SDL_itoa(c->damageMax,pom+hlp+2,10);
|
|
|
printToWR(pom,276,118,GEOR13,zwykly,bitmap);
|
|
|
|
|
|
//health
|
|
|
printAt(CGI->preth->zelp[439].first,155,124,GEOR13,zwykly,bitmap);
|
|
|
- itoa(c->hitPoints,pom,10);
|
|
|
+ SDL_itoa(c->hitPoints,pom,10);
|
|
|
printToWR(pom,276,137,GEOR13,zwykly,bitmap);
|
|
|
|
|
|
//remaining health - TODO: show during the battles
|
|
@@ -3034,7 +3034,7 @@ CCreInfoWindow::CCreInfoWindow
|
|
|
|
|
|
//speed
|
|
|
printAt(CGI->preth->zelp[441].first,155,162,GEOR13,zwykly,bitmap);
|
|
|
- itoa(c->speed,pom,10);
|
|
|
+ SDL_itoa(c->speed,pom,10);
|
|
|
printToWR(pom,276,175,GEOR13,zwykly,bitmap);
|
|
|
|
|
|
|
|
@@ -3105,7 +3105,7 @@ void CCreInfoWindow::keyPressed (SDL_KeyboardEvent & key)
|
|
|
void CCreInfoWindow::deactivate()
|
|
|
{
|
|
|
if(!type)
|
|
|
- ClickableR::deactivate();
|
|
|
+ ClickableR::deactivate();
|
|
|
LOCPLINT->objsToBlit.erase(std::find(LOCPLINT->objsToBlit.begin(),LOCPLINT->objsToBlit.end(),this));
|
|
|
if(ok)
|
|
|
ok->deactivate();
|