[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdegames/kolf
From: Stefan Majewsky <majewsky () gmx ! net>
Date: 2010-10-31 23:22:58
Message-ID: 20101031232258.5902AAC89E () svn ! kde ! org
[Download RAW message or body]
SVN commit 1191703 by majewsky:
Remove CanvasItem::fastAdvance, yet another unused functionality.
M +0 -1 ball.h
M +0 -4 canvasitem.h
M +2 -32 game.cpp
M +0 -4 game.h
--- trunk/KDE/kdegames/kolf/ball.h #1191702:1191703
@@ -72,7 +72,6 @@
bool collisionLock() const { return m_collisionLock; }
void setCollisionLock(bool yes) { m_collisionLock = yes; }
- virtual void fastAdvanceDone() { setCollisionLock(false); }
void shotStarted() { maxBumperBounceSpeed = 8; }
--- trunk/KDE/kdegames/kolf/canvasitem.h #1191702:1191703
@@ -66,10 +66,6 @@
virtual void aboutToDelete() {}
///Returns whether this item should be able to be deleted by user while editing.
virtual bool deleteable() const { return true; }
- ///Returns whether this item should get doAdvance called -- it is called in sync \
with ball advancing (which is twice as fast as the advance() calling \
rate)
- virtual bool fastAdvance() const { return false; }
- ///Called when all items have had their chance at a doAdvance.
- virtual void fastAdvanceDone() {}
///called if fastAdvance is enabled
virtual void doAdvance() {}
///Returns whether all items of this type of item (based on data()) that are \
"colliding" (ie, in the same spot) with ball should get collision() \
called.
--- trunk/KDE/kdegames/kolf/game.cpp #1191702:1191703
@@ -2127,7 +2127,6 @@
lastDelId = -1;
m_showInfo = false;
ballStateList.canUndo = false;
- fastAdvancedExist = false;
soundDir = KStandardDirs::locate("appdata", "sounds/");
dontAddStroke = false;
addingNewHole = false;
@@ -2839,28 +2838,12 @@
if (!editing)
{
- for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) {
+ for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it)
(*it).ball()->doAdvance();
- }
-
- if (fastAdvancedExist)
- {
- QList<CanvasItem *>::const_iterator citem;
- for (citem = fastAdvancers.constBegin(); citem != fastAdvancers.constEnd(); \
++citem)
- (*citem)->doAdvance();
- }
-
for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it)
- (*it).ball()->fastAdvanceDone();
-
- if (fastAdvancedExist)
- {
- QList<CanvasItem *>::const_iterator citem;
- for (citem = fastAdvancers.constBegin(); citem != fastAdvancers.constEnd(); \
++citem)
- (*citem)->fastAdvanceDone();
+ (*it).ball()->setCollisionLock(false);
}
}
-}
void KolfGame::ballMoved()
{
@@ -3489,7 +3472,6 @@
items.clear();
extraMoveable.clear();
- fastAdvancers.clear();
selectedItem = 0;
// will tell basic course info
@@ -3573,8 +3555,6 @@
sceneItem->editModeChanged(editing);
sceneItem->setName(name);
addItemsToMoveableList(sceneItem->moveableItems());
- if (sceneItem->fastAdvance())
- addItemToFastAdvancersList(sceneItem);
newItem->setPos(x, y);
newItem->setVisible(true);
@@ -3687,12 +3667,6 @@
extraMoveable.append(*item);
}
-void KolfGame::addItemToFastAdvancersList(CanvasItem *item)
-{
- fastAdvancers.append(item);
- fastAdvancedExist = fastAdvancers.count() > 0;
-}
-
void KolfGame::addNewObject(const QString& identifier)
{
QGraphicsItem *newItem = m_factory.createInstance(identifier, courseBoard);
@@ -3745,9 +3719,6 @@
sceneItem->setName(identifier);
addItemsToMoveableList(sceneItem->moveableItems());
- if (sceneItem->fastAdvance())
- addItemToFastAdvancersList(sceneItem);
-
newItem->setPos(width/2 - 18, height / 2 - 18);
sceneItem->moveBy(0, 0);
sceneItem->setSize(newItem->boundingRect().size());
@@ -3941,7 +3912,6 @@
// we use this bool for optimization
// in openFile().
bool hasFinalLoad = false;
- fastAdvancedExist = false;
QList<QGraphicsItem *>::const_iterator item;
for (item = items.constBegin(); item != items.constEnd(); ++item)
--- trunk/KDE/kdegames/kolf/game.h #1191702:1191703
@@ -833,7 +833,6 @@
void putterTimeout();
void autoSaveTimeout();
void addItemsToMoveableList(QList<QGraphicsItem *>);
- void addItemToFastAdvancersList(CanvasItem *);
void emitMax();
@@ -964,9 +963,6 @@
bool m_useMouse;
bool m_useAdvancedPutting;
- QList<CanvasItem *> fastAdvancers;
- bool fastAdvancedExist;
-
QString playerWhoMaxed;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic