aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation
diff options
context:
space:
mode:
author Nemrav <>2024-09-17 22:43:19 +0200
committer Nemrav <>2024-09-17 22:43:19 +0200
commit80f72ba2e2b25ef2d66a93dc62c5b7439a7a6c56 (patch)
treed8db2364367dc9c4bd6a96db70e8121568c262c7 /src/openvic-simulation
parentc232250cc9819ae8bf165a5707a926db928dcb2b (diff)
modify commentsgfxobject
Diffstat (limited to 'src/openvic-simulation')
-rw-r--r--src/openvic-simulation/interface/GFXObject.cpp28
-rw-r--r--src/openvic-simulation/interface/GFXObject.hpp32
2 files changed, 26 insertions, 34 deletions
diff --git a/src/openvic-simulation/interface/GFXObject.cpp b/src/openvic-simulation/interface/GFXObject.cpp
index bd720c3..eb17836 100644
--- a/src/openvic-simulation/interface/GFXObject.cpp
+++ b/src/openvic-simulation/interface/GFXObject.cpp
@@ -138,7 +138,6 @@ bool Actor::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
}
/* arrows.gfx */
-//todo: verify the texture files labels are correct
ArrowType::ArrowType() : size { 5 }, texture_file {}, body_texture_file {},
back_colour {}, progress_colour {}, end_at { 1 }, height { 1 }, arrow_type { 0 },
heading { 1 }, effect_file {} {}
@@ -163,16 +162,15 @@ bool ArrowType::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
}
/* battlearrow.gfx */
-//todo: verify textureFile and textureFile1
-BattleArrow::BattleArrow() : texture_file {}, back_texture_file {}, start { 1 }, stop { 1 },
+BattleArrow::BattleArrow() : texture_arrow_body {}, texture_arrow_head {}, start { 1 }, stop { 1 },
x { 1 }, y { 1 }, font {}, scale { 1 }, no_fade { false }, texture_loop {} {}
bool BattleArrow::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
bool ret = Object::_fill_key_map(key_map);
ret &= add_key_map_entries(key_map,
- "textureFile", ONE_EXACTLY, expect_string(assign_variable_callback_string(texture_file)),
- "textureFile1", ONE_EXACTLY, expect_string(assign_variable_callback_string(back_texture_file)),
+ "textureFile", ONE_EXACTLY, expect_string(assign_variable_callback_string(texture_arrow_body)),
+ "textureFile1", ONE_EXACTLY, expect_string(assign_variable_callback_string(texture_arrow_head)),
"start", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(start)),
"stop", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(stop)),
"x", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(x)),
@@ -205,8 +203,11 @@ Projection::Projection() :
pulsating { false }, pulse_lowest { 1 }, pulse_speed { 1 },
additative { false }, expanding { 1 }, duration {}, fadeout {} {}
-//TODO: Verify whether size, pulseSpeed, duration, fadeout are fixedpoint_t or int
-//TODO: Verify there aren't more, unused properties?
+//TODO: Verify...
+// whether pulseSpeed is fixedpoint_t or int
+// pulseSpeed doesn't seem to do anything, so assume fixed_point_t since its a speed
+//fadeout could be int, expect_int_bool, or fixed_point_t
+//fadeout seems not to do anything
bool Projection::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
bool ret = Object::_fill_key_map(key_map);
@@ -231,15 +232,9 @@ Billboard::Billboard() :
texture_file {}, scale { 1 }, no_of_frames { 1 }, font_size { 7 },
offset {}, font {} {}
-//TODO: billboard was a <StringMapCaseInsensitive> on its dictionnary, how do we preserve this?
bool Billboard::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
bool ret = Object::_fill_key_map(key_map);
- int components = 0;
- fixed_point_t x = 0;
- fixed_point_t y = 0;
- fixed_point_t z = 0;
-
ret &= add_key_map_entries(key_map,
"texturefile", ONE_EXACTLY, expect_string(assign_variable_callback_string(texture_file)),
"noOfFrames", ZERO_OR_ONE, expect_int64(assign_variable_callback(no_of_frames)),
@@ -249,10 +244,6 @@ bool Billboard::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
"font", ZERO_OR_ONE, expect_string(assign_variable_callback_string(font))
);
- offset.x = x;
- offset.y = y;
- offset.z = z;
-
return ret;
}
@@ -261,7 +252,6 @@ UnitStatsBillboard::UnitStatsBillboard() :
no_of_frames { 1 }, font_size { 7 }, font {} {}
//TODO: Verify font_size is int
-//TODO: Verify there aren't more, unused properties?
bool UnitStatsBillboard::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
bool ret = Object::_fill_key_map(key_map);
@@ -281,7 +271,6 @@ bool UnitStatsBillboard::_fill_key_map(NodeTools::case_insensitive_key_map_t& ke
ProgressBar3d::ProgressBar3d() : back_colour {}, progress_colour {}, size {}, effect_file {} {}
-//TODO: Verify there aren't more, unused properties?
bool ProgressBar3d::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
bool ret = Object::_fill_key_map(key_map);
@@ -303,7 +292,6 @@ text {}, colour {}, font {}, text_position {}, size {}, format { text_format_t::
AnimatedMapText::AnimatedMapText() :
speed { 1 }, scale { 1 }, position {}, textblock {} {}
-//TODO: Verify there aren't more, unused properties?
bool AnimatedMapText::_fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) {
bool ret = Object::_fill_key_map(key_map);
diff --git a/src/openvic-simulation/interface/GFXObject.hpp b/src/openvic-simulation/interface/GFXObject.hpp
index e25339f..51d34c1 100644
--- a/src/openvic-simulation/interface/GFXObject.hpp
+++ b/src/openvic-simulation/interface/GFXObject.hpp
@@ -84,14 +84,17 @@ namespace OpenVic::GFX {
private:
//Named<> already handles the name property
fixed_point_t PROPERTY(size);
- std::string PROPERTY(texture_file);
+ //texture_file is unused, body_texture_file determines the appearance of the arrow
+ std::string PROPERTY(texture_file); //unused
std::string PROPERTY(body_texture_file);
+ //colours dont appear to be used
+ //TODO: Verify these property names for color and colortwo are correct
colour_t PROPERTY(back_colour);
colour_t PROPERTY(progress_colour);
fixed_point_t PROPERTY(end_at); //how should float be repd? >> fixed_point handles it
fixed_point_t PROPERTY(height);
- uint64_t PROPERTY(arrow_type);
+ uint64_t PROPERTY(arrow_type); //TODO: what does this do?
fixed_point_t PROPERTY(heading); //also float
std::string PROPERTY(effect_file);
@@ -109,19 +112,20 @@ namespace OpenVic::GFX {
};
/* battlearrow.gfx */
+ //TODO: unclear where/how these are used (if at all) in game
class BattleArrow final : public Object {
friend std::unique_ptr<BattleArrow> std::make_unique<BattleArrow>();
private:
//Named<> already handles the name property
//TODO verify the texture places
- std::string PROPERTY(texture_file);
- std::string PROPERTY(back_texture_file);
+ std::string PROPERTY(texture_arrow_body);
+ std::string PROPERTY(texture_arrow_head);
- fixed_point_t PROPERTY(start);
- fixed_point_t PROPERTY(stop);
- fixed_point_t PROPERTY(x);
- fixed_point_t PROPERTY(y);
+ fixed_point_t PROPERTY(start); //labelled 'body start width' in file
+ fixed_point_t PROPERTY(stop); //labelled 'body end width' in file
+ fixed_point_t PROPERTY(x); //labelled 'arrow length' in file
+ fixed_point_t PROPERTY(y); //labelled 'arrow height' in file
std::string PROPERTY(font);
fixed_point_t PROPERTY(scale);
@@ -140,6 +144,7 @@ namespace OpenVic::GFX {
OV_DETAIL_GET_TYPE
};
+ //TODO unclear if these are used or just a hoi3 leftover
class MapInfo final : public Object {
friend std::unique_ptr<MapInfo> std::make_unique<MapInfo>();
@@ -166,7 +171,7 @@ namespace OpenVic::GFX {
private:
//Named<> already handles the name property
std::string PROPERTY(texture_file);
- //TODO: should size, pulseSpeed, duration, fadeout be ints or fixed points? assume fixed_point_t to start
+ //TODO: pulseSpeed, fadeout be ints or fixed points? assume fixed_point_t to start
fixed_point_t PROPERTY(size);
fixed_point_t PROPERTY(spin);
bool PROPERTY(pulsating);
@@ -174,8 +179,8 @@ namespace OpenVic::GFX {
fixed_point_t PROPERTY(pulse_speed);
bool PROPERTY(additative);
fixed_point_t PROPERTY(expanding);
- std::optional<fixed_point_t> PROPERTY(duration);
- std::optional<fixed_point_t> PROPERTY(fadeout);
+ std::optional<fixed_point_t> PROPERTY(duration); //if present, determines how long until the projection disappears
+ std::optional<fixed_point_t> PROPERTY(fadeout); //appears to have no affect
protected:
Projection();
@@ -214,7 +219,7 @@ namespace OpenVic::GFX {
OV_DETAIL_GET_TYPE
};
-
+ //Appears to be unused, at least as of HoD
class UnitStatsBillboard final : public Object {
friend std::unique_ptr<UnitStatsBillboard> std::make_unique<UnitStatsBillboard>();
@@ -240,12 +245,11 @@ namespace OpenVic::GFX {
OV_DETAIL_GET_TYPE
};
+ //TODO: appears to go unused
class ProgressBar3d final : public Object {
friend std::unique_ptr<ProgressBar3d> std::make_unique<ProgressBar3d>();
private:
- //Named<> already handles the name property
- //TODO: are there any other properties which are unused
colour_t PROPERTY(back_colour);
colour_t PROPERTY(progress_colour);
ivec2_t PROPERTY(size);