[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/astrododge
From: Rivo Laks <rivolaks () hot ! ee>
Date: 2009-07-18 17:46:50
Message-ID: 1247939210.915544.555.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 998939 by rivol:
Cleanup: remove obsolete files, comments, includes and other cruft.
Also updated copyright years in a few cases.
D data/shaders/asteroid.frag
D data/shaders/asteroid.vert
D data/shaders/object.frag
D data/shaders/object.vert
D data/shaders/ship.frag
D data/shaders/ship.vert
D data/shaders/space.frag
D data/shaders/space.vert
M +0 -1 src/CMakeLists.txt
M +5 -13 src/asteroid.cpp
M +2 -4 src/asteroid.h
M +2 -1 src/gameguiview.cpp
M +0 -7 src/gameguiview.h
M +1 -1 src/gameobject.cpp
M +0 -2 src/gameobject.h
M +1 -3 src/gameview.cpp
M +1 -26 src/gameworld.cpp
M +0 -22 src/gameworld.h
D src/inputhandler.cpp
D src/inputhandler.h
M +0 -1 src/loadingview.h
D src/lodinfowidget.cpp
D src/lodinfowidget.h
D src/lodinfowidget.ui
M +0 -12 src/main.cpp
M +1 -1 src/mainwindow.cpp
M +1 -1 src/model.cpp
M +1 -2 src/model.h
M +2 -3 src/ship.cpp
M +1 -1 src/ship.h
--- trunk/playground/games/astrododge/src/CMakeLists.txt #998938:998939
@@ -18,7 +18,6 @@
shadermanager.cpp
ship.cpp
)
-kde4_add_ui_files(astrododge_SRCS lodinfowidget.ui)
kde4_add_executable(astrododge ${astrododge_SRCS})
target_link_libraries(astrododge ${KDE4_KDEUI_LIBS} ${KGLLIB_LIBRARY} \
${KGLLIB_EXTRAS_LIBRARY} ${ODE_LIBRARIES} ${KDEGAMES_LIBRARY})
--- trunk/playground/games/astrododge/src/asteroid.cpp #998938:998939
@@ -17,19 +17,11 @@
#include "asteroid.h"
-#include "mymath.h"
#include "model.h"
-#include <QStringList>
-#include <QDir>
-#include <QFile>
-#include <QDataStream>
-
#include <kgllib/kgllib.h>
#include <kgllib/mesh.h>
-#include <iostream>
-using namespace std;
using namespace KGLLib;
@@ -38,12 +30,12 @@
mModel = 0;
mModelScale = radius;
- collVertexData = 0;
+ mCollVertexData = 0;
}
Asteroid::~Asteroid()
{
- delete[] collVertexData;
+ delete[] mCollVertexData;
}
void Asteroid::setModel(Model* model)
@@ -51,10 +43,10 @@
mModel = model;
Batch* collisionmesh = model->collisionMesh();
const Vector3f* originalVertices = reinterpret_cast<const \
Vector3f*>(collisionmesh->verticesArray());
- collVertexData = new Vector3f[collisionmesh->vertexCount()];
+ mCollVertexData = new Vector3f[collisionmesh->vertexCount()];
for (unsigned int i = 0; i < collisionmesh->vertexCount(); i++) {
- collVertexData[i] = originalVertices[i] * radius;
+ mCollVertexData[i] = originalVertices[i] * radius;
}
- createGeomFromMesh(collVertexData, collisionmesh->vertexCount(),
+ createGeomFromMesh(mCollVertexData, collisionmesh->vertexCount(),
reinterpret_cast<const unsigned \
int*>(collisionmesh->indicesArray()), collisionmesh->indicesCount()); }
--- trunk/playground/games/astrododge/src/asteroid.h #998938:998939
@@ -34,10 +34,8 @@
virtual Type type() const { return T_Asteroid; }
virtual void setModel(Model* m);
- // This data is specific to a single object
- int modelId;
-
- Vector3f* collVertexData;
+protected:
+ Vector3f* mCollVertexData;
};
#endif
--- trunk/playground/games/astrododge/src/gameguiview.cpp #998938:998939
@@ -27,7 +27,9 @@
#include <QFont>
#include <KDebug>
+using namespace KGLLib;
+
class GLMeter
{
public:
@@ -213,7 +215,6 @@
mSpeedoMeter->render();
textRenderer()->begin(glWidget());
- textRenderer()->draw(glWidget()->rect(), "Hi! I'm GameGUIView", Qt::AlignBottom \
| Qt::AlignHCenter, QFont("Arial", 16));
// Render health
QFont healthfont("Arial", 14);
--- trunk/playground/games/astrododge/src/gameguiview.h #998938:998939
@@ -20,17 +20,10 @@
#include "glview.h"
-#include <QRectF>
-
class GameWorld;
class GLMeter;
-namespace KGLLib
-{
- class Texture;
-}
-
class GameGUIView : public GLView
{
Q_OBJECT
--- trunk/playground/games/astrododge/src/gameobject.cpp #998938:998939
@@ -22,7 +22,7 @@
#include <Eigen/Geometry>
-#include <kgllib/mesh.h>
+#include <kgllib/batch.h>
#include <KDebug>
--- trunk/playground/games/astrododge/src/gameobject.h #998938:998939
@@ -21,8 +21,6 @@
#include <Eigen/Core>
#include <ode/ode.h>
-#include <QList>
-
class Model;
using namespace Eigen;
--- trunk/playground/games/astrododge/src/gameview.cpp #998938:998939
@@ -36,7 +36,6 @@
#include <KDebug>
#include <KStandardDirs>
#include <QTimer>
-#include "planet.h"
using namespace KGLLib;
@@ -93,7 +92,7 @@
mWorld->advance(elapsed);
// Clear buffers
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glClear(GL_DEPTH_BUFFER_BIT);
// Set up matrices
glMatrixMode(GL_PROJECTION);
@@ -117,7 +116,6 @@
renderObjects(mWorld->objects());
// Light passes
- KGLLib::checkGLError("Before light passes state setup");
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glDepthMask(GL_FALSE);
--- trunk/playground/games/astrododge/src/gameworld.cpp #998938:998939
@@ -20,28 +20,19 @@
#include "ship.h"
#include "asteroid.h"
#include "mymath.h"
-#include "inputhandler.h"
#include "bullet.h"
#include "model.h"
#include "planet.h"
#include "datastore.h"
-#include <kgllib/texture.h>
-#include <kgllib/program.h>
-#include <kgllib/mesh.h>
-#include <kgllib/modelloader.h>
-#include <kgllib/geometrybuffer.h>
#include <kgllib/shapes.h>
+#include <kgllib/mesh.h>
#include <KDebug>
#include <KConfig>
#include <KConfigGroup>
-#include <QtDebug>
-#include <QTime>
-#include <QDir>
-
int GameWorld::mCollisionCandidatesWithDups = 0;
int GameWorld::mCollisionCandidates = 0;
int GameWorld::mCollisions = 0;
@@ -90,10 +81,6 @@
mData = data;
mDataDir = data->dataDir();
-// mInput = input;
-// connect(mInput, SIGNAL(signalRotateShip(int, int)), this, \
SLOT(slotRotateShip(int, int)));
-// connect(mInput, SIGNAL(signalToggleGamePaused()), this, \
SLOT(slotToggleGamePaused()));
-
mGamePaused = false;
mTime = 0.0f;
mTrackActive = false;
@@ -116,12 +103,6 @@
mTrackTime += elapsed;
}
applyShipRotation(elapsed);
-// if (mInput->accelerateShip()) {
-// Vector3f randomforce(randFloat(-0.1, 0.1), randFloat(-0.1, 0.1), \
randFloat(-0.1, 0.1));
-// mShip->addForce((mShip->direction() + randomforce) * \
mShip->acceleration);
-// }
- mShip->setVelocity(mShip->velocity() * powf(0.60f, elapsed));
-// mShip->position += mShip->velocity * elapsed;
mCollisions = 0;
mCollisionCandidates = 0;
@@ -148,10 +129,6 @@
processTrackPoints();
}
mTime += elapsed;
-
-// if (mInput->shootBullets()) {
-// slotShootBullet();
-// }
}
void GameWorld::handleCollisionBetween(dGeomID o1, dGeomID o2)
@@ -308,8 +285,6 @@
// a->rotation = Vector3f(randFloat(0, 360), randFloat(0, 360), randFloat(0, \
360));
-
-
addObject(a);
}
}
--- trunk/playground/games/astrododge/src/gameworld.h #998938:998939
@@ -20,35 +20,19 @@
#include <QObject>
#include <QList>
-#include <QHash>
-#include <QVector>
-#include "mymath.h"
#include "gameobject.h"
-
#include <ode/ode.h>
class Ship;
class Asteroid;
class Bullet;
-class InputHandler;
class Model;
class Planet;
class DataStore;
-class OctreeNode;
-namespace KGLLib
-{
-class Program;
-class Texture;
-class Mesh;
-class GeometryBuffer;
-}
-
-using namespace KGLLib;
-
/**
* @author Rivo Laks <rivolaks@hot.ee>
*/
@@ -100,11 +84,6 @@
void slotShootBullet();
-signals:
- void updateLoadingProgress(const QString& msg, float progress);
- void setLoadingError(const QString& msg);
-
-
protected:
void applyShipRotation(float elapsed);
@@ -118,7 +97,6 @@
class OdeContactFeedback;
static GameWorld* mInstance;
-// InputHandler* mInput;
Ship* mShip;
QList<GameObject*> mObjects;
--- trunk/playground/games/astrododge/src/loadingview.h #998938:998939
@@ -30,7 +30,6 @@
class QDomElement;
class GameWorld;
class GameObject;
-class Model;
namespace KGLLib
{
--- trunk/playground/games/astrododge/src/main.cpp #998938:998939
@@ -31,7 +31,6 @@
about.addAuthor(ki18n("Rivo Laks"), ki18n("Author"), "rivolaks@hot.ee");
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
- options.add("fast", ki18n("Fast rendering mode (e.g. no HDR)"));
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
@@ -40,17 +39,6 @@
MainWindow* window = new MainWindow();
- KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
- /*if (args->isSet("norender")) {
- window->slotToggleRenderWorld();
- }
- if (args->isSet("noloaddata")) {
- window->setLoadData(false);
- }*/
-// if (args->isSet("fast")) {
-// window->setFastMode(true);
-// }
-
window->show();
return app.exec();
}
--- trunk/playground/games/astrododge/src/mainwindow.cpp #998938:998939
@@ -54,7 +54,7 @@
setCentralWidget(mDisplay->proxy());
// Find where our data is
- QString datadir = KGlobal::dirs()->findResourceDir("appdata", \
"shaders/space.frag"); + QString datadir = \
KGlobal::dirs()->findResourceDir("appdata", "shaders/render-light.frag"); if \
(datadir.isEmpty()) {
KMessageBox::error(0, "Data directory could not be found!\nMake sure that \
you have properly installed AstroDodge.", "Data not found");
--- trunk/playground/games/astrododge/src/model.cpp #998938:998939
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Rivo Laks <rivolaks@hot.ee>
+ * Copyright 2008-2009 Rivo Laks <rivolaks@hot.ee>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
--- trunk/playground/games/astrododge/src/model.h #998938:998939
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Rivo Laks <rivolaks@hot.ee>
+ * Copyright 2008-2009 Rivo Laks <rivolaks@hot.ee>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -28,7 +28,6 @@
class ModelLoader;
class Batch;
class GeometryBuffer;
-class Program;
class Texture;
}
--- trunk/playground/games/astrododge/src/ship.cpp #998938:998939
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Rivo Laks <rivolaks@hot.ee>
+ * Copyright 2008-2009 Rivo Laks <rivolaks@hot.ee>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -62,9 +62,8 @@
float forceNorm = force.norm();
float damage = forceNorm / 1000.0f;
- kDebug() << "force:" << forceNorm << "= damage" << damage;
health = qMax(0.0f, health - damage);
- kDebug() << "health is now" << health;
+ kDebug() << "force:" << forceNorm << "= damage" << damage << "; health is now" \
<< health; }
void Ship::addRotation(const Vector3f& rot)
--- trunk/playground/games/astrododge/src/ship.h #998938:998939
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Rivo Laks <rivolaks@hot.ee>
+ * Copyright 2008-2009 Rivo Laks <rivolaks@hot.ee>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic