aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/GFX.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-03-23 00:28:28 +0100
committer hop311 <hop3114@gmail.com>2024-03-23 00:28:28 +0100
commit79c3462396fd4e1dcb7d1c9a2ef7bad741afa3e3 (patch)
tree4bf3a3318880609d6fdf2e96944bf84cdd2b8cdb /src/openvic-simulation/interface/GFX.cpp
parent020ada6c8f0f1bf4486fd9e76ec29673044794d6 (diff)
GFX objectTypes loading framework + Actor loadinggfx-object
Diffstat (limited to 'src/openvic-simulation/interface/GFX.cpp')
-rw-r--r--src/openvic-simulation/interface/GFX.cpp133
1 files changed, 0 insertions, 133 deletions
diff --git a/src/openvic-simulation/interface/GFX.cpp b/src/openvic-simulation/interface/GFX.cpp
deleted file mode 100644
index 06d4cd3..0000000
--- a/src/openvic-simulation/interface/GFX.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-#include "GFX.hpp"
-
-using namespace OpenVic;
-using namespace OpenVic::GFX;
-using namespace OpenVic::NodeTools;
-
-Font::Font(
- std::string_view new_identifier, colour_argb_t new_colour, std::string_view new_fontname, std::string_view new_charset,
- uint32_t new_height
-) : HasIdentifierAndAlphaColour { new_identifier, new_colour, false }, fontname { new_fontname }, charset { new_charset },
- height { new_height } {}
-
-node_callback_t Sprite::expect_sprites(length_callback_t length_callback, callback_t<std::unique_ptr<Sprite>&&> callback) {
- return expect_dictionary_keys_and_length(
- length_callback,
- "spriteType", ZERO_OR_MORE, _expect_instance<Sprite, IconTextureSprite>(callback),
- "progressbartype", ZERO_OR_MORE, _expect_instance<Sprite, ProgressBar>(callback),
- "PieChartType", ZERO_OR_MORE, _expect_instance<Sprite, PieChart>(callback),
- "LineChartType", ZERO_OR_MORE, _expect_instance<Sprite, LineChart>(callback),
- "textSpriteType", ZERO_OR_MORE, _expect_instance<Sprite, IconTextureSprite>(callback),
- "maskedShieldType", ZERO_OR_MORE, _expect_instance<Sprite, MaskedFlag>(callback),
- "tileSpriteType", ZERO_OR_MORE, _expect_instance<Sprite, TileTextureSprite>(callback),
- "corneredTileSpriteType", ZERO_OR_MORE, _expect_instance<Sprite, CorneredTileTextureSprite>(callback),
-
- /* Each only has one vanilla instance which isn't used anywhere. */
- "BarChartType", ZERO_OR_MORE, success_callback,
- "scrollingSprite", ZERO_OR_MORE, success_callback
- );
-}
-
-TextureSprite::TextureSprite() : texture_file {} {}
-
-bool TextureSprite::_fill_key_map(case_insensitive_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)),
-
- "norefcount", ZERO_OR_ONE, success_callback,
- "allwaystransparent", ZERO_OR_ONE, success_callback,
- "loadType", ZERO_OR_ONE, success_callback
- );
- return ret;
-}
-
-IconTextureSprite::IconTextureSprite() : no_of_frames { NO_FRAMES } {}
-
-bool IconTextureSprite::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = TextureSprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map,
- "noOfFrames", ZERO_OR_ONE, expect_uint(assign_variable_callback(no_of_frames)),
-
- "effectFile", ZERO_OR_ONE, success_callback,
- "transparencecheck", ZERO_OR_ONE, success_callback,
- "clicksound", ZERO_OR_ONE, success_callback
- );
- return ret;
-}
-
-TileTextureSprite::TileTextureSprite() : size {} {}
-
-bool TileTextureSprite::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = TextureSprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map,
- "size", ONE_EXACTLY, expect_ivec2(assign_variable_callback(size))
- );
- return ret;
-}
-
-CorneredTileTextureSprite::CorneredTileTextureSprite() : size {}, border_size {} {}
-
-bool CorneredTileTextureSprite::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = TextureSprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map,
- "size", ONE_EXACTLY, expect_ivec2(assign_variable_callback(size)),
- "borderSize", ONE_EXACTLY, expect_ivec2(assign_variable_callback(border_size))
- );
- return ret;
-}
-
-ProgressBar::ProgressBar() : back_colour {}, back_texture_file {}, progress_colour {}, progress_texture_file {}, size {} {}
-
-bool ProgressBar::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = Sprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map,
- "color", ONE_EXACTLY, expect_colour(assign_variable_callback(progress_colour)),
- "colortwo", ONE_EXACTLY, expect_colour(assign_variable_callback(back_colour)),
- "textureFile1", ZERO_OR_ONE, expect_string(assign_variable_callback_string(progress_texture_file)),
- "textureFile2", ZERO_OR_ONE, expect_string(assign_variable_callback_string(back_texture_file)),
- "size", ONE_EXACTLY, expect_ivec2(assign_variable_callback(size)),
-
- "effectFile", ONE_EXACTLY, success_callback,
- "allwaystransparent", ZERO_OR_ONE, success_callback,
- "loadType", ZERO_OR_ONE, success_callback,
- "horizontal", ZERO_OR_ONE, success_callback
- );
- return ret;
-}
-
-PieChart::PieChart() : size {} {}
-
-bool PieChart::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = Sprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map, "size", ONE_EXACTLY, expect_uint(assign_variable_callback(size)));
- return ret;
-}
-
-LineChart::LineChart() : size {}, linewidth {} {}
-
-bool LineChart::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = Sprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map,
- "size", ONE_EXACTLY, expect_ivec2(assign_variable_callback(size)),
- "linewidth", ONE_EXACTLY, expect_uint(assign_variable_callback(linewidth)),
-
- "allwaystransparent", ZERO_OR_ONE, success_callback
- );
- return ret;
-}
-
-MaskedFlag::MaskedFlag() : overlay_file {}, mask_file {} {}
-
-bool MaskedFlag::_fill_key_map(case_insensitive_key_map_t& key_map) {
- bool ret = Sprite::_fill_key_map(key_map);
- ret &= add_key_map_entries(key_map,
- "textureFile1", ONE_EXACTLY, expect_string(assign_variable_callback_string(overlay_file)),
- "textureFile2", ONE_EXACTLY, expect_string(assign_variable_callback_string(mask_file)),
-
- "effectFile", ONE_EXACTLY, success_callback,
- "allwaystransparent", ZERO_OR_ONE, success_callback,
- "flipv", ZERO_OR_ONE, success_callback
- );
- return ret;
-}