mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	rogueviz:: ads:: time_shift setting
This commit is contained in:
		| @@ -342,6 +342,9 @@ auto shot_hooks = | |||||||
|     param_f(time_scale, "rh_time_scale") |     param_f(time_scale, "rh_time_scale") | ||||||
|     -> editable(0, 1, 0.1, "Relative Hell time label scale", "scaling factor for the time labels", 'T'); |     -> editable(0, 1, 0.1, "Relative Hell time label scale", "scaling factor for the time labels", 'T'); | ||||||
|  |  | ||||||
|  |     param_f(time_shift, "rh_time_shift") | ||||||
|  |     -> editable(0, 1, 0.1, "Relative Hell time label shift", "shift for the time labels", 'U'); | ||||||
|  |  | ||||||
|     param_i(XSCALE, "ds_xscale") |     param_i(XSCALE, "ds_xscale") | ||||||
|     -> editable(4, 512, 8, "x precision of Earth-de Sitter", "", 'x'); |     -> editable(4, 512, 8, "x precision of Earth-de Sitter", "", 'x'); | ||||||
|     param_i(YSCALE, "ds_yscale") |     param_i(YSCALE, "ds_yscale") | ||||||
|   | |||||||
| @@ -23,6 +23,14 @@ void apply_duality(shiftmatrix& S) { | |||||||
| vector<ads_object*> under_mouse; | vector<ads_object*> under_mouse; | ||||||
| hyperpoint mousetester; | hyperpoint mousetester; | ||||||
|  |  | ||||||
|  | void view_time(const shiftmatrix& S, ld t, color_t col) { | ||||||
|  |   if(!view_proper_times) return; | ||||||
|  |   auto S1 = S; | ||||||
|  |   if(time_shift) S1.T = rgpushxto0(S1.T * C0) * ypush(time_shift); | ||||||
|  |   string str = hr::format(tformat, t / (main_rock ? ds_time_unit : ads_time_unit)); | ||||||
|  |   queuestr(S1, time_scale, str, col, 8); | ||||||
|  |   } | ||||||
|  |  | ||||||
| void draw_game_cell(const cell_to_draw& cd) { | void draw_game_cell(const cell_to_draw& cd) { | ||||||
|   bool hv = mtwisted; |   bool hv = mtwisted; | ||||||
|   using cellptr = cell*; |   using cellptr = cell*; | ||||||
| @@ -104,10 +112,7 @@ void draw_game_cell(const cell_to_draw& cd) { | |||||||
|  |  | ||||||
|   ld ads_scale = get_scale(); |   ld ads_scale = get_scale(); | ||||||
|  |  | ||||||
|   if(view_proper_times) { |   if(col >> 8) view_time(shiftless(rgpushxto0(cd.center.h)), cd.center.shift, 0xFF4040); | ||||||
|     string str = hr::format(tformat, cd.center.shift / ads_time_unit); |  | ||||||
|     queuestr(shiftless(rgpushxto0(cd.center.h)), time_scale, str, 0xFF4040, 8); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|   // need i-loop because new rocks can be created in handle_turret |   // need i-loop because new rocks can be created in handle_turret | ||||||
|  |  | ||||||
| @@ -177,10 +182,7 @@ void draw_game_cell(const cell_to_draw& cd) { | |||||||
|         0x000000FF, rock.col, obj_prio[rock.type]); |         0x000000FF, rock.col, obj_prio[rock.type]); | ||||||
|       } |       } | ||||||
|  |  | ||||||
|     if(view_proper_times && rock.type != oParticle) { |     if(rock.type != oParticle) view_time(shiftless(rgpushxto0(rock.pt_main.h)), rock.pt_main.shift, 0xFFFFFF); | ||||||
|       string str = hr::format(tformat, rock.pt_main.shift / ads_time_unit); |  | ||||||
|       queuestr(shiftless(rgpushxto0(rock.pt_main.h)), time_scale, str, 0xFFFFFF, 8); |  | ||||||
|       } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   if(paused || which_cross) if(hv) for(auto& rock: ci.shipstates) { |   if(paused || which_cross) if(hv) for(auto& rock: ci.shipstates) { | ||||||
| @@ -240,10 +242,7 @@ void draw_game_cell(const cell_to_draw& cd) { | |||||||
|       queuecurve(shiftless(Id), 0xFF, col, PPR::MONSTER_FOOT); |       queuecurve(shiftless(Id), 0xFF, col, PPR::MONSTER_FOOT); | ||||||
|       }); |       }); | ||||||
|  |  | ||||||
|     if(ok && view_proper_times) { |     if(ok) view_time(shiftless(rgpushxto0(cr.h)), cr.shift + rock.start, 0xC0C0C0); | ||||||
|       string str = hr::format(tformat, (cr.shift + rock.start) / ads_time_unit); |  | ||||||
|       queuestr(shiftless(rgpushxto0(cr.h)), time_scale, str, 0xC0C0C0, 8); |  | ||||||
|       } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   if(paused && c == vctr_ship && !game_over && !in_replay && !hv) { |   if(paused && c == vctr_ship && !game_over && !in_replay && !hv) { | ||||||
| @@ -389,10 +388,7 @@ void view_ads_game() { | |||||||
|         }); |         }); | ||||||
|       poly_outline = 0xFF; |       poly_outline = 0xFF; | ||||||
|  |  | ||||||
|       if(view_proper_times) { |       view_time(shiftless(Id), ship_pt, 0xFFFFFF); | ||||||
|         string str = hr::format(tformat, ship_pt / ads_time_unit); |  | ||||||
|         queuestr(shiftless(Id), time_scale, str, 0xFFFFFF, 8); |  | ||||||
|         } |  | ||||||
|       }     |       }     | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -616,11 +616,10 @@ void view_ds_game() { | |||||||
|         queuecurve(shiftless(sphereflip), ghost_color, 0, obj_prio[rock.type]).flags |= POLY_NO_FOG | POLY_FORCEWIDE; |         queuecurve(shiftless(sphereflip), ghost_color, 0, obj_prio[rock.type]).flags |= POLY_NO_FOG | POLY_FORCEWIDE; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|       if(view_proper_times && rock.type != oParticle) { |       if(rock.type != oParticle) { | ||||||
|         ld t = rock.pt_main.shift; |         ld t = rock.pt_main.shift; | ||||||
|         if(rock.type == oMainRock) t += current.shift; |         if(rock.type == oMainRock) t += current.shift; | ||||||
|         string str = hr::format(tformat, t / ds_time_unit); |         view_time(shiftless(sphereflip * rgpushxto0(rock.pt_main.h)), t, 0xFFFF00); | ||||||
|         queuestr(shiftless(sphereflip * rgpushxto0(rock.pt_main.h)), time_scale, str, 0xFFFF00, 8); |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|       if(rock.pt_main.h[2] > 0.1 && rock.life_end == HUGE_VAL) { |       if(rock.pt_main.h[2] > 0.1 && rock.life_end == HUGE_VAL) { | ||||||
| @@ -676,10 +675,7 @@ void view_ds_game() { | |||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|       if(view_proper_times) { |       view_time(shiftless(sphereflip * rgpushxto0(cr.h)), cr.shift + ss.start, 0xC0C0C0); | ||||||
|         string str = hr::format(tformat, (cr.shift + ss.start) / ds_time_unit); |  | ||||||
|         queuestr(shiftless(sphereflip * rgpushxto0(cr.h)), time_scale, str, 0xC0C0C0, 8); |  | ||||||
|         } |  | ||||||
|       } |       } | ||||||
|  |  | ||||||
|     if(!game_over && !paused) { |     if(!game_over && !paused) { | ||||||
| @@ -705,10 +701,7 @@ void view_ds_game() { | |||||||
|         }); |         }); | ||||||
|       poly_outline = 0xFF; |       poly_outline = 0xFF; | ||||||
|  |  | ||||||
|       if(view_proper_times) { |       view_time(shiftless(sphereflip), ship_pt, 0xFFFFFF); | ||||||
|         string str = hr::format(tformat, ship_pt / ds_time_unit); |  | ||||||
|         queuestr(shiftless(sphereflip), time_scale, str, 0xFFFFFF, 8); |  | ||||||
|         } |  | ||||||
|       } |       } | ||||||
|      |      | ||||||
|     if(paused && !game_over && !in_replay && !hv && !which_cross) { |     if(paused && !game_over && !in_replay && !hv && !which_cross) { | ||||||
|   | |||||||
| @@ -66,6 +66,7 @@ void change_scale(ld s); | |||||||
| vector<struct ads_object*> displayed; | vector<struct ads_object*> displayed; | ||||||
|  |  | ||||||
| ld time_scale = .5; | ld time_scale = .5; | ||||||
|  | ld time_shift = 0; | ||||||
|  |  | ||||||
| color_t missile_color = 0xFF0000FF; | color_t missile_color = 0xFF0000FF; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -205,9 +205,10 @@ void game_menu() { | |||||||
|   add_edit(pause_speed); |   add_edit(pause_speed); | ||||||
|   add_edit(view_proper_times); |   add_edit(view_proper_times); | ||||||
|   add_edit(DS_(time_unit)); |   add_edit(DS_(time_unit)); | ||||||
|   if(view_proper_times) |   if(view_proper_times) { | ||||||
|     add_edit(time_scale); |     add_edit(time_scale); add_edit(time_shift); | ||||||
|   else dialog::addBreak(100); |     } | ||||||
|  |   else dialog::addBreak(200); | ||||||
|  |  | ||||||
|   dialog::addItem(XLAT("set view mode"), 'v'); |   dialog::addItem(XLAT("set view mode"), 'v'); | ||||||
|   dialog::add_action_push(edit_view_mode); |   dialog::add_action_push(edit_view_mode); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue