aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/GFX.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-23 19:26:05 +0100
committer hop311 <hop3114@gmail.com>2023-12-23 19:26:05 +0100
commit8a33982e543b7fb8c09be90ebadb33fe7f99b52f (patch)
tree0fb82e22b383996606ef6adc3e92c42d85bc6777 /src/openvic-simulation/interface/GFX.cpp
parent14e47d58b85f657ec1fed8abf88219f09bd3efbb (diff)
Fixed TGC compatibility + misc cleanup
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) {