From c94fbbf228462e34a4deaa605f7288a46f704048 Mon Sep 17 00:00:00 2001 From: Vadim Glazunov Date: Sun, 17 Aug 2008 14:09:30 +0000 Subject: [PATCH] Changes to compile under gcc --- CCastleInterface.cpp | 3 ++- CPlayerInterface.cpp | 8 +++++--- client/Client.cpp | 11 ++++++++--- global.h | 2 +- server/CGameHandler.cpp | 7 ++++--- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CCastleInterface.cpp b/CCastleInterface.cpp index ce1f4408b..9c8282084 100644 --- a/CCastleInterface.cpp +++ b/CCastleInterface.cpp @@ -19,6 +19,7 @@ #include #include #include +#include using namespace boost::assign; using namespace CSDL_Ext; @@ -1337,4 +1338,4 @@ void CFortScreen::RecArea::activate() void CFortScreen::RecArea::deactivate() { ClickableL::deactivate(); -} \ No newline at end of file +} diff --git a/CPlayerInterface.cpp b/CPlayerInterface.cpp index 12b3d9b40..f8da7b448 100644 --- a/CPlayerInterface.cpp +++ b/CPlayerInterface.cpp @@ -3170,7 +3170,8 @@ CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount, StackState fs[1] += boost::bind(&CCastleInterface::showAll,pom,screen,true); } fs[1] += boost::bind(&CCreInfoWindow::activate,this); - CFunctionList cfl = boost::bind(&CCreInfoWindow::deactivate,this); + CFunctionList cfl; + cfl = boost::bind(&CCreInfoWindow::deactivate,this); cfl += boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[207],boost::ref(upgResCost),fs[0],fs[1],false,false); upgrade = new AdventureMapButton("",CGI->preth->zelp[446].second,cfl,pos.x+76,pos.y+237,"IVIEWCR.DEF"); } @@ -3187,7 +3188,8 @@ CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount, StackState fs[1] += boost::bind(&CCastleInterface::showAll,pom,screen,true); } fs[1] += boost::bind(&CCreInfoWindow::activate,this); - CFunctionList cfl = boost::bind(&CCreInfoWindow::deactivate,this); + CFunctionList cfl; + cfl = boost::bind(&CCreInfoWindow::deactivate,this); cfl += boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],std::vector(),fs[0],fs[1],false,false); dismiss = new AdventureMapButton("",CGI->preth->zelp[445].second,cfl,pos.x+21,pos.y+237,"IVIEWCR2.DEF"); } @@ -3408,4 +3410,4 @@ CMinorResDataBar::CMinorResDataBar() CMinorResDataBar::~CMinorResDataBar() { SDL_FreeSurface(bg); -} \ No newline at end of file +} diff --git a/client/Client.cpp b/client/Client.cpp index b16ac7946..f1aae09d0 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -199,7 +199,8 @@ void CClient::process(int what) std::vector comps; for(int i=0;ishowInfoDialog(toString(iw.text),comps); + std::string str = toString(iw.text); + playerint[iw.player]->showInfoDialog(str,comps); break; } case 104: @@ -374,7 +375,10 @@ void CClient::process(int what) gs->apply(&bs); CGHeroInstance *h = gs->getHero(bs.heroid); if(vstd::contains(playerint,h->tempOwner)) - playerint[h->tempOwner]->heroGotLevel(h,bs.primskill,bs.skills,boost::function(boost::bind(&CCallback::selectionMade,cb,_1,bs.id))); + { + boost::function callback = boost::function(boost::bind(&CCallback::selectionMade,cb,_1,bs.id)); + playerint[h->tempOwner]->heroGotLevel((const CGHeroInstance *)h,(int)bs.primskill,bs.skills, callback); + } break; } case 2001: @@ -385,7 +389,8 @@ void CClient::process(int what) std::vector comps; for(int i=0;ishowSelDialog(toString(sd.text),comps,sd.id); + std::string str = toString(sd.text); + playerint[sd.player]->showSelDialog(str,comps,sd.id); break; } case 3000: diff --git a/global.h b/global.h index d8f6fd818..22a86f685 100644 --- a/global.h +++ b/global.h @@ -115,7 +115,7 @@ namespace vstd template bool operator-=(Container &c, const Item &i) { - Container::iterator itr = find(c,i); + typename Container::iterator itr = find(c,i); if(itr == c.end()) return false; c.erase(itr); diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 58e038004..fc29d8fe4 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -234,7 +234,8 @@ void CGameHandler::changePrimSkill(int ID, int which, int val, bool abs) { hlu.skills.push_back(hero->type->heroClass->chooseSecSkill(none)); //new skill } - applyAndAsk(&hlu,hero->tempOwner,boost::function(boost::bind(callWith,hlu.skills,boost::function(boost::bind(&CGameHandler::changeSecSkill,this,ID,_1,1,0)),_1))); //call changeSecSkill with appropriate args when client responds + boost::function callback = boost::function(boost::bind(callWith,hlu.skills,boost::function(boost::bind(&CGameHandler::changeSecSkill,this,ID,_1,1,0)),_1)); + applyAndAsk(&hlu,hero->tempOwner,callback); //call changeSecSkill with appropriate args when client responds } } } @@ -1054,7 +1055,7 @@ void CGameHandler::run() #else boost::xtime time={0,0}; time.sec = static_cast(p.total_seconds()); - cTurn.timed_wait(lock,time); + states.cv.timed_wait(lock,time); #endif } } @@ -1205,4 +1206,4 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army BattleStart bs; bs.info = curB; sendAndApply(&bs); -} \ No newline at end of file +}