[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/kolf-ng/elements
From: Stefan Majewsky <majewsky () gmx ! net>
Date: 2009-07-31 21:30:03
Message-ID: 1249075803.362369.27609.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1005365 by majewsky:
Add a new Kolf::ObjectList that will hopefully simplify some future code.
M +0 -16 object.h
M +16 -0 objectfactory.h
A objectlist.h [License: GPL (v2+)]
M +1 -1 scene.cpp
M +4 -3 scene.h
--- trunk/playground/games/kolf-ng/elements/object.h #1005364:1005365
@@ -22,7 +22,6 @@
#include <QColor>
#include <QGraphicsItem>
#include <QObject>
-#include <QStringList>
#include "geometry.h"
#include "math-pointf.h"
@@ -153,19 +152,4 @@
Q_DECLARE_OPERATORS_FOR_FLAGS(Kolf::Object::SimulationFlags)
-/**
- * \def BIND_KOLF_OBJECT
- * \relates Kolf::Object
- *
- * Binds a Kolf::Object subclass with the Kolf::ObjectFactory to make it visible to \
the game engine. For any Kolf::Object subclass, you will have to use this macro in \
the implementation file (.cpp extension) in the following pattern:
- * \code
- * BIND_KOLF_OBJECT(Kolf::MyObject)
- * \endcode
- */
-#define BIND_KOLF_OBJECT(T) \
- namespace { \
- const char __kolf_current_class[] = #T; \
- Kolf::ObjectFactoryBinder __kolf_factory_binder(__kolf_current_class, \
&Kolf::ObjectFactoryBinder::create<T>); \
- }
-
#endif // KOLF_OBJECT_H
--- trunk/playground/games/kolf-ng/elements/objectfactory.h #1005364:1005365
@@ -56,4 +56,20 @@
};
}
+/**
+ * \def BIND_KOLF_OBJECT
+ * \relates Kolf::Object
+ * \relates Kolf::ObjectFactory
+ *
+ * Binds a Kolf::Object subclass with the Kolf::ObjectFactory to make it visible to \
the game engine. For any Kolf::Object subclass, you will have to use this macro in \
the implementation file (.cpp extension) in the following pattern: + * \code
+ * BIND_KOLF_OBJECT(Kolf::MyObject)
+ * \endcode
+ */
+#define BIND_KOLF_OBJECT(T) \
+ namespace { \
+ const char __kolf_current_class[] = #T; \
+ Kolf::ObjectFactoryBinder __kolf_factory_binder(__kolf_current_class, \
&Kolf::ObjectFactoryBinder::create<T>); \ + }
+
#endif // KOLF_OBJECTFACTORY_H
--- trunk/playground/games/kolf-ng/elements/scene.cpp #1005364:1005365
@@ -64,7 +64,7 @@
return m_balls;
}
-QList<Kolf::Object*> Kolf::Scene::objects() const
+Kolf::ObjectList Kolf::Scene::objects() const
{
return m_objects;
}
--- trunk/playground/games/kolf-ng/elements/scene.h #1005364:1005365
@@ -19,6 +19,8 @@
#ifndef KOLF_SCENE_H
#define KOLF_SCENE_H
+#include "objectlist.h"
+
#include <ode/common.h>
#include <QGraphicsScene>
@@ -27,7 +29,6 @@
class Ball;
class ManagedObject;
class ManagedObjectGroup;
- class Object;
class PhysicsEngine;
/**
@@ -47,7 +48,7 @@
dSpaceID spaceID() const;
QList<Kolf::Ball*> balls() const;
- QList<Kolf::Object*> objects() const;
+ Kolf::ObjectList objects() const;
Kolf::PhysicsEngine* physicsEngine() const;
Kolf::ManagedObjectGroup* objectGroup() const;
@@ -65,7 +66,7 @@
private:
dWorldID m_worldID;
dSpaceID m_spaceID;
- QList<Kolf::Object*> m_objects;
+ Kolf::ObjectList m_objects;
QList<Kolf::Ball*> m_balls;
//scene modules
Kolf::PhysicsEngine* m_physicsEngine;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic