[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/kolf-ng
From: Stefan Majewsky <majewsky () gmx ! net>
Date: 2009-07-11 17:04:21
Message-ID: 1247331861.958421.32330.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 995002 by majewsky:
* Remove snapshotting functionality, which was not working at all currently, and is \
conceptually superseded by the texture blender.
* Rename Kolf::Object::updatePosition() to "kinematicStateChanged", which is a more \
appropriate name for the method name.
M +7 -3 elements/object.cpp
M +2 -2 elements/object.h
M +1 -6 elements/scene.cpp
M +0 -2 elements/scene.h
M +2 -0 engine/game-editor.cpp
M +2 -0 engine/kolf-editorui.rc
--- trunk/playground/games/kolf-ng/elements/object.cpp #995001:995002
@@ -168,10 +168,14 @@
objectEvent(VelocityChangeEvent, qVariantFromValue(velocity));
}
-void Kolf::Object::updatePosition()
+void Kolf::Object::kinematicStateChanged()
{
- setPosition(position());
-// setRotation(rotation()); //note that this removes any non-2D rotations
+ if (isMovable())
+ {
+ setPosition(position());
+ //setRotation(rotation()); //note that this removes any non-2D rotations
+ setVelocity(velocity());
+ }
}
//default implementation for virtual Kolf::Object methods
--- trunk/playground/games/kolf-ng/elements/object.h #995001:995002
@@ -121,8 +121,8 @@
virtual QRectF boundingRect() const;
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, \
QWidget* widget = 0); public Q_SLOTS:
- ///Interface to Kolf::Scene: The scene calls this method after calculating the \
next frame, to let the objects update their position.
- void updatePosition();
+ ///Interface to Kolf::Scene: The scene calls this method after calculating the \
next frame, to let the objects update their representation and generate objectEvents \
for the changed kinematic state (this includes position and velocity). + void \
kinematicStateChanged(); Q_SIGNALS:
///This signal is emitted whenever the value of an object's property changes.
void updated();
--- trunk/playground/games/kolf-ng/elements/scene.cpp #995001:995002
@@ -75,7 +75,7 @@
m_balls << ball;
const Kolf::PointF position = object->position();
object->setPos(position.x(), position.y());
- connect(this, SIGNAL(nextFrameSimulated()), object, SLOT(updatePosition()));
+ connect(this, SIGNAL(nextFrameSimulated()), object, \
SLOT(kinematicStateChanged())); emit objectAdded(object);
}
}
@@ -111,11 +111,6 @@
emit newHole();
}
-void Kolf::Scene::askForSnapshot()
-{
- emit snapshot();
-}
-
void Kolf::Scene::timerEvent(QTimerEvent* event)
{
//filter events that we do not want
--- trunk/playground/games/kolf-ng/elements/scene.h #995001:995002
@@ -47,7 +47,6 @@
void removeObject(Kolf::Object* object);
void clear();
void holeChanged();
- void askForSnapshot();
Q_SIGNALS:
void objectAdded(Kolf::Object* object);
@@ -58,7 +57,6 @@
void nextFrameSimulated();
void turnEnded();
void newHole();
- void snapshot();
protected:
virtual void timerEvent(QTimerEvent* event);
--- trunk/playground/games/kolf-ng/engine/game-editor.cpp #995001:995002
@@ -67,12 +67,14 @@
//undo and redo
m_undoAction = KStandardAction::undo(0, "", actionCollection());
m_redoAction = KStandardAction::redo(0, "", actionCollection());
+/*
//take a snapshot for this scene, used as the backdrop of the 2d view
const KIcon snapshotIcon("camera-photo");
KAction* snapshotAct = new KAction(snapshotIcon, i18n("Take Snapshot"), \
actionCollection()); snapshotAct->setToolTip(i18n("Take a snapshot as the backdrop \
for 2d view")); actionCollection()->addAction("kolf_take_snapshot", snapshotAct);
connect(snapshotAct, SIGNAL(triggered()), this, SLOT(actionSnapshot()));
+*/
}
bool Kolf::EditorGame::startGame()
--- trunk/playground/games/kolf-ng/engine/kolf-editorui.rc #995001:995002
@@ -10,7 +10,9 @@
<Separator/>
<Action name="edit_undo" />
<Action name="edit_redo" />
+ <!--
<Separator/>
<Action name="kolf_take_snapshot" />
+ -->
</ToolBar>
</gui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic