diff --git a/interfaces/Crafter.Graphics-RenderingElement2D.cppm b/interfaces/Crafter.Graphics-RenderingElement2D.cppm index 1c6b522..047733c 100644 --- a/interfaces/Crafter.Graphics-RenderingElement2D.cppm +++ b/interfaces/Crafter.Graphics-RenderingElement2D.cppm @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module; #include "../lib/stb_truetype.h" export module Crafter.Graphics:RenderingElement2D; +import Crafter.Asset; import std; import :Transform2D; import :Font; @@ -129,6 +130,12 @@ export namespace Crafter { } RenderingElement2D(Anchor2D anchor, OpaqueType opaque, std::uint32_t bufferWidth, std::uint32_t bufferHeight, std::uint32_t rotation) requires(Owning && Rotating) : RenderingElement2DBase(anchor, opaque), ScalingBase(bufferWidth, bufferHeight) , RotatingBase(rotation) { + } + RenderingElement2D(Anchor2D anchor, TextureAsset> texture) requires(!Owning && Scaling) : RenderingElement2DBase(anchor, texture.opaque), ScalingBase(texture.sizeX, texture.sizeY, texture.pixels) { + + } + RenderingElement2D(Anchor2D anchor, TextureAsset> texture, std::uint32_t rotation) requires(!Owning && Scaling && Rotating) : RenderingElement2DBase(anchor, texture.opaque), ScalingBase(texture.sizeX, texture.sizeY, texture.pixels), RotatingBase(rotation) { + } RenderingElement2D(RenderingElement2D&) = delete; diff --git a/interfaces/Crafter.Graphics-Types.cppm b/interfaces/Crafter.Graphics-Types.cppm index 6cd1002..0bb3a23 100644 --- a/interfaces/Crafter.Graphics-Types.cppm +++ b/interfaces/Crafter.Graphics-Types.cppm @@ -49,12 +49,6 @@ export namespace Crafter { std::chrono::duration delta; }; - enum class OpaqueType { - FullyOpaque, // All pixels have A of 255 - SemiOpaque, // All pixels have A of 0 or 255 (no blending needed) - Transparent // Color blending is used - }; - enum class CrafterKeys { // Alphabetic keys A, B, C, D, E, F, G, H, I, J, K, L, M, diff --git a/project.json b/project.json index ca8e1e6..8eb7e26 100644 --- a/project.json +++ b/project.json @@ -97,6 +97,10 @@ { "path":"https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git", "configuration":"lib" + }, + { + "path":"https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git", + "configuration":"lib" } ] }, @@ -110,6 +114,10 @@ { "path":"https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git", "configuration":"lib" + }, + { + "path":"https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git", + "configuration":"lib" } ], "defines": [{ "name": "CRAFTER_TIMING" }] @@ -127,6 +135,10 @@ "path":"https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git", "pathh":"/home/jorijn/repos/Crafter/Crafter.Math/project.json", "configuration":"lib-debug" + }, + { + "path":"https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset.git", + "configuration":"lib-debug" } ] },