aboutsummaryrefslogtreecommitdiffstats
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/build_graph.hpp4
-rw-r--r--src/game/data.cpp4
-rw-r--r--src/game/data.hpp9
3 files changed, 13 insertions, 4 deletions
diff --git a/src/game/build_graph.hpp b/src/game/build_graph.hpp
index f92dbd3..bf83a18 100644
--- a/src/game/build_graph.hpp
+++ b/src/game/build_graph.hpp
@@ -36,7 +36,9 @@ struct MaterialDef {
float half_width; // visual thickness
float r, g, b, a; // visual colour (also tints the texture)
std::string name;
- std::string texture; // optional texture path ("" = flat colour)
+ std::string texture; // CC0 placeholder path ("" = flat colour)
+ std::string texture_forts; // preferred BYO Forts art ("forts:..."), falls
+ // back to `texture` then colour when absent
};
struct BuildNode {
diff --git a/src/game/data.cpp b/src/game/data.cpp
index 54f7fdb..654cac6 100644
--- a/src/game/data.cpp
+++ b/src/game/data.cpp
@@ -37,6 +37,7 @@ MaterialDef read_material(const sol::table& m) {
d.tension_only = m.get_or("tension_only", false);
d.half_width = m.get_or("half_width", 0.15f);
d.texture = m.get_or("texture", std::string(""));
+ d.texture_forts = m.get_or("texture_forts", std::string(""));
sol::optional<sol::table> col = m["color"];
d.r = col ? col->get_or(1, 0.8f) : 0.8f;
@@ -138,6 +139,8 @@ WeaponDef read_weapon(const sol::table& w) {
d.energy_cost = w.get_or("energy_cost", 0.0f);
d.texture = w.get_or("texture", std::string(""));
d.projectile_texture = w.get_or("projectile_texture", std::string(""));
+ d.texture_forts = w.get_or("texture_forts", std::string(""));
+ d.projectile_texture_forts = w.get_or("projectile_texture_forts", std::string(""));
return d;
}
} // namespace
@@ -213,6 +216,7 @@ DeviceDef read_device(const sol::table& d) {
v.cost_metal = d.get_or("cost_metal", 0.0f);
v.cost_energy = d.get_or("cost_energy", 0.0f);
v.texture = d.get_or("texture", std::string(""));
+ v.texture_forts = d.get_or("texture_forts", std::string(""));
sol::optional<sol::table> col = d["color"];
v.r = col ? col->get_or(1, 0.8f) : 0.8f;
v.g = col ? col->get_or(2, 0.8f) : 0.8f;
diff --git a/src/game/data.hpp b/src/game/data.hpp
index 3a7f912..fdf9e08 100644
--- a/src/game/data.hpp
+++ b/src/game/data.hpp
@@ -24,8 +24,10 @@ struct WeaponDef {
float beam_dps; // HP damage per second to the struck strut
float beam_duration; // seconds the beam stays on
float energy_cost; // energy spent per shot (Forts EnergyFireCost)
- std::string texture; // turret/base sprite
- std::string projectile_texture; // shell sprite
+ std::string texture; // turret/base sprite (CC0 placeholder)
+ std::string projectile_texture; // shell sprite (CC0 placeholder)
+ std::string texture_forts; // preferred BYO Forts turret art
+ std::string projectile_texture_forts; // preferred BYO Forts shell art
};
// Loads the material table from <data_dir>/materials.lua, then applies every
@@ -57,7 +59,8 @@ struct DeviceDef {
bool is_core; // reactor: destroying it decides the game
float half_w, half_h;
float cost_metal, cost_energy; // build cost
- std::string texture;
+ std::string texture; // CC0 placeholder ("" = flat colour)
+ std::string texture_forts; // preferred BYO Forts art, else texture
float r, g, b; // fallback colour when no texture
};