1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Compile fixes specific for VS 2012"

* Reverted std::bind to boost::bind. std::bind on Visual 2012 doesn't work in some cases (especially with std::ref), not sure why [but it seems to be a bug, since 2013 preview compiles the same code fine]. 
 * Move assignment operator for VS 2012.
This commit is contained in:
Michał W. Urbańczyk
2013-07-02 15:23:32 +00:00
parent 7a8e401860
commit a1f545792b
31 changed files with 319 additions and 294 deletions

View File

@ -516,7 +516,7 @@ void CHighlightableButtonsGroup::addButton(CHighlightableButton* bt)
addChild(bt);
bt->recActions = defActions;//FIXME: not needed?
bt->callback += std::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
bt->callback += boost::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
bt->onlyOn = true;
buttons.push_back(bt);
}
@ -530,7 +530,7 @@ void CHighlightableButtonsGroup::addButton(const std::map<int,std::string> &tool
bt->setOffset(buttons.size()-3);
}
bt->ID = uid;
bt->callback += std::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
bt->callback += boost::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
bt->onlyOn = true;
buttons.push_back(bt);
}
@ -753,9 +753,9 @@ CSlider::CSlider(int x, int y, int totalw, std::function<void(int)> Moved, int C
right->pos.y = pos.y + totalw - 16;
}
left->callback = std::bind(&CSlider::moveLeft,this);
right->callback = std::bind(&CSlider::moveRight,this);
slider->callback = std::bind(&CSlider::sliderClicked,this);
left->callback = boost::bind(&CSlider::moveLeft,this);
right->callback = boost::bind(&CSlider::moveRight,this);
slider->callback = boost::bind(&CSlider::sliderClicked,this);
left->pos.w = left->pos.h = right->pos.w = right->pos.h = slider->pos.w = slider->pos.h = 16;
if(horizontal)
{
@ -948,7 +948,7 @@ CListBox::CListBox(CreateFunc create, DestroyFunc destroy, Point Pos, Point Item
if (Slider & 1)
{
OBJ_CONSTRUCTION_CAPTURING_ALL;
slider = new CSlider(SliderPos.x, SliderPos.y, SliderPos.w, std::bind(&CListBox::moveToPos, this, _1),
slider = new CSlider(SliderPos.x, SliderPos.y, SliderPos.w, boost::bind(&CListBox::moveToPos, this, _1),
VisibleSize, TotalSize, InitialPos, Slider & 2, Slider & 4);
}
reset();
@ -1341,7 +1341,7 @@ void CTextBox::recalculateLines(const std::string &Txt)
{
lines = CMessage::breakText(Txt, pos.w - 32 - 10, font);
OBJ_CONSTRUCTION_CAPTURING_ALL;
slider = new CSlider(pos.w - 32, 0, pos.h, std::bind(&CTextBox::sliderMoved, this, _1), lineCapacity, lines.size(), 0, false, sliderStyle);
slider = new CSlider(pos.w - 32, 0, pos.h, boost::bind(&CTextBox::sliderMoved, this, _1), lineCapacity, lines.size(), 0, false, sliderStyle);
if(active)
slider->activate();
}