Merge branch 'dev' into dev-map

This commit is contained in:
Kayne Ruse
2013-06-24 09:23:12 +10:00
4 changed files with 19 additions and 16 deletions
@@ -19,7 +19,7 @@
* 3. This notice may not be removed or altered from any source
* distribution.
*/
#include "scene_manager.hpp"
#include "client_application.hpp"
#include <stdexcept>
#include <chrono>
@@ -40,15 +40,15 @@
//Public access members
//-------------------------
SceneManager::SceneManager() {
ClientApplication::ClientApplication() {
//
}
SceneManager::~SceneManager() {
ClientApplication::~ClientApplication() {
UnloadScene();
}
/* SceneManager::Init()
/* ClientApplication::Init()
* This function initializes the entire program. There are a number of things
* that could go wrong here, which is why there is such an unusual order of
* operations.
@@ -59,7 +59,7 @@ SceneManager::~SceneManager() {
* The ConfigUtility's call to Load() also ensures that the "rsc\" folder is in the directory. It's easy to forget it.
*/
void SceneManager::Init() {
void ClientApplication::Init() {
//load the config file
try {
configUtil->Load("rsc/config.cfg");
@@ -92,7 +92,7 @@ void SceneManager::Init() {
netUtil->Open(0, sizeof(Packet));
}
void SceneManager::Proc() {
void ClientApplication::Proc() {
LoadScene(SceneList::FIRST);
//prepare the time system
@@ -130,7 +130,7 @@ void SceneManager::Proc() {
UnloadScene();
}
void SceneManager::Quit() {
void ClientApplication::Quit() {
//clean up the singletons
netUtil->Close();
surfaceMgr->FreeAll();
@@ -147,7 +147,7 @@ void SceneManager::Quit() {
//Private access members
//-------------------------
void SceneManager::LoadScene(SceneList sceneIndex) {
void ClientApplication::LoadScene(SceneList sceneIndex) {
UnloadScene();
switch(sceneIndex) {
@@ -177,7 +177,7 @@ void SceneManager::LoadScene(SceneList sceneIndex) {
}
}
void SceneManager::UnloadScene() {
void ClientApplication::UnloadScene() {
delete activeScene;
activeScene = nullptr;
}
@@ -19,8 +19,8 @@
* 3. This notice may not be removed or altered from any source
* distribution.
*/
#ifndef SCENEMANAGER_HPP_
#define SCENEMANAGER_HPP_
#ifndef CLIENTAPPLICATION_HPP_
#define CLIENTAPPLICATION_HPP_
#include "scene_list.hpp"
#include "base_scene.hpp"
@@ -34,16 +34,18 @@
#include "SDL/SDL.h"
class SceneManager {
class ClientApplication {
public:
/* Public access members */
SceneManager();
~SceneManager();
ClientApplication();
~ClientApplication();
void Init();
void Proc();
void Quit();
ClientApplication(ClientApplication const&) = delete;
ClientApplication(ClientApplication const&&) = delete;
private:
/* Private access members */
void LoadScene(SceneList sceneIndex);
+2 -2
View File
@@ -19,7 +19,7 @@
* 3. This notice may not be removed or altered from any source
* distribution.
*/
#include "scene_manager.hpp"
#include "client_application.hpp"
#include <stdexcept>
#include <iostream>
@@ -31,7 +31,7 @@ int main(int, char**) {
cout << "Beginning program" << endl;
#endif
try {
SceneManager app;
ClientApplication app;
app.Init();
app.Proc();
app.Quit();
+1
View File
@@ -68,6 +68,7 @@ public:
void Quit();
ServerApplication(ServerApplication const&) = delete;
ServerApplication(ServerApplication const&&) = delete;
private:
//game loop
void UpdateWorld(double delta);