Changed the name of the editor's main class

This commit is contained in:
Kayne Ruse
2013-06-24 09:26:25 +10:00
parent 09c88c7232
commit c1d03d1cef
3 changed files with 17 additions and 15 deletions
@@ -19,7 +19,7 @@
* 3. This notice may not be removed or altered from any source * 3. This notice may not be removed or altered from any source
* distribution. * distribution.
*/ */
#include "scene_manager.hpp" #include "editor_application.hpp"
#include <stdexcept> #include <stdexcept>
#include <chrono> #include <chrono>
@@ -35,22 +35,22 @@
//Public access members //Public access members
//------------------------- //-------------------------
SceneManager::SceneManager() { EditorApplication::EditorApplication() {
// //
} }
SceneManager::~SceneManager() { EditorApplication::~EditorApplication() {
UnloadScene(); UnloadScene();
} }
void SceneManager::Init() { void EditorApplication::Init() {
if (SDL_Init(SDL_INIT_VIDEO)) if (SDL_Init(SDL_INIT_VIDEO))
throw(std::runtime_error("Failed to initialize SDL")); throw(std::runtime_error("Failed to initialize SDL"));
BaseScene::SetScreen(800, 600); BaseScene::SetScreen(800, 600);
} }
void SceneManager::Proc() { void EditorApplication::Proc() {
LoadScene(SceneList::FIRST); LoadScene(SceneList::FIRST);
//prepare the time system //prepare the time system
@@ -88,7 +88,7 @@ void SceneManager::Proc() {
UnloadScene(); UnloadScene();
} }
void SceneManager::Quit() { void EditorApplication::Quit() {
UnloadScene(); UnloadScene();
SDL_Quit(); SDL_Quit();
} }
@@ -97,7 +97,7 @@ void SceneManager::Quit() {
//Private access members //Private access members
//------------------------- //-------------------------
void SceneManager::LoadScene(SceneList sceneIndex) { void EditorApplication::LoadScene(SceneList sceneIndex) {
UnloadScene(); UnloadScene();
switch(sceneIndex) { switch(sceneIndex) {
@@ -112,7 +112,7 @@ void SceneManager::LoadScene(SceneList sceneIndex) {
} }
} }
void SceneManager::UnloadScene() { void EditorApplication::UnloadScene() {
delete activeScene; delete activeScene;
activeScene = nullptr; activeScene = nullptr;
} }
@@ -19,24 +19,26 @@
* 3. This notice may not be removed or altered from any source * 3. This notice may not be removed or altered from any source
* distribution. * distribution.
*/ */
#ifndef SCENEMANAGER_HPP_ #ifndef EDITORAPPLICATION_HPP_
#define SCENEMANAGER_HPP_ #define EDITORAPPLICATION_HPP_
#include "scene_list.hpp" #include "scene_list.hpp"
#include "base_scene.hpp" #include "base_scene.hpp"
#include "SDL/SDL.h" #include "SDL/SDL.h"
class SceneManager { class EditorApplication {
public: public:
/* Public access members */ /* Public access members */
SceneManager(); EditorApplication();
~SceneManager(); ~EditorApplication();
void Init(); void Init();
void Proc(); void Proc();
void Quit(); void Quit();
EditorApplication(EditorApplication const&) = delete;
EditorApplication(EditorApplication const&&) = delete;
private: private:
/* Private access members */ /* Private access members */
void LoadScene(SceneList sceneIndex); void LoadScene(SceneList sceneIndex);
+2 -2
View File
@@ -19,7 +19,7 @@
* 3. This notice may not be removed or altered from any source * 3. This notice may not be removed or altered from any source
* distribution. * distribution.
*/ */
#include "scene_manager.hpp" #include "editor_application.hpp"
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
@@ -31,7 +31,7 @@ int main(int, char**) {
cout << "Beginning program" << endl; cout << "Beginning program" << endl;
#endif #endif
try { try {
SceneManager app; EditorApplication app;
app.Init(); app.Init();
app.Proc(); app.Proc();
app.Quit(); app.Quit();