- updates from notsogood to add more player colors and splash particles and memory cleanup to G3d Viewer (thanks notsogood!)

This commit is contained in:
Mark Vejvoda
2010-11-03 19:03:25 +00:00
parent 6b015964bb
commit ea27375b6f
4 changed files with 445 additions and 184 deletions

View File

@@ -3,8 +3,8 @@
#include <string>
#include <wx/wx.h>
#include <wx/glcanvas.h>
#include <wx/wx.h>
#include <wx/glcanvas.h>
#include "renderer.h"
#include "util.h"
@@ -34,16 +34,22 @@ public:
miFileLoad,
miFileLoadParticleXML,
miFileLoadProjectileParticleXML,
miFileLoadSplashParticleXML,
miFileClearAll,
miModeWireframe,
miModeNormals,
miModeGrid,
miSpeedSlower,
miSpeedFaster,
miRestart,
miColorRed,
miColorBlue,
miColorGreen,
miColorYellow,
miColorGreen
miColorWhite,
miColorCyan,
miColorOrange,
miColorMagenta
};
private:
@@ -63,6 +69,7 @@ private:
std::vector<string> modelPathList;
std::vector<string> particlePathList;
std::vector<string> particleProjectilePathList;
std::vector<string> particleSplashPathList; // as above
float speed;
float anim;
@@ -75,15 +82,18 @@ private:
std::vector<ParticleSystemTypeProjectile *> projectileParticleSystemTypes;
std::vector<ProjectileParticleSystem *> projectileParticleSystems;
std::vector<ParticleSystemTypeSplash *> splashParticleSystemTypes; // as above
std::vector<SplashParticleSystem *> splashParticleSystems;
bool isControlKeyPressed;
void loadModel(string path);
void loadParticle(string path);
void loadProjectileParticle(string path);
void loadSplashParticle(string path);
public:
MainWindow(const string &modelPath);
~MainWindow();
~MainWindow();
void init();
void Notify();
@@ -93,16 +103,25 @@ public:
void onMenuFileLoad(wxCommandEvent &event);
void onMenuFileLoadParticleXML(wxCommandEvent &event);
void onMenuFileLoadProjectileParticleXML(wxCommandEvent &event);
void onMenuFileLoadSplashParticleXML(wxCommandEvent &event);
void onMenuFileClearAll(wxCommandEvent &event);
void onMenuFileExit(wxCommandEvent &event);
void onMenuModeNormals(wxCommandEvent &event);
void onMenuModeWireframe(wxCommandEvent &event);
void onMenuModeGrid(wxCommandEvent &event);
void onMenuSpeedSlower(wxCommandEvent &event);
void onMenuSpeedFaster(wxCommandEvent &event);
void onMenuRestart(wxCommandEvent &event);
void onMenuColorRed(wxCommandEvent &event);
void onMenuColorBlue(wxCommandEvent &event);
void onMenuColorYellow(wxCommandEvent &event);
void onMenuColorGreen(wxCommandEvent &event);
void onMenuColorYellow(wxCommandEvent &event);
void onMenuColorWhite(wxCommandEvent &event);
void onMenuColorCyan(wxCommandEvent &event);
void onMenuColorOrange(wxCommandEvent &event);
void onMenuColorMagenta(wxCommandEvent &event);
void onMouseWheelDown(wxMouseEvent &event);
void onMouseWheelUp(wxMouseEvent &event);
void onMouseMove(wxMouseEvent &event);
void onTimer(wxTimerEvent &event);
@@ -114,22 +133,24 @@ public:
// =====================================================
// class GlCanvas
// =====================================================
class GlCanvas: public wxGLCanvas {
private:
DECLARE_EVENT_TABLE()
public:
GlCanvas(MainWindow *mainWindow);
void onMouseMove(wxMouseEvent &event);
class GlCanvas: public wxGLCanvas {
private:
DECLARE_EVENT_TABLE()
public:
GlCanvas(MainWindow *mainWindow);
void onMouseWheel(wxMouseEvent &event);
void onMouseMove(wxMouseEvent &event);
void onPaint(wxPaintEvent &event);
void onKeyDown(wxKeyEvent &event);
private:
MainWindow *mainWindow;
};
void onKeyDown(wxKeyEvent &event);
private:
MainWindow *mainWindow;
};
// ===============================
// class App