1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

ads-game:: refactored switch_pause

This commit is contained in:
Zeno Rogue 2022-10-15 14:22:09 +02:00
parent a5a7e8a5fa
commit 9121eb7d72
4 changed files with 18 additions and 25 deletions

View File

@ -138,20 +138,7 @@ bool ads_turn(int idelta) {
auto& la = multi::lactionpressed;
if(a[16+4] && !la[16+4] && !paused) fire();
if(a[16+5] && !la[16+5]) {
paused = !paused;
if(paused) {
current_ship = current;
vctr_ship = vctr;
vctrV_ship = vctrV;
view_pt = 0;
}
else {
current = current_ship;
vctr = new_vctr = vctr_ship;
vctrV = new_vctrV = vctrV_ship;
}
}
if(a[16+5] && !la[16+5]) switch_pause();
if(a[16+6] && !la[16+6]) view_proper_times = !view_proper_times;
if(a[16+7] && !la[16+7]) auto_rotate = !auto_rotate;
if(a[16+8] && !la[16+8]) pushScreen(game_menu);

View File

@ -334,17 +334,7 @@ bool ds_turn(int idelta) {
auto& la = multi::lactionpressed;
if(a[16+4] && !la[16+4] && !paused) ds_fire();
if(a[16+5] && !la[16+5]) {
paused = !paused;
if(paused) {
current_ship = current;
view_pt = 0;
}
else {
current = current_ship;
}
}
if(a[16+5] && !la[16+5]) switch_pause();
if(a[16+6] && !la[16+6]) view_proper_times = !view_proper_times;
if(a[16+7] && !la[16+7]) auto_rotate = !auto_rotate;
if(a[16+8] && !la[16+8]) pushScreen(game_menu);

View File

@ -128,6 +128,7 @@ void run_ds_game();
/** in the replay mode */
bool in_replay;
void switch_replay();
void switch_pause();
void replay_animation();
void switch_underlying();

View File

@ -6,6 +6,21 @@ namespace ads_game {
hrmap *map_hyp;
void switch_pause() {
paused = !paused;
if(paused) {
current_ship = current;
vctr_ship = vctr;
vctrV_ship = vctrV;
view_pt = 0;
}
else {
current = current_ship;
vctr = new_vctr = vctr_ship;
vctrV = new_vctrV = vctrV_ship;
}
}
bool hv_klein = false;
transmatrix Duality;