mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
arg:: split the big if list in config.cpp
This commit is contained in:
parent
45b25059b5
commit
4de4d3e640
24
config.cpp
24
config.cpp
@ -1400,8 +1400,6 @@ int read_config_args() {
|
|||||||
vsync_off = true;
|
vsync_off = true;
|
||||||
if(curphase == 3) setvideomode();
|
if(curphase == 3) setvideomode();
|
||||||
}
|
}
|
||||||
else if(argis("-noplayer"))
|
|
||||||
mapeditor::drawplayer = !mapeditor::drawplayer;
|
|
||||||
else if(argis("-nofps")) {
|
else if(argis("-nofps")) {
|
||||||
nofps = true;
|
nofps = true;
|
||||||
}
|
}
|
||||||
@ -1418,11 +1416,6 @@ int read_config_args() {
|
|||||||
dont_face_pc = true;
|
dont_face_pc = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(argis("-P")) {
|
|
||||||
PHASE(2); shift();
|
|
||||||
vid.scfg.players = argi();
|
|
||||||
stop_game_and_switch_mode(rg::nothing);
|
|
||||||
}
|
|
||||||
else if(argis("-PM")) {
|
else if(argis("-PM")) {
|
||||||
PHASEFROM(2); shift(); pmodel = eModel(argi());
|
PHASEFROM(2); shift(); pmodel = eModel(argi());
|
||||||
}
|
}
|
||||||
@ -1444,12 +1437,23 @@ int read_config_args() {
|
|||||||
else if(argis("-els")) {
|
else if(argis("-els")) {
|
||||||
shift(); conformal::extra_line_steps = argf();
|
shift(); conformal::extra_line_steps = argf();
|
||||||
}
|
}
|
||||||
|
TOGGLE('o', vid.usingGL, switchGL())
|
||||||
|
TOGGLE('f', vid.full, switchFullscreen())
|
||||||
|
else return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// mode changes:
|
// mode changes:
|
||||||
|
|
||||||
TOGGLE('o', vid.usingGL, switchGL())
|
int read_gamemode_args() {
|
||||||
|
using namespace arg;
|
||||||
|
|
||||||
|
if(argis("-P")) {
|
||||||
|
PHASE(2); shift();
|
||||||
|
vid.scfg.players = argi();
|
||||||
|
stop_game_and_switch_mode(rg::nothing);
|
||||||
|
}
|
||||||
TOGGLE('C', chaosmode, stop_game_and_switch_mode(rg::chaos))
|
TOGGLE('C', chaosmode, stop_game_and_switch_mode(rg::chaos))
|
||||||
TOGGLE('f', vid.full, switchFullscreen())
|
|
||||||
TOGGLE('S', shmup::on, stop_game_and_switch_mode(rg::shmup))
|
TOGGLE('S', shmup::on, stop_game_and_switch_mode(rg::shmup))
|
||||||
TOGGLE('H', hardcore, switchHardcore())
|
TOGGLE('H', hardcore, switchHardcore())
|
||||||
TOGGLE('R', randomPatternsMode, stop_game_and_switch_mode(rg::randpattern))
|
TOGGLE('R', randomPatternsMode, stop_game_and_switch_mode(rg::randpattern))
|
||||||
@ -1459,7 +1463,7 @@ int read_config_args() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ah_config = addHook(hooks_args, 0, read_config_args);
|
auto ah_config = addHook(hooks_args, 0, read_config_args) + addHook(hooks_args, 0, read_gamemode_args);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1806,6 +1806,7 @@ int read_editor_args() {
|
|||||||
else if(argis("-pic")) { shift(); picfile = args(); }
|
else if(argis("-pic")) { shift(); picfile = args(); }
|
||||||
else if(argis("-load")) { PHASE(3); shift(); mapstream::loadMap(args()); }
|
else if(argis("-load")) { PHASE(3); shift(); mapstream::loadMap(args()); }
|
||||||
else if(argis("-picload")) { PHASE(3); shift(); mapeditor::loadPicFile(args()); }
|
else if(argis("-picload")) { PHASE(3); shift(); mapeditor::loadPicFile(args()); }
|
||||||
|
else if(argis("-noplayer")) mapeditor::drawplayer = !mapeditor::drawplayer;
|
||||||
else if(argis("-canvas")) {
|
else if(argis("-canvas")) {
|
||||||
PHASEFROM(2);
|
PHASEFROM(2);
|
||||||
stop_game();
|
stop_game();
|
||||||
|
Loading…
Reference in New Issue
Block a user