aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/GFX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/interface/GFX.cpp')
-rw-r--r--src/openvic-simulation/interface/GFX.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/openvic-simulation/interface/GFX.cpp b/src/openvic-simulation/interface/GFX.cpp
index 927b832..f9ae56b 100644
--- a/src/openvic-simulation/interface/GFX.cpp
+++ b/src/openvic-simulation/interface/GFX.cpp
@@ -15,9 +15,9 @@ node_callback_t Sprite::expect_sprite(callback_t<std::unique_ptr<Sprite>&&> call
"LineChartType", ZERO_OR_MORE, _expect_instance<Sprite, LineChart>(callback),
"textSpriteType", ZERO_OR_MORE, _expect_instance<Sprite, TextureSprite>(callback),
"maskedShieldType", ZERO_OR_MORE, _expect_instance<Sprite, MaskedFlag>(callback),
+ "tileSpriteType", ZERO_OR_MORE, _expect_instance<Sprite, TileTextureSprite>(callback),
// TODO - add the rest of the sprite types
"corneredTileSpriteType", ZERO_OR_MORE, success_callback,
- "tileSpriteType", ZERO_OR_MORE, success_callback,
"BarChartType", ZERO_OR_MORE, success_callback,
"scrollingSprite", ZERO_OR_MORE, success_callback
);
@@ -42,6 +42,20 @@ bool TextureSprite::_fill_key_map(key_map_t& key_map) {
return ret;
}
+TileTextureSprite::TileTextureSprite() : texture_file {}, size {} {}
+
+bool TileTextureSprite::_fill_key_map(key_map_t& key_map) {
+ bool ret = Sprite::_fill_key_map(key_map);
+ ret &= add_key_map_entries(key_map,
+ "texturefile", ZERO_OR_ONE, expect_string(assign_variable_callback_string(texture_file)),
+ "size", ZERO_OR_ONE, expect_ivec2(assign_variable_callback(size)),
+
+ "norefcount", ZERO_OR_ONE, success_callback,
+ "loadType", ZERO_OR_ONE, success_callback
+ );
+ return ret;
+}
+
ProgressBar::ProgressBar() : back_colour {}, progress_colour {} {}
bool ProgressBar::_fill_key_map(key_map_t& key_map) {