summaryrefslogtreecommitdiffstats
path: root/engine/flatland.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine/flatland.cpp')
-rw-r--r--engine/flatland.cpp57
1 files changed, 1 insertions, 56 deletions
diff --git a/engine/flatland.cpp b/engine/flatland.cpp
index 306d094..f761473 100644
--- a/engine/flatland.cpp
+++ b/engine/flatland.cpp
@@ -8,6 +8,7 @@
#include <ctime>
using namespace std;
+using namespace flat;
#include "core/task.hpp"
#include "core/signal.hpp"
@@ -20,7 +21,6 @@ float flatland_dt;
set<flat::core::object*> objects;
FlatWindow * window = 0;
-SignalChannel * core = 0;
gameloop loop_function;
@@ -57,33 +57,10 @@ uint32_t status_to_flags(const flat_status& s)
return flags;
}
-/* Listen to simple quit calls */
-class QuitListener : public FlatListener
-{
- virtual void callback(flat::core::object*, void*) override
- {
- /* Order to quit */
- quit_flatland();
- }
-
-public:
-
- QuitListener()
- {
- addFilter("quit");
- core->connect(this);
- }
-};
-
int init_flatland(FlatWindow* w, gameloop loop, const flat_status& s, float _fps)
{
cout << "Flatland: Initializing flatland" << endl;
- // Init core channel
-
- core = new SignalChannel("core");
- QuitListener quitter;
-
// init variables
cout << "Flatland: Initializing window" << endl;
@@ -130,17 +107,6 @@ int init_flatland(FlatWindow* w, gameloop loop, const flat_status& s, float _fps
try {
try {
-
- /* Execute tasks */
- task_s::executePreProcess();
-
- } catch (const exception &e) {
-
- cerr << "Flatland: exception thrown while executing pre-process tasks" << endl;
- cerr << e.what() << endl;
- }
-
- try {
/* Execute loop function */
loop_function(flatland_dt);
@@ -150,17 +116,6 @@ int init_flatland(FlatWindow* w, gameloop loop, const flat_status& s, float _fps
cerr << "Flatland: exception thrown while executing loop" << endl;
cerr << e.what() << endl;
}
-
- try {
-
- /* Execute tasks */
- task_s::executePostProcess();
-
- } catch (const exception &e) {
-
- cerr << "Flatland: exception thrown while executing post-process tasks" << endl;
- cerr << e.what() << endl;
- }
} catch (const ForceQuit& f) {
@@ -184,11 +139,6 @@ int init_flatland(FlatWindow* w, gameloop loop, const flat_status& s, float _fps
window->close();
- cout << "Flatland: destroying core channel" << endl;
-
- delete core;
- core = 0;
-
cout << "Flatland: quitting SDL" << endl;
SDL_Quit();
@@ -207,8 +157,3 @@ flat_status flatland_status()
return status;
}
-SignalChannel * getCoreChannel()
-{
- return core;
-}
-