1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 13:07:16 +00:00

enabling canvas now automatically enables ls::single

This commit is contained in:
Zeno Rogue 2021-04-23 20:09:23 +02:00
parent e681357206
commit 056419288c
9 changed files with 25 additions and 20 deletions

View File

@ -119,7 +119,7 @@ void ensure_geometry(eGeometryClass c) {
canvas_default_wall = waInvisibleFloor;
patterns::whichCanvas = 'g';
patterns::canvasback = 0xFFFFFF;
firstland = specialland = laCanvas;
enable_canvas();
}
start_game();
}

View File

@ -1201,7 +1201,7 @@ EX void enable(archimedean_tiling& arct) {
function<void()> setcanvas(char c) {
return [c] () {
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
patterns::whichCanvas = c;
start_game();
};

View File

@ -64,11 +64,11 @@ void launch(int seed, int elimit, int hlimit) {
dual::enable();
stop_game();
dual::switch_to(0);
specialland = firstland = laCanvas;
enable_canvas();
canvas_default_wall = waSea;
pconf.scale = .5;
dual::switch_to(1);
specialland = firstland = laCanvas;
enable_canvas();
shrand(seed);
start_game();
in = true;

View File

@ -2374,7 +2374,7 @@ EX namespace mapeditor {
if(sym == SDLK_F5) {
dialog::push_confirm_dialog([] {
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
canvas_default_wall = waInvisibleFloor;
patterns::whichCanvas = 'g';
patterns::canvasback = 0xFFFFFF;

View File

@ -977,7 +977,7 @@ EX void showStartMenu() {
pushScreen(texture::showMenu);
resetModes('c');
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
cheater = true;
patterns::canvasback = 0xFFFFFF;
mapeditor::drawplayer = false;

View File

@ -17,6 +17,12 @@ enum cpatterntype {
};
#endif
EX void enable_canvas() {
firstland = specialland = laCanvas;
randomPatternsMode = false;
land_structure = lsSingle;
}
EX int ctof(cell *c) {
#if CAP_IRR
if(IRREGULAR) return irr::ctof(c);
@ -2057,8 +2063,7 @@ EX namespace patterns {
stop_game();
whichCanvas = 'g';
canvasback = c >> 8;
firstland = specialland = laCanvas;
randomPatternsMode = false;
enable_canvas();
start_game();
}
else {
@ -2079,8 +2084,7 @@ EX namespace patterns {
break;
}
if(instant) {
firstland = specialland = laCanvas;
randomPatternsMode = false;
enable_canvas();
start_game();
}
}
@ -2115,8 +2119,7 @@ EX namespace patterns {
if(instant) stop_game();
whichCanvas = 'f';
if(instant) {
firstland = specialland = laCanvas;
randomPatternsMode = false;
enable_canvas();
start_game();
}
};
@ -2128,8 +2131,7 @@ EX namespace patterns {
whichCanvas = uni;
subcanvas = rand();
if(instant) {
firstland = specialland = laCanvas;
randomPatternsMode = false;
enable_canvas();
start_game();
}
if(uni == 'r')
@ -3107,7 +3109,7 @@ int read_pattern_args() {
else if(argis("-canvas")) {
PHASEFROM(2);
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
shift();
if(args() == "i") canvas_default_wall = waInvisibleFloor;
else if(args().size() == 1) patterns::whichCanvas = args()[0];
@ -3117,14 +3119,14 @@ int read_pattern_args() {
else if(argis("-canvas-random")) {
PHASEFROM(2);
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
patterns::whichCanvas = 'r';
shift(); patterns::rwalls = argi();
}
else if(argis("-cformula")) {
PHASEFROM(2);
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
patterns::whichCanvas = 'f';
shift(); patterns::color_formula = args();
}

View File

@ -899,11 +899,11 @@ void init(flagtype _vizflags) {
#if !ISWEB
mapeditor::drawplayer = false;
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
restart_game(shmup::on ? rg::shmup : rg::nothing);
#else
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
restart_game(rg::nothing);
#endif
autocheat = true;

View File

@ -1326,7 +1326,7 @@ EX void showMenu() {
pushScreen(patterns::showPrePattern);
else {
stop_game();
firstland = specialland = laCanvas;
enable_canvas();
patterns::whichCanvas = 'g';
patterns::canvasback = 0xFFFFFF;
start_game();

View File

@ -110,6 +110,9 @@ EX void setCanvas(presmode mode, char canv) {
slide_backup(patterns::whichCanvas, canv);
slide_backup(firstland, laCanvas);
slide_backup(specialland, laCanvas);
slide_backup(land_structure);
slide_backup(randomPatternsMode);
enable_canvas();
start_game();
resetview();
}