mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 19:29:47 +02:00
Fixed the god-awful indentation
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
#define _SHADER_G3DVIEWER_MAIN_H_
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h>
|
||||
#include <winsock.h>
|
||||
#include <winsock2.h>
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
@@ -32,203 +32,208 @@
|
||||
using std::string;
|
||||
using namespace Glest::Game;
|
||||
|
||||
namespace Shared{ namespace G3dViewer{
|
||||
namespace Shared {
|
||||
namespace G3dViewer {
|
||||
|
||||
class GlCanvas;
|
||||
class GlCanvas;
|
||||
|
||||
// ===============================
|
||||
// class MainWindow
|
||||
// ===============================
|
||||
// ===============================
|
||||
// class MainWindow
|
||||
// ===============================
|
||||
|
||||
class MainWindow: public wxFrame{
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
class MainWindow : public wxFrame {
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
public:
|
||||
static const string versionString;
|
||||
static const string winHeader;
|
||||
public:
|
||||
static const string versionString;
|
||||
static const string winHeader;
|
||||
|
||||
enum MenuId{
|
||||
miFileLoad,
|
||||
miFileLoadParticleXML,
|
||||
miFileLoadProjectileParticleXML,
|
||||
miFileLoadSplashParticleXML,
|
||||
miFileClearAll,
|
||||
miFileToggleScreenshotTransparent,
|
||||
miFileSaveScreenshot,
|
||||
miModeWireframe,
|
||||
miModeNormals,
|
||||
miModeGrid,
|
||||
miSpeedSlower,
|
||||
miSpeedFaster,
|
||||
miRestart,
|
||||
miChangeBackgroundColor,
|
||||
miColorRed,
|
||||
miColorBlue,
|
||||
miColorGreen,
|
||||
miColorYellow,
|
||||
miColorWhite,
|
||||
miColorCyan,
|
||||
miColorOrange,
|
||||
miColorMagenta
|
||||
};
|
||||
enum MenuId {
|
||||
miFileLoad,
|
||||
miFileLoadParticleXML,
|
||||
miFileLoadProjectileParticleXML,
|
||||
miFileLoadSplashParticleXML,
|
||||
miFileClearAll,
|
||||
miFileToggleScreenshotTransparent,
|
||||
miFileSaveScreenshot,
|
||||
miModeWireframe,
|
||||
miModeNormals,
|
||||
miModeGrid,
|
||||
miSpeedSlower,
|
||||
miSpeedFaster,
|
||||
miRestart,
|
||||
miChangeBackgroundColor,
|
||||
miColorRed,
|
||||
miColorBlue,
|
||||
miColorGreen,
|
||||
miColorYellow,
|
||||
miColorWhite,
|
||||
miColorCyan,
|
||||
miColorOrange,
|
||||
miColorMagenta
|
||||
};
|
||||
|
||||
private:
|
||||
GlCanvas *glCanvas;
|
||||
Renderer *renderer;
|
||||
private:
|
||||
GlCanvas *glCanvas;
|
||||
Renderer *renderer;
|
||||
|
||||
wxTimer *timer;
|
||||
wxTimer *timer;
|
||||
|
||||
wxMenuBar *menu;
|
||||
wxMenu *menuFile;
|
||||
wxMenu *menuMode;
|
||||
wxMenu *menuSpeed;
|
||||
wxMenu *menuCustomColor;
|
||||
wxFileDialog *fileDialog;
|
||||
wxMenuBar *menu;
|
||||
wxMenu *menuFile;
|
||||
wxMenu *menuMode;
|
||||
wxMenu *menuSpeed;
|
||||
wxMenu *menuCustomColor;
|
||||
wxFileDialog *fileDialog;
|
||||
|
||||
wxColourDialog *colorPicker;
|
||||
wxColourDialog *colorPicker;
|
||||
|
||||
Model *model;
|
||||
Model *model;
|
||||
|
||||
std::pair<string,vector<string> > unitPath;
|
||||
std::vector<string> modelPathList;
|
||||
std::vector<string> particlePathList;
|
||||
std::vector<string> particleProjectilePathList;
|
||||
std::vector<string> particleSplashPathList; // as above
|
||||
std::pair<string, vector<string> > unitPath;
|
||||
std::vector<string> modelPathList;
|
||||
std::vector<string> particlePathList;
|
||||
std::vector<string> particleProjectilePathList;
|
||||
std::vector<string> particleSplashPathList; // as above
|
||||
|
||||
bool resetAnimation;
|
||||
float resetAnim;
|
||||
int resetParticleLoopStart;
|
||||
bool resetAnimation;
|
||||
float resetAnim;
|
||||
int resetParticleLoopStart;
|
||||
|
||||
float speed;
|
||||
float anim;
|
||||
float lastanim;
|
||||
int particleLoopStart;
|
||||
float rotX, rotY, zoom;
|
||||
float backBrightness, gridBrightness, lightBrightness;
|
||||
int lastX, lastY;
|
||||
Renderer::PlayerColor playerColor;
|
||||
bool initTextureManager;
|
||||
float speed;
|
||||
float anim;
|
||||
float lastanim;
|
||||
int particleLoopStart;
|
||||
float rotX, rotY, zoom;
|
||||
float backBrightness, gridBrightness, lightBrightness;
|
||||
int lastX, lastY;
|
||||
Renderer::PlayerColor playerColor;
|
||||
bool initTextureManager;
|
||||
|
||||
std::vector<UnitParticleSystemType *> unitParticleSystemTypes;
|
||||
std::vector<UnitParticleSystem *> unitParticleSystems;
|
||||
std::vector<UnitParticleSystemType *> unitParticleSystemTypes;
|
||||
std::vector<UnitParticleSystem *> unitParticleSystems;
|
||||
|
||||
std::vector<ParticleSystemTypeProjectile *> projectileParticleSystemTypes;
|
||||
std::vector<ProjectileParticleSystem *> projectileParticleSystems;
|
||||
std::vector<ParticleSystemTypeSplash *> splashParticleSystemTypes; // as above
|
||||
std::vector<SplashParticleSystem *> splashParticleSystems;
|
||||
string statusbarText;
|
||||
std::vector<ParticleSystemTypeProjectile *> projectileParticleSystemTypes;
|
||||
std::vector<ProjectileParticleSystem *> projectileParticleSystems;
|
||||
std::vector<ParticleSystemTypeSplash *> splashParticleSystemTypes; // as above
|
||||
std::vector<SplashParticleSystem *> splashParticleSystems;
|
||||
string statusbarText;
|
||||
|
||||
bool isControlKeyPressed;
|
||||
bool isControlKeyPressed;
|
||||
|
||||
string appPath;
|
||||
string appPath;
|
||||
|
||||
bool startupSettingsInited;
|
||||
bool startupSettingsInited;
|
||||
|
||||
void initGlCanvas();
|
||||
void loadUnit(string path, string skillName);
|
||||
void loadModel(string path);
|
||||
void loadParticle(string path);
|
||||
void loadProjectileParticle(string path);
|
||||
void loadSplashParticle(string path);
|
||||
void initGlCanvas();
|
||||
void loadUnit(string path, string skillName);
|
||||
void loadModel(string path);
|
||||
void loadParticle(string path);
|
||||
void loadProjectileParticle(string path);
|
||||
void loadSplashParticle(string path);
|
||||
|
||||
void saveScreenshot();
|
||||
void saveScreenshot();
|
||||
|
||||
public:
|
||||
MainWindow( std::pair<string,vector<string> > unitToLoad,
|
||||
const string modelPath,const string particlePath,
|
||||
const string projectileParticlePath,const string splashParticlePath,
|
||||
float defaultAnimation,int defaultParticleLoopStart,
|
||||
float defaultZoom,float defaultXRot, float defaultYRot,
|
||||
public:
|
||||
MainWindow(std::pair<string, vector<string> > unitToLoad,
|
||||
const string modelPath, const string particlePath,
|
||||
const string projectileParticlePath, const string splashParticlePath,
|
||||
float defaultAnimation, int defaultParticleLoopStart,
|
||||
float defaultZoom, float defaultXRot, float defaultYRot,
|
||||
string appPath);
|
||||
~MainWindow();
|
||||
void init();
|
||||
~MainWindow();
|
||||
void init();
|
||||
|
||||
void Notify();
|
||||
void Notify();
|
||||
|
||||
void onPaint(wxPaintEvent &event);
|
||||
void onClose(wxCloseEvent &event);
|
||||
void onMenuFileLoad(wxCommandEvent &event);
|
||||
void onMenuFileLoadParticleXML(wxCommandEvent &event);
|
||||
void onMenuFileLoadProjectileParticleXML(wxCommandEvent &event);
|
||||
void onMenuFileLoadSplashParticleXML(wxCommandEvent &event);
|
||||
void onMenuFileClearAll(wxCommandEvent &event);
|
||||
void onMenumFileToggleScreenshotTransparent(wxCommandEvent &event);
|
||||
void onMenuFileSaveScreenshot(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 OnChangeColor(wxCommandEvent &event);
|
||||
void onMenuColorRed(wxCommandEvent &event);
|
||||
void onMenuColorBlue(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);
|
||||
void onPaint(wxPaintEvent &event);
|
||||
void onClose(wxCloseEvent &event);
|
||||
void onMenuFileLoad(wxCommandEvent &event);
|
||||
void onMenuFileLoadParticleXML(wxCommandEvent &event);
|
||||
void onMenuFileLoadProjectileParticleXML(wxCommandEvent &event);
|
||||
void onMenuFileLoadSplashParticleXML(wxCommandEvent &event);
|
||||
void onMenuFileClearAll(wxCommandEvent &event);
|
||||
void onMenumFileToggleScreenshotTransparent(wxCommandEvent &event);
|
||||
void onMenuFileSaveScreenshot(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 OnChangeColor(wxCommandEvent &event);
|
||||
void onMenuColorRed(wxCommandEvent &event);
|
||||
void onMenuColorBlue(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);
|
||||
|
||||
void onKeyDown(wxKeyEvent &e);
|
||||
void onKeyDown(wxKeyEvent &e);
|
||||
|
||||
string getModelInfo();
|
||||
string getModelInfo();
|
||||
|
||||
void setupTimer();
|
||||
void setupStartupSettings();
|
||||
};
|
||||
void setupTimer();
|
||||
void setupStartupSettings();
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class GlCanvas
|
||||
// =====================================================
|
||||
// =====================================================
|
||||
// class GlCanvas
|
||||
// =====================================================
|
||||
|
||||
class GlCanvas: public wxGLCanvas {
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
class GlCanvas : public wxGLCanvas {
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
public:
|
||||
GlCanvas(MainWindow *mainWindow, int *args);
|
||||
~GlCanvas();
|
||||
public:
|
||||
GlCanvas(MainWindow *mainWindow, int *args);
|
||||
~GlCanvas();
|
||||
|
||||
void onMouseWheel(wxMouseEvent &event);
|
||||
void onMouseMove(wxMouseEvent &event);
|
||||
void onPaint(wxPaintEvent &event);
|
||||
void onKeyDown(wxKeyEvent &event);
|
||||
void OnSize(wxSizeEvent&);
|
||||
void setCurrentGLContext();
|
||||
void onMouseWheel(wxMouseEvent &event);
|
||||
void onMouseMove(wxMouseEvent &event);
|
||||
void onPaint(wxPaintEvent &event);
|
||||
void onKeyDown(wxKeyEvent &event);
|
||||
void OnSize(wxSizeEvent&);
|
||||
void setCurrentGLContext();
|
||||
|
||||
wxGLContext * getCtx() { return context; }
|
||||
private:
|
||||
MainWindow *mainWindow;
|
||||
wxGLContext *context;
|
||||
};
|
||||
wxGLContext * getCtx() {
|
||||
return context;
|
||||
}
|
||||
private:
|
||||
MainWindow *mainWindow;
|
||||
wxGLContext *context;
|
||||
};
|
||||
|
||||
|
||||
// ===============================
|
||||
// class App
|
||||
// ===============================
|
||||
// ===============================
|
||||
// class App
|
||||
// ===============================
|
||||
|
||||
class App: public wxApp{
|
||||
private:
|
||||
MainWindow *mainWindow;
|
||||
class App : public wxApp {
|
||||
private:
|
||||
MainWindow *mainWindow;
|
||||
|
||||
public:
|
||||
App() : wxApp() {
|
||||
mainWindow = NULL;
|
||||
}
|
||||
virtual ~App() {
|
||||
}
|
||||
virtual bool OnInit();
|
||||
virtual int MainLoop();
|
||||
virtual int OnExit();
|
||||
};
|
||||
|
||||
public:
|
||||
App() : wxApp() {
|
||||
mainWindow = NULL;
|
||||
}
|
||||
virtual ~App() {}
|
||||
virtual bool OnInit();
|
||||
virtual int MainLoop();
|
||||
virtual int OnExit();
|
||||
};
|
||||
|
||||
}}//end namespace
|
||||
}//end namespace
|
||||
|
||||
DECLARE_APP(Shared::G3dViewer::App)
|
||||
|
||||
|
Reference in New Issue
Block a user