aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Render.hpp8
-rw-r--r--src/components/Script.hpp6
2 files changed, 10 insertions, 4 deletions
diff --git a/src/components/Render.hpp b/src/components/Render.hpp
index f5936ea..3f1750f 100644
--- a/src/components/Render.hpp
+++ b/src/components/Render.hpp
@@ -27,7 +27,7 @@ public:
Texture texture;
Texture normal;
bool visible;
- bool hasNormal = false;
+ bool flipX = false;
Render(std::string _file) :
texture(_file), visible(true) {}
@@ -42,10 +42,10 @@ public:
this->visible = tab["visible"];
if (tab["texture"].get_type() == sol::type::string)
this->texture = Texture(static_cast<std::string>(tab["texture"]));
- if (tab["normal"].get_type() == sol::type::string) {
+ if (tab["normal"].get_type() == sol::type::string)
this->normal = Texture(static_cast<std::string>(tab["normal"]));
- hasNormal = true;
- }
+ if (tab["flipx"].get_type() == sol::type::boolean)
+ this->flipX = tab["flipx"];
} else {
throw std::string(
"Render component table formatted incorrectly"
diff --git a/src/components/Script.hpp b/src/components/Script.hpp
index 66addc8..069fea9 100644
--- a/src/components/Script.hpp
+++ b/src/components/Script.hpp
@@ -47,6 +47,12 @@ public:
caller["Idle"](caller); // Call idle function and pass itself
// in or to fulfill the 'self' param
}
+
+ void update(void)
+ {
+ if (caller["Update"] == sol::type::function)
+ caller["Update"](caller);
+ }
};
#endif // COMPONENT_SCRIPT_HPP_