diff options
author | ancarola <raffaele.ancarola@epfl.ch> | 2019-01-26 23:21:33 +0100 |
---|---|---|
committer | ancarola <raffaele.ancarola@epfl.ch> | 2019-01-26 23:21:33 +0100 |
commit | b04597405eaca00add8eddc7cb82518618c416d0 (patch) | |
tree | 5200cccf718b0dc2f567bcc8c3351a4b6f460176 /engine | |
parent | Fix signal template error (diff) | |
download | flatland-b04597405eaca00add8eddc7cb82518618c416d0.tar.gz flatland-b04597405eaca00add8eddc7cb82518618c416d0.zip |
Testing signal
Diffstat (limited to 'engine')
-rw-r--r-- | engine/flatland.cpp | 10 | ||||
-rw-r--r-- | engine/include/flatland.hpp | 2 | ||||
-rw-r--r-- | engine/serial.cpp | 2 | ||||
-rw-r--r-- | engine/signal.cpp | 9 |
4 files changed, 17 insertions, 6 deletions
diff --git a/engine/flatland.cpp b/engine/flatland.cpp index 62cdfd1..da0f58d 100644 --- a/engine/flatland.cpp +++ b/engine/flatland.cpp @@ -88,19 +88,19 @@ uint32_t status_to_flags(const flat_status& s) /* Accessors */ -core::channel& core_channel() +core::channel& flat::core_channel() { return core_chan; } -core::job& main_job() +core::job& flat::main_job() { return mainsync_job; } /* Main loop */ -int init_flatland(FlatWindow* w, const flat_status& s, float _fps) +int flat::init_flatland(FlatWindow* w, const flat_status& s, float _fps) { cout << "Flatland: Initializing flatland" << endl; @@ -218,13 +218,13 @@ int init_flatland(FlatWindow* w, const flat_status& s, float _fps) return status.error; } -void quit() +void flat::quit() { status.running = 0; status.loop = 0; } -flat_status flatland_status() +flat_status flat::flatland_status() { return status; } diff --git a/engine/include/flatland.hpp b/engine/include/flatland.hpp index 0ccf59c..f12dc65 100644 --- a/engine/include/flatland.hpp +++ b/engine/include/flatland.hpp @@ -61,7 +61,7 @@ flat_status flatland_status(); /* Window and status modifiers */ -void load_flatland_status(const flat_status&); +//void load_flatland_status(const flat_status&); } diff --git a/engine/serial.cpp b/engine/serial.cpp index b3218be..ad29f2f 100644 --- a/engine/serial.cpp +++ b/engine/serial.cpp @@ -93,6 +93,8 @@ const std::vector<SDL_Event>& SDL_EventCollector::getStack(uint32_t id) const // TODO other events } + + return user; } SDL_EventCollector * FlatSerial::collector = new SDL_EventCollector(); diff --git a/engine/signal.cpp b/engine/signal.cpp index 0e1935d..5434469 100644 --- a/engine/signal.cpp +++ b/engine/signal.cpp @@ -41,8 +41,11 @@ bool channel::map() return mapped; } +#include <iostream> + void channel::emit(const signal& sig) { + //cout << "React" << endl; stack.insert(sig); } @@ -117,8 +120,14 @@ channel::ptr channel::find(const string& id) void channel::check_and_call() { + //std::cout << "Signal check" << std::endl; + // check + //std::cout << "Stack size: " << stack.size() << endl; + if (!stack.empty()) { + std::cout << "Signal detected" << std::endl; + vector<weak_ptr<listener>> to_erase; // TODO, maybe it exists pop |