aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/GFX.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-02-19 22:09:17 +0100
committer GitHub <noreply@github.com>2024-02-19 22:09:17 +0100
commit147e0a772dc768bd90fdccdd2536f14c11238d57 (patch)
treeaef9a168b1e4ce5b15797bca460abda5edf465c0 /src/openvic-simulation/interface/GFX.hpp
parent35e5f7828a41736194362186ad4f946fad5964d1 (diff)
parent31a3521643dbf4bd218a6af10025f99ac3bf7e98 (diff)
Merge pull request #149 from OpenVicProject/fp-rounding+texture-sprites
Fixed point rounding and Texture Sprites
Diffstat (limited to 'src/openvic-simulation/interface/GFX.hpp')
-rw-r--r--src/openvic-simulation/interface/GFX.hpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/openvic-simulation/interface/GFX.hpp b/src/openvic-simulation/interface/GFX.hpp
index 108ecb6..49691c1 100644
--- a/src/openvic-simulation/interface/GFX.hpp
+++ b/src/openvic-simulation/interface/GFX.hpp
@@ -46,13 +46,8 @@ namespace OpenVic::GFX {
);
};
- class TextureSprite final : public Sprite {
- friend std::unique_ptr<TextureSprite> std::make_unique<TextureSprite>();
-
+ class TextureSprite : public Sprite {
std::string PROPERTY(texture_file);
- frame_t PROPERTY(no_of_frames);
-
- // TODO - effectFile, allwaystransparent
protected:
TextureSprite();
@@ -63,13 +58,30 @@ namespace OpenVic::GFX {
TextureSprite(TextureSprite&&) = default;
virtual ~TextureSprite() = default;
+ OV_DETAIL_GET_BASE_TYPE(TextureSprite)
OV_DETAIL_GET_TYPE
};
- class TileTextureSprite final : public Sprite {
+ class IconTextureSprite final : public TextureSprite {
+ friend std::unique_ptr<IconTextureSprite> std::make_unique<IconTextureSprite>();
+
+ frame_t PROPERTY(no_of_frames);
+
+ protected:
+ IconTextureSprite();
+
+ bool _fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) override;
+
+ public:
+ IconTextureSprite(IconTextureSprite&&) = default;
+ virtual ~IconTextureSprite() = default;
+
+ OV_DETAIL_GET_TYPE
+ };
+
+ class TileTextureSprite final : public TextureSprite {
friend std::unique_ptr<TileTextureSprite> std::make_unique<TileTextureSprite>();
- std::string PROPERTY(texture_file);
ivec2_t PROPERTY(size);
protected:
@@ -84,10 +96,9 @@ namespace OpenVic::GFX {
OV_DETAIL_GET_TYPE
};
- class CorneredTileTextureSprite final : public Sprite {
+ class CorneredTileTextureSprite final : public TextureSprite {
friend std::unique_ptr<CorneredTileTextureSprite> std::make_unique<CorneredTileTextureSprite>();
- std::string PROPERTY(texture_file);
ivec2_t PROPERTY(size);
ivec2_t PROPERTY(border_size);