mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	rogueviz:: ads:: ship_history_period
This commit is contained in:
		| @@ -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); |     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(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) { |     render_ship_parts([&] (const hpcshape& sh, color_t col, int sym) { | ||||||
|       int dx = sym ? -1 : 1; |       int dx = sym ? -1 : 1; | ||||||
|       for(int i=sh.s; i<sh.e; i++) { |       for(int i=sh.s; i<sh.e; i++) { | ||||||
|   | |||||||
| @@ -628,7 +628,11 @@ void view_ds_game() { | |||||||
|       }       |       }       | ||||||
|  |  | ||||||
|     ld delta = paused ? 1e-4 : -1e-4; |     ld delta = paused ? 1e-4 : -1e-4; | ||||||
|  |     ld last_shown = -100; | ||||||
|  |     vector<ld> times; | ||||||
|     if(paused) for(auto& ss: history) { |     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; | ||||||
|       if(ss.at.shift > current.shift + 4 * TAU) continue; |       if(ss.at.shift > current.shift + 4 * TAU) continue; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -58,6 +58,8 @@ bool view_proper_times = false; | |||||||
| /** format for displaying time */ | /** format for displaying time */ | ||||||
| const char *tformat = "%.2f"; | const char *tformat = "%.2f"; | ||||||
|  |  | ||||||
|  | ld ship_history_period = 0; | ||||||
|  |  | ||||||
| void game_menu(); | void game_menu(); | ||||||
| void restart(); | void restart(); | ||||||
| void change_scale(ld s); | void change_scale(ld s); | ||||||
|   | |||||||
| @@ -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-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-duality", [] { arg::shift(); use_duality = arg::argi(); }) | ||||||
| + arg::add3("-ads-cone", [] { arg::shift(); which_cross = 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; | ||||||
|  |   }); | ||||||
|  |  | ||||||
| }} | }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue