From 7999442f01140eec6cba813bb76fc3b5c9e5aa90 Mon Sep 17 00:00:00 2001
From: Kae <80987908+Novaenia@users.noreply.github.com>
Date: Mon, 3 Jul 2023 08:57:30 +1000
Subject: [PATCH] Fix scaling
not happy with having to do this, but whatever
---
source/game/scripting/StarLuaAnimationComponent.hpp | 1 -
source/game/scripting/StarLuaGameConverters.cpp | 7 ++++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/source/game/scripting/StarLuaAnimationComponent.hpp b/source/game/scripting/StarLuaAnimationComponent.hpp
index 6d94466..1ad99a4 100644
--- a/source/game/scripting/StarLuaAnimationComponent.hpp
+++ b/source/game/scripting/StarLuaAnimationComponent.hpp
@@ -66,7 +66,6 @@ LuaAnimationComponent::LuaAnimationComponent() {
if (renderLayerName)
renderLayer = parseRenderLayer(*renderLayerName);
- drawable.scale(1.0f / TilePixels);
m_drawables.append({move(drawable), renderLayer});
});
animationCallbacks.registerCallback("clearLightSources", [this]() {
diff --git a/source/game/scripting/StarLuaGameConverters.cpp b/source/game/scripting/StarLuaGameConverters.cpp
index 070048e..baae984 100644
--- a/source/game/scripting/StarLuaGameConverters.cpp
+++ b/source/game/scripting/StarLuaGameConverters.cpp
@@ -449,7 +449,12 @@ Maybe LuaConverter::to(LuaEngine& engine, LuaValue const& v)
else if (auto poly = table->get>("poly"))
drawable = Drawable::makePoly(poly.take(), color);
else if (auto image = table->get>("image"))
- drawable = Drawable::makeImage(image.take(), 1.0f, table->get>("centered").value(true), Vec2F(), color);
+ drawable = Drawable::makeImage(
+ image.take(),
+ table->get>("screenSpace").value(false) ? 1.0f : 1.0f / TilePixels,
+ table->get>("centered").value(true),
+ Vec2F(),
+ color);
else
return {}; // throw LuaAnimationComponentException("Drawable table must have 'line', 'poly', or 'image'");