Allows faster speeds. (Timers more often than roughly 10 ms seem not to
be available on N950.)
TimerControlledGraphicsPixmapObject::TimerControlledGraphicsPixmapObject(QPixmap pixmap, int speed, QGraphicsItem* parent) :
QObject(), QGraphicsPixmapItem(pixmap, parent)
{
TimerControlledGraphicsPixmapObject::TimerControlledGraphicsPixmapObject(QPixmap pixmap, int speed, QGraphicsItem* parent) :
QObject(), QGraphicsPixmapItem(pixmap, parent)
{
setSpeed(speed);
changeDirection();
connect(&timer_,SIGNAL(timeout()),this,SLOT(move()));
setSpeed(speed);
changeDirection();
connect(&timer_,SIGNAL(timeout()),this,SLOT(move()));
- timer_.setInterval(1000/speed); //converts from pixels in second to milliseconds per pixel
+ timer_.setInterval((1000/(speed/pixelsPerMove_))); //converts from pixels in second to milliseconds per pixels moved at once
stoppedBecauseInvalidTime_ = false;
}
else
stoppedBecauseInvalidTime_ = false;
}
else
if (direction_ == E || direction_ == SE || direction_ == NE)
{
if (direction_ == E || direction_ == SE || direction_ == NE)
{
}
if (direction_ == W || direction_ == SW || direction_ == NW)
{
}
if (direction_ == W || direction_ == SW || direction_ == NW)
{
}
if (direction_ == S || direction_ == SE || direction_ == SW)
{
}
if (direction_ == S || direction_ == SE || direction_ == SW)
{
}
if (direction_ == N || direction_ == NE || direction_ == NW)
{
}
if (direction_ == N || direction_ == NE || direction_ == NW)
{
bool stoppedBecauseInvalidTime_;
bool stoppedBecauseInvalidTime_;