mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
ads:: reverse replay feature
This commit is contained in:
parent
bc3b4841b7
commit
9c04b39ed3
@ -126,6 +126,7 @@ void run_ads_game_std();
|
||||
void run_ds_game();
|
||||
|
||||
/** in the replay mode */
|
||||
bool rev_replay;
|
||||
bool in_replay;
|
||||
void switch_replay();
|
||||
void switch_pause();
|
||||
|
@ -86,6 +86,8 @@ void edit_view_mode() {
|
||||
dialog::addBoolItem(XLAT("view replay"), in_replay, 'r');
|
||||
dialog::add_action(switch_replay);
|
||||
|
||||
dialog::addBoolItem_action(XLAT("reverse replay"), rev_replay, 'w');
|
||||
|
||||
dialog::addBreak(100);
|
||||
|
||||
if(!main_rock) add_edit(auto_rotate);
|
||||
|
@ -119,7 +119,12 @@ void replay_animation() {
|
||||
nomap = main_rock ? (!hyperbolic || among(pmodel, mdRelPerspective, mdRelOrthogonal)) : !sl2;
|
||||
|
||||
if(in_replay) {
|
||||
view_pt = (ticks / 1000.) * DS_(simspeed);
|
||||
static int oticks = ticks;
|
||||
if(inHighQual)
|
||||
view_pt = (ticks / 1000.) * DS_(simspeed) * (rev_replay ? -1 : 1);
|
||||
else
|
||||
view_pt += ((ticks - oticks) / 1000.) * DS_(simspeed) * (rev_replay ? -1 : 1);
|
||||
oticks = ticks;
|
||||
ld maxt = history.back().start + 0.001;
|
||||
view_pt -= maxt * floor(view_pt / maxt);
|
||||
for(auto& ss: history)
|
||||
|
Loading…
Reference in New Issue
Block a user