mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Changes to compile under gcc
This commit is contained in:
@ -19,6 +19,7 @@
|
|||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/algorithm/string/replace.hpp>
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
#include <boost/assign/std/vector.hpp>
|
#include <boost/assign/std/vector.hpp>
|
||||||
|
#include <cmath>
|
||||||
using namespace boost::assign;
|
using namespace boost::assign;
|
||||||
using namespace CSDL_Ext;
|
using namespace CSDL_Ext;
|
||||||
|
|
||||||
|
@ -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(&CCastleInterface::showAll,pom,screen,true);
|
||||||
}
|
}
|
||||||
fs[1] += boost::bind(&CCreInfoWindow::activate,this);
|
fs[1] += boost::bind(&CCreInfoWindow::activate,this);
|
||||||
CFunctionList<void()> cfl = boost::bind(&CCreInfoWindow::deactivate,this);
|
CFunctionList<void()> 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);
|
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");
|
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(&CCastleInterface::showAll,pom,screen,true);
|
||||||
}
|
}
|
||||||
fs[1] += boost::bind(&CCreInfoWindow::activate,this);
|
fs[1] += boost::bind(&CCreInfoWindow::activate,this);
|
||||||
CFunctionList<void()> cfl = boost::bind(&CCreInfoWindow::deactivate,this);
|
CFunctionList<void()> cfl;
|
||||||
|
cfl = boost::bind(&CCreInfoWindow::deactivate,this);
|
||||||
cfl += boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],std::vector<SComponent*>(),fs[0],fs[1],false,false);
|
cfl += boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],std::vector<SComponent*>(),fs[0],fs[1],false,false);
|
||||||
dismiss = new AdventureMapButton("",CGI->preth->zelp[445].second,cfl,pos.x+21,pos.y+237,"IVIEWCR2.DEF");
|
dismiss = new AdventureMapButton("",CGI->preth->zelp[445].second,cfl,pos.x+21,pos.y+237,"IVIEWCR2.DEF");
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,8 @@ void CClient::process(int what)
|
|||||||
std::vector<Component*> comps;
|
std::vector<Component*> comps;
|
||||||
for(int i=0;i<iw.components.size();i++)
|
for(int i=0;i<iw.components.size();i++)
|
||||||
comps.push_back(&iw.components[i]);
|
comps.push_back(&iw.components[i]);
|
||||||
playerint[iw.player]->showInfoDialog(toString(iw.text),comps);
|
std::string str = toString(iw.text);
|
||||||
|
playerint[iw.player]->showInfoDialog(str,comps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 104:
|
case 104:
|
||||||
@ -374,7 +375,10 @@ void CClient::process(int what)
|
|||||||
gs->apply(&bs);
|
gs->apply(&bs);
|
||||||
CGHeroInstance *h = gs->getHero(bs.heroid);
|
CGHeroInstance *h = gs->getHero(bs.heroid);
|
||||||
if(vstd::contains(playerint,h->tempOwner))
|
if(vstd::contains(playerint,h->tempOwner))
|
||||||
playerint[h->tempOwner]->heroGotLevel(h,bs.primskill,bs.skills,boost::function<void(ui32)>(boost::bind(&CCallback::selectionMade,cb,_1,bs.id)));
|
{
|
||||||
|
boost::function<void(ui32)> callback = boost::function<void(ui32)>(boost::bind(&CCallback::selectionMade,cb,_1,bs.id));
|
||||||
|
playerint[h->tempOwner]->heroGotLevel((const CGHeroInstance *)h,(int)bs.primskill,bs.skills, callback);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2001:
|
case 2001:
|
||||||
@ -385,7 +389,8 @@ void CClient::process(int what)
|
|||||||
std::vector<Component*> comps;
|
std::vector<Component*> comps;
|
||||||
for(int i=0;i<sd.components.size();i++)
|
for(int i=0;i<sd.components.size();i++)
|
||||||
comps.push_back(&sd.components[i]);
|
comps.push_back(&sd.components[i]);
|
||||||
playerint[sd.player]->showSelDialog(toString(sd.text),comps,sd.id);
|
std::string str = toString(sd.text);
|
||||||
|
playerint[sd.player]->showSelDialog(str,comps,sd.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3000:
|
case 3000:
|
||||||
|
2
global.h
2
global.h
@ -115,7 +115,7 @@ namespace vstd
|
|||||||
template <typename Container, typename Item>
|
template <typename Container, typename Item>
|
||||||
bool operator-=(Container &c, const Item &i)
|
bool operator-=(Container &c, const Item &i)
|
||||||
{
|
{
|
||||||
Container::iterator itr = find(c,i);
|
typename Container::iterator itr = find(c,i);
|
||||||
if(itr == c.end())
|
if(itr == c.end())
|
||||||
return false;
|
return false;
|
||||||
c.erase(itr);
|
c.erase(itr);
|
||||||
|
@ -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
|
hlu.skills.push_back(hero->type->heroClass->chooseSecSkill(none)); //new skill
|
||||||
}
|
}
|
||||||
applyAndAsk(&hlu,hero->tempOwner,boost::function<void(ui32)>(boost::bind(callWith<ui16>,hlu.skills,boost::function<void(ui16)>(boost::bind(&CGameHandler::changeSecSkill,this,ID,_1,1,0)),_1))); //call changeSecSkill with appropriate args when client responds
|
boost::function<void(ui32)> callback = boost::function<void(ui32)>(boost::bind(callWith<ui16>,hlu.skills,boost::function<void(ui16)>(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
|
#else
|
||||||
boost::xtime time={0,0};
|
boost::xtime time={0,0};
|
||||||
time.sec = static_cast<boost::xtime::xtime_sec_t>(p.total_seconds());
|
time.sec = static_cast<boost::xtime::xtime_sec_t>(p.total_seconds());
|
||||||
cTurn.timed_wait(lock,time);
|
states.cv.timed_wait(lock,time);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user