[Kde-games-devel] KDE/kdegames/kolf
Stefan Majewsky
majewsky at gmx.net
Mon Nov 1 00:23:51 CET 2010
SVN commit 1191723 by majewsky:
Make Box2D the default physics engine for Kolf.
Mission accomplished, folks!
CCMAIL: kde-games-devel at kde.org
BUG: 46532
BUG: 51227
BUG: 131488
M +0 -10 ball.cpp
M +1 -5 ball.h
--- trunk/KDE/kdegames/kolf/ball.cpp #1191722:1191723
@@ -105,21 +105,11 @@
game->ballMoved();
}
-#if BALL_BOX2D_STEPPING
void Ball::setVelocity(const Vector& velocity)
{
CanvasItem::setPhysicalVelocity(velocity);
}
-#endif
-void Ball::doAdvance()
-{
-#if BALL_BOX2D_STEPPING == 0
- if (!velocity().isNull())
- moveBy(velocity().x(), velocity().y());
-#endif
-}
-
void Ball::collisionDetect()
{
if (!isVisible() || state == Holed || !m_doDetect)
--- trunk/KDE/kdegames/kolf/ball.h #1191722:1191723
@@ -20,7 +20,6 @@
#ifndef KOLF_BALL_H
#define KOLF_BALL_H
-#define BALL_BOX2D_STEPPING 1
#include "canvasitem.h"
class Wall;
@@ -35,7 +34,6 @@
BallState currentState();
- virtual void doAdvance();
virtual void moveBy(double dx, double dy);
virtual bool deleteable() const { return false; }
@@ -52,10 +50,8 @@
void friction();
void collisionDetect();
-#if BALL_BOX2D_STEPPING
virtual void setVelocity(const Vector& velocity);
Vector velocity() const { return CanvasItem::physicalVelocity(); }
-#endif
int addStroke() const { return m_addStroke; }
bool placeOnGround(Vector &v) { v = m_pogOldVelocity; return m_placeOnGround; }
@@ -82,7 +78,7 @@
void reduceMaxBumperBounceSpeed() { if(maxBumperBounceSpeed > 0.4) maxBumperBounceSpeed -= 0.35; }
public slots:
- void update() { doAdvance(); }
+ void update() { }
private:
BallState state;
More information about the kde-games-devel
mailing list