diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-02 15:15:26 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-02 15:15:26 -0400 |
commit | 46393662672f2510a40eb6cd5291f99a7ae14e3c (patch) | |
tree | 8b11793b474ebc6e7359289bd9e9704d58a7f58a /src/components/Render.hpp | |
parent | c1161dc0d8939814abf7da48d03b887c0aead0ff (diff) | |
parent | 062a7e2baad74f49f2548793a25f0cf5e4ae6f86 (diff) |
Merge branch 'master' of https://github.com/tcsullivan/gamedev2 into save-load
Diffstat (limited to 'src/components/Render.hpp')
-rw-r--r-- | src/components/Render.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/components/Render.hpp b/src/components/Render.hpp index 451f2d1..3f1750f 100644 --- a/src/components/Render.hpp +++ b/src/components/Render.hpp @@ -19,12 +19,15 @@ #define COMPONENT_RENDER_HPP_ #include "Component.hpp" +#include "texture.hpp" struct Render : Component<Render>, entityx::Component<Render> { public: - std::string texture; + Texture texture; + Texture normal; bool visible; + bool flipX = false; Render(std::string _file) : texture(_file), visible(true) {} @@ -38,7 +41,11 @@ public: if (tab["visible"].get_type() == sol::type::boolean) this->visible = tab["visible"]; if (tab["texture"].get_type() == sol::type::string) - this->texture = tab["texture"]; + this->texture = Texture(static_cast<std::string>(tab["texture"])); + if (tab["normal"].get_type() == sol::type::string) + this->normal = Texture(static_cast<std::string>(tab["normal"])); + if (tab["flipx"].get_type() == sol::type::boolean) + this->flipX = tab["flipx"]; } else { throw std::string( "Render component table formatted incorrectly" |