1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-05-09 18:54:07 +00:00

rogueviz::ads:: do not show numerically unstable convergent/divergent stars in dsgame

This commit is contained in:
Zeno Rogue 2025-04-08 00:33:23 +02:00
parent 8a92ea95f3
commit f47837df99
2 changed files with 8 additions and 4 deletions

View File

@ -113,7 +113,7 @@ struct rock_generator {
ld step = rand_range(0.17, 0.23);
for(int i=0; i<45; i++) {
cshift += step;
add(spin(alpha + i * TAU / 30) * div_matrix());
add(spin(alpha + i * TAU / 30) * div_matrix())->subtype = 1;
}
cshift += rand_range(.3, .7);
}
@ -125,7 +125,7 @@ struct rock_generator {
ld step = rand_range(0.17, 0.23);
for(int i=0; i<45; i++) {
cshift += step;
add(spin(alpha + i * TAU / 30) * conv_matrix());
add(spin(alpha + i * TAU / 30) * conv_matrix())->subtype = 2;
}
cshift += rand_range(.3, .7);
}
@ -214,6 +214,8 @@ rock_generator rockgen, rsrcgen;
auto future_shown = 5 * TAU;
auto future_shown_condiv = 2 * TAU;
/** start with a fixed good-looking sequence */
bool demo;
@ -526,8 +528,8 @@ void view_ds_game() {
poly_outline = 0xFF;
if(rock.type == oMainRock) rock.at.shift = current.shift;
if(rock.at.shift < current.shift - future_shown) continue;
if(rock.at.shift > current.shift + future_shown) continue;
if(current.shift < rock.at.shift - (rock.subtype == 1 ? future_shown_condiv : future_shown)) continue;
if(current.shift > rock.at.shift + (rock.subtype == 2 ? future_shown_condiv : future_shown)) continue;
if(1) {
dynamicval<eGeometry> g(geometry, gSpace435);

View File

@ -198,10 +198,12 @@ struct ads_object {
ld life_start, life_end;
cross_result pt_main;
vector<cross_result> pts;
int subtype;
ads_object(eObjType t, cell *_owner, const ads_matrix& T, color_t _col) : type(t), owner(_owner), at(T), col(_col) {
life_start = -HUGE_VAL;
life_end = HUGE_VAL;
subtype = 0;
}
};