diff options
author | Nao Pross <naopross@thearcway.org> | 2019-01-25 02:54:54 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-01-25 02:54:54 +0100 |
commit | f58dea71037dca847e373f6efbf75b6056f212ac (patch) | |
tree | 3b9b66379a583eb0b162418d037ec00b66e6bebc /engine/include | |
parent | Update configure.py to default build libflatland.{so, a} (diff) | |
download | flatland-f58dea71037dca847e373f6efbf75b6056f212ac.tar.gz flatland-f58dea71037dca847e373f6efbf75b6056f212ac.zip |
It compiles! Probably super broken, but compiles!
Diffstat (limited to 'engine/include')
-rw-r--r-- | engine/include/actor.hpp | 4 | ||||
-rw-r--r-- | engine/include/bound.hpp | 4 | ||||
-rw-r--r-- | engine/include/collector.hpp | 4 | ||||
-rw-r--r-- | engine/include/exception.hpp | 4 | ||||
-rw-r--r-- | engine/include/exceptions/forcequit.hpp | 11 | ||||
-rw-r--r-- | engine/include/flatland.hpp | 6 | ||||
-rw-r--r-- | engine/include/layer.hpp | 17 | ||||
-rw-r--r-- | engine/include/serial/focusable.hpp | 7 | ||||
-rw-r--r-- | engine/include/serial/keyfocusable.hpp | 8 | ||||
-rw-r--r-- | engine/include/serial/mousefocusable.hpp | 0 | ||||
-rw-r--r-- | engine/include/types.hpp | 26 | ||||
-rw-r--r-- | engine/include/window.hpp | 16 |
12 files changed, 62 insertions, 45 deletions
diff --git a/engine/include/actor.hpp b/engine/include/actor.hpp index b5a8285..75a3474 100644 --- a/engine/include/actor.hpp +++ b/engine/include/actor.hpp @@ -3,6 +3,8 @@ #include "collector.hpp" +namespace flat { + class FlatBound; class FlatActor : public FlatCollector @@ -24,4 +26,6 @@ public: FlatBound * getBounds() const; }; +} + #endif diff --git a/engine/include/bound.hpp b/engine/include/bound.hpp index f5a2c0d..9b7b755 100644 --- a/engine/include/bound.hpp +++ b/engine/include/bound.hpp @@ -4,6 +4,8 @@ #include "object.hpp" #include "svector.h" +namespace flat { + typedef SVector<int, 2> pixel; class FlatBound : virtual public flat::core::object @@ -35,4 +37,6 @@ public: } }; +} + #endif diff --git a/engine/include/collector.hpp b/engine/include/collector.hpp index 5b1e718..bc50f4d 100644 --- a/engine/include/collector.hpp +++ b/engine/include/collector.hpp @@ -4,6 +4,8 @@ #include "core/object.hpp" #include <set> +namespace flat { + class FlatCollector : virtual public flat::core::object { FlatCollector * parent; @@ -42,4 +44,6 @@ public: std::set<FlatCollector*>::const_iterator end() const; }; +} + #endif diff --git a/engine/include/exception.hpp b/engine/include/exception.hpp index 47eb272..6f578e8 100644 --- a/engine/include/exception.hpp +++ b/engine/include/exception.hpp @@ -3,6 +3,8 @@ #include <exception> +namespace flat { + class FlatException : public std::exception { const char * error; @@ -19,4 +21,6 @@ public: virtual const char* what() const throw() override; }; +} + #endif diff --git a/engine/include/exceptions/forcequit.hpp b/engine/include/exceptions/forcequit.hpp index 7b2b324..451190e 100644 --- a/engine/include/exceptions/forcequit.hpp +++ b/engine/include/exceptions/forcequit.hpp @@ -1,11 +1,12 @@ #ifndef __FORCE_QUIT_H__ #define __FORCE_QUIT_H__ -struct ForceQuit -{ - const char * reason; +namespace flat { + struct ForceQuit { + const char * reason; - ForceQuit(const char *reason) : reason(reason) {} -}; + ForceQuit(const char *reason) : reason(reason) {} + }; +} #endif diff --git a/engine/include/flatland.hpp b/engine/include/flatland.hpp index e01201f..331093b 100644 --- a/engine/include/flatland.hpp +++ b/engine/include/flatland.hpp @@ -28,10 +28,10 @@ struct flat_status unsigned char video:1; unsigned char audio:1; unsigned char timer:1; + unsigned char events:1; unsigned char joystick:1; unsigned char controller:1; unsigned char haptic:1; - unsigned char events:1; unsigned char error:1; unsigned char running:1; unsigned char loop:1; @@ -66,10 +66,6 @@ flat_status flatland_status(); void load_flatland_status(const flat_status&); -/* Common defined variables */ - -extern float flatland_dt; - } #endif diff --git a/engine/include/layer.hpp b/engine/include/layer.hpp index c3294e4..c6ff0c9 100644 --- a/engine/include/layer.hpp +++ b/engine/include/layer.hpp @@ -3,13 +3,14 @@ #include "collector.hpp" -class FlatLayer : public FlatCollector -{ - -public: - - FlatLayer(FlatLayer *parent); - ~FlatLayer(); -}; +namespace flat { + class FlatLayer : public FlatCollector + { + + public: + FlatLayer(FlatLayer *parent); + ~FlatLayer(); + }; +} #endif diff --git a/engine/include/serial/focusable.hpp b/engine/include/serial/focusable.hpp index 008f7a3..f139577 100644 --- a/engine/include/serial/focusable.hpp +++ b/engine/include/serial/focusable.hpp @@ -4,15 +4,14 @@ #include "core/object.hpp" #include "types.hpp" -class task_s; union SDL_Event; +namespace flat { + class Focusable : virtual public flat::core::object { bool focused; - task_s * event_trigger; - protected: /* Callback to event */ @@ -34,4 +33,6 @@ public: void serial_precall(void*); }; +} + #endif diff --git a/engine/include/serial/keyfocusable.hpp b/engine/include/serial/keyfocusable.hpp index e28e333..26f3ce2 100644 --- a/engine/include/serial/keyfocusable.hpp +++ b/engine/include/serial/keyfocusable.hpp @@ -5,6 +5,8 @@ struct SDL_KeyboardEvent; +namespace flat { + class KeyFocusable : virtual public Focusable { @@ -15,10 +17,8 @@ class KeyFocusable : virtual public Focusable protected: virtual void key_cb(const SDL_KeyboardEvent*) = 0; - -public: - - using Focusable::Focusable; }; +} + #endif diff --git a/engine/include/serial/mousefocusable.hpp b/engine/include/serial/mousefocusable.hpp deleted file mode 100644 index e69de29..0000000 --- a/engine/include/serial/mousefocusable.hpp +++ /dev/null diff --git a/engine/include/types.hpp b/engine/include/types.hpp index 436cc7c..e7a1d3a 100644 --- a/engine/include/types.hpp +++ b/engine/include/types.hpp @@ -10,26 +10,24 @@ namespace flat class object; } -} - -class FlatActor; -class FlatSprite; + class FlatActor; + class FlatSprite; -class Focusable; + class Focusable; -class KeyFocusable; -class MouseFocusable; + class KeyFocusable; + class MouseFocusable; -class FlatEvent; -class EventListener; -class Eventrigger; + class FlatEvent; + class EventListener; + class Eventrigger; -class FlatWindow; + class FlatWindow; -class FlatSpriter; -class FlatMultiSpriter; + class FlatSpriter; + class FlatMultiSpriter; +} -class task_s; /* SDL types */ diff --git a/engine/include/window.hpp b/engine/include/window.hpp index 7b3fa9a..98e8e04 100644 --- a/engine/include/window.hpp +++ b/engine/include/window.hpp @@ -1,8 +1,16 @@ #ifndef __FLATWINDOW_H__ #define __FLATWINDOW_H__ +#include "core/object.hpp" +#include "serial/keyfocusable.hpp" + #include <string> +class SDL_Window; +class SDL_KeyEvent; + +namespace flat { + struct window_status { window_status( unsigned char fullscreen = 0, @@ -26,15 +34,10 @@ struct window_status unsigned char focus:1; }; -#include "core/object.hpp" -#include "serial/keyfocusable.hpp" -class SDL_Window; class FlatLayer; -class SDL_KeyEvent; - -class FlatWindow : virtual public flat::core::object, public KeyFocusable +class FlatWindow : virtual public core::object, public KeyFocusable { std::string title; window_status status; @@ -94,4 +97,5 @@ public: static uint32_t winstatus_to_flags(window_status); }; +} #endif |