1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-30 05:23:00 +00:00

rogueviz::ads:: using more detailed ds/ads ships, sharing scale with main RogueViz

This commit is contained in:
Zeno Rogue
2025-02-09 01:10:31 +01:00
parent 8ba1b97ebe
commit 7b33cf435c
9 changed files with 154 additions and 74 deletions

View File

@@ -21,12 +21,17 @@ struct ship_model: gi_extension {
map<ld, hpcshape> ship_at_scale;
};
/** how much should be the objects scaled */
ld get_scale() {
return cgi.scalefactor * 3;
}
const hpcshape& make_shape() {
auto& mmd = (unique_ptr<ship_model>&) cgi.ext["ship_model"];
if(!mmd) mmd = std::make_unique<ship_model> ();
auto scale = DS_(scale);
auto scale = get_scale();
auto sas = at_or_null(mmd->ship_at_scale, scale);
if(sas) return *sas;
@@ -46,4 +51,20 @@ const hpcshape& make_shape() {
return shShip;
}
extern color_t shipcolor;
template<class T> void render_ship_parts(const T& render_ship_part) {
if(simple_ship) {
render_ship_part(make_shape(), shipcolor, 0);
return;
}
charstyle& cs = getcs();
render_ship_part(cgi.shSpaceshipBase, cs.skincolor, 0);
render_ship_part(cgi.shSpaceshipEngine, cs.haircolor, 0);
render_ship_part(cgi.shSpaceshipEngine, cs.haircolor, 1);
render_ship_part(cgi.shSpaceshipGun, cs.dresscolor, 0);
render_ship_part(cgi.shSpaceshipGun, cs.dresscolor, 1);
render_ship_part(cgi.shSpaceshipCockpit, cs.eyecolor, 0);
}
}}