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

ads-game:: configurable scale

This commit is contained in:
Zeno Rogue
2022-09-18 13:03:14 +02:00
parent 00b2dc522a
commit 707247d297
5 changed files with 12 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ namespace hr {
namespace ads_game {
hpcshape shShip;
bool made;
ld made_scale = -1;
vector<ld> shape_rock = { -0.0176894, 0.0952504, 0.0278998, 0.0966286, 0.0686721, 0.0455547, 0.110983, 0.0122558, 0.0994024, -0.0483395, 0.0517039, -0.0802772, -0.00271848, -0.0706804, -0.0564861, -0.08575, -0.100087, -0.0483411, -0.100031, -0.0102072, -0.0761486, 0.0292356, -0.0639653, 0.077575 };
vector<ld> shape_rock2 = {-0.00204264, 0.111665, 0.0374777, 0.119247, 0.0797168, 0.0940249, 0.106214, 0.0326813, 0.121954, -0.0109009, 0.0837905, -0.0865154, 0.0517718, -0.108312, 0.00135972, -0.0802237, -0.0632991, -0.0837181, -0.0980407, -0.0510629, -0.122639, 0.00885725, -0.0817448, 0.0878757, };
@@ -17,13 +17,13 @@ vector<ld> shape_airtank = {-0.101054, 0.0134738, -0.0904219, 0.014429, -0.07790
vector<ld> shape_ship = { 0.0699706, 0, 0.0509304, 0.019032, 0.0056909, 0.023788, 0.0318813, 0.0309258, 0.0330715, 0.0368693, 0.00331668, 0.0380512, -0.0630665, 0.0699568, -0.0619577, 0.041535, -0.0678691, 0.0415233, -0.0678946, 0.0261072, -0.0572505, 0.0237463, -0.0572505, -0.0237463, -0.0678946, -0.0261072, -0.0678691, -0.0415233, -0.0619577, -0.041535, -0.0630665, -0.0699568, 0.00331668, -0.0380512, 0.0330715, -0.0368693, 0.0318813, -0.0309258, 0.0056909, -0.023788, 0.0509304, -0.019032 };
void make_shape() {
if(made) return;
made = true;
if(made_scale == scale) return;
made_scale = scale;
cgi.bshape(shShip, PPR::MONSTER_BODY);
int N = isize(shape_ship);
vector<hyperpoint> lst;
for(int i=0; i<N; i += 2) lst.push_back(normalize(hpxyz(shape_ship[i], shape_ship[i+1], 1)));
for(int i=0; i<N; i += 2) lst.push_back(normalize(hpxyz(shape_ship[i] * scale, shape_ship[i+1] * scale, 1)));
for(auto h: lst) cgi.hpcpush(h);
cgi.hpcpush(lst[0]);
cgi.finishshape();