1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-25 14:43:01 +00:00

rogueviz:: ads:: ship_history_period

This commit is contained in:
Zeno Rogue 2025-06-22 16:03:07 +02:00
parent 039f1fba29
commit 2b8b24e3f5
4 changed files with 15 additions and 1 deletions

View File

@ -190,8 +190,12 @@ void draw_game_cell(const cell_to_draw& cd) {
if(rock.type != oParticle) view_time(shiftless(rgpushxto0(rock.pt_main.h)), rock.pt_main.shift, 0xFFFFFF);
}
ld last_shown = -HUGE_VAL;
if(paused || which_cross) if(hv) for(auto& rock: ci.shipstates) {
if(rock.start < last_shown + ship_history_period) continue;
last_shown = rock.start;
render_ship_parts([&] (const hpcshape& sh, color_t col, int sym) {
int dx = sym ? -1 : 1;
for(int i=sh.s; i<sh.e; i++) {

View File

@ -628,7 +628,11 @@ void view_ds_game() {
}
ld delta = paused ? 1e-4 : -1e-4;
ld last_shown = -100;
vector<ld> times;
if(paused) for(auto& ss: history) {
if(ss.start < last_shown + ship_history_period) continue;
last_shown = ss.start; times.push_back(ss.start);
if(ss.at.shift < current.shift - 4 * TAU) continue;
if(ss.at.shift > current.shift + 4 * TAU) continue;

View File

@ -58,6 +58,8 @@ bool view_proper_times = false;
/** format for displaying time */
const char *tformat = "%.2f";
ld ship_history_period = 0;
void game_menu();
void restart();
void change_scale(ld s);

View File

@ -206,6 +206,10 @@ auto view_hooks =
+ arg::add3("-ads-replay", [] { arg::shift(); int i = arg::argi(); if(i != in_replay) switch_replay(); })
+ arg::add3("-ads-duality", [] { arg::shift(); use_duality = arg::argi(); })
+ arg::add3("-ads-cone", [] { arg::shift(); which_cross = arg::argi(); })
+ arg::add3("-ads-spacetime", [] { arg::shift(); switch_spacetime_to(arg::argi()); });
+ arg::add3("-ads-ship-history", [] { arg::shift_arg_formula(ship_history_period); })
+ arg::add3("-ads-spacetime", [] { arg::shift(); switch_spacetime_to(arg::argi());
pmodel = mdRelPerspective;
use_duality = 0;
});
}}