From 069d61e487947a8be38f6a3db52695db94fd306e Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 3 Jul 2023 09:10:09 +1000 Subject: [PATCH] Fix scaling a better way --- source/game/scripting/StarLuaAnimationComponent.hpp | 3 +++ source/game/scripting/StarLuaGameConverters.cpp | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source/game/scripting/StarLuaAnimationComponent.hpp b/source/game/scripting/StarLuaAnimationComponent.hpp index 1ad99a4..0cbd280 100644 --- a/source/game/scripting/StarLuaAnimationComponent.hpp +++ b/source/game/scripting/StarLuaAnimationComponent.hpp @@ -66,6 +66,9 @@ LuaAnimationComponent::LuaAnimationComponent() { if (renderLayerName) renderLayer = parseRenderLayer(*renderLayerName); + if (auto image = drawable.part.ptr()) + image->transformation.scale(0.125f); + 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 baae984..070048e 100644 --- a/source/game/scripting/StarLuaGameConverters.cpp +++ b/source/game/scripting/StarLuaGameConverters.cpp @@ -449,12 +449,7 @@ 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(), - table->get>("screenSpace").value(false) ? 1.0f : 1.0f / TilePixels, - table->get>("centered").value(true), - Vec2F(), - color); + drawable = Drawable::makeImage(image.take(), 1.0f, table->get>("centered").value(true), Vec2F(), color); else return {}; // throw LuaAnimationComponentException("Drawable table must have 'line', 'poly', or 'image'");