Commit c56feade authored by Victor Yacovlev's avatar Victor Yacovlev

Temporary disabled all isorobot animations

parent 76e3d5cc
......@@ -143,7 +143,7 @@ void IsometricRobotModule::loadActorData(QIODevice *source)
void IsometricRobotModule::setAnimationEnabled(bool enabled)
{
if (_robotView) {
_robotView->setAnimated(enabled);
_robotView->setAnimated(false); // TODO improve me, then fix
}
}
......
......@@ -76,10 +76,11 @@ void RobotItem::waitForAnimated()
AnimationType anim = _animationType;
_mutex_animation->unlock();
if (anim==NoAnimation)
break;
QApplication::processEvents();
break;
msleep(1);
}
QApplication::processEvents();
}
void RobotItem::handleAnimationFinished()
......
......@@ -43,6 +43,14 @@ RobotView::RobotView(RobotModel * model, const QDir & imagesDir, QGraphicsItem *
}
}
void RobotView::waitForAnimated()
{
if (_robotItem) {
_robotItem->waitForAnimated();
}
update();
}
RobotView::~RobotView()
{
if (_robotItem) {
......@@ -53,7 +61,9 @@ RobotView::~RobotView()
void RobotView::handleModelFieldChanged()
{
createField();
const bool robotWasAnimated = isAnimated();
createRobot();
setAnimated(robotWasAnimated);
}
......@@ -669,14 +679,14 @@ void RobotView::handleRobotEvaluationFinised()
void RobotView::setAnimated(bool v)
{
if (!_robotItem)
if (! _robotItem)
return;
_robotItem->setAnimated(v);
}
bool RobotView::isAnimated() const
{
if (_robotItem)
if (! _robotItem)
return false;
return _robotItem->isAnimated();
}
......
......@@ -35,7 +35,7 @@ public:
Points
};
RobotView(RobotModel * model, const QDir & imagesDir, QGraphicsItem *parent=NULL);
inline void waitForAnimated() { _robotItem->waitForAnimated(); }
void waitForAnimated();
void prepareToDispose();
void finishEvaluation();
inline qreal baseZOrder(int x, int y) { return _model->cellAt(x, y).baseZOrder; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment