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) ...@@ -143,7 +143,7 @@ void IsometricRobotModule::loadActorData(QIODevice *source)
void IsometricRobotModule::setAnimationEnabled(bool enabled) void IsometricRobotModule::setAnimationEnabled(bool enabled)
{ {
if (_robotView) { if (_robotView) {
_robotView->setAnimated(enabled); _robotView->setAnimated(false); // TODO improve me, then fix
} }
} }
......
...@@ -76,10 +76,11 @@ void RobotItem::waitForAnimated() ...@@ -76,10 +76,11 @@ void RobotItem::waitForAnimated()
AnimationType anim = _animationType; AnimationType anim = _animationType;
_mutex_animation->unlock(); _mutex_animation->unlock();
if (anim==NoAnimation) if (anim==NoAnimation)
QApplication::processEvents();
break; break;
QApplication::processEvents();
msleep(1); msleep(1);
} }
QApplication::processEvents();
} }
void RobotItem::handleAnimationFinished() void RobotItem::handleAnimationFinished()
......
...@@ -43,6 +43,14 @@ RobotView::RobotView(RobotModel * model, const QDir & imagesDir, QGraphicsItem * ...@@ -43,6 +43,14 @@ RobotView::RobotView(RobotModel * model, const QDir & imagesDir, QGraphicsItem *
} }
} }
void RobotView::waitForAnimated()
{
if (_robotItem) {
_robotItem->waitForAnimated();
}
update();
}
RobotView::~RobotView() RobotView::~RobotView()
{ {
if (_robotItem) { if (_robotItem) {
...@@ -53,7 +61,9 @@ RobotView::~RobotView() ...@@ -53,7 +61,9 @@ RobotView::~RobotView()
void RobotView::handleModelFieldChanged() void RobotView::handleModelFieldChanged()
{ {
createField(); createField();
const bool robotWasAnimated = isAnimated();
createRobot(); createRobot();
setAnimated(robotWasAnimated);
} }
...@@ -669,14 +679,14 @@ void RobotView::handleRobotEvaluationFinised() ...@@ -669,14 +679,14 @@ void RobotView::handleRobotEvaluationFinised()
void RobotView::setAnimated(bool v) void RobotView::setAnimated(bool v)
{ {
if (!_robotItem) if (! _robotItem)
return; return;
_robotItem->setAnimated(v); _robotItem->setAnimated(v);
} }
bool RobotView::isAnimated() const bool RobotView::isAnimated() const
{ {
if (_robotItem) if (! _robotItem)
return false; return false;
return _robotItem->isAnimated(); return _robotItem->isAnimated();
} }
......
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
Points Points
}; };
RobotView(RobotModel * model, const QDir & imagesDir, QGraphicsItem *parent=NULL); RobotView(RobotModel * model, const QDir & imagesDir, QGraphicsItem *parent=NULL);
inline void waitForAnimated() { _robotItem->waitForAnimated(); } void waitForAnimated();
void prepareToDispose(); void prepareToDispose();
void finishEvaluation(); void finishEvaluation();
inline qreal baseZOrder(int x, int y) { return _model->cellAt(x, y).baseZOrder; } 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