1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-18 11:19:59 +00:00

ads:: more solid lps use

This commit is contained in:
Zeno Rogue 2023-08-08 12:05:18 +02:00
parent 4ca3d41ad5
commit 522436ba96
4 changed files with 41 additions and 18 deletions

View File

@ -128,15 +128,26 @@ void run_ads_game() {
cwt.at = centerover = currentmap->gamestart(); cwt.at = centerover = currentmap->gamestart();
restart(); restart();
rogueviz::on_cleanup_or_next([] {
switch_spacetime_to(true);
});
} }
local_parameter_set lps_relhell("relhell:"); local_parameter_set lps_relhell("relhell:");
local_parameter_set lps_relhell_space("relhell:space:", &lps_relhell);
local_parameter_set lps_relhell_ds_spacetime("relhell:ds:", &lps_relhell);
local_parameter_set lps_relhell_ads_spacetime("relhell:ads:", &lps_relhell);
local_parameter_set lps_relhell_ds_spacetime_klein("relhell:ads:klein:", &lps_relhell_ds_spacetime);
local_parameter_set lps_relhell_ds_spacetime_pers("relhell:ads:pers:", &lps_relhell_ds_spacetime);
void default_settings() { void default_settings() {
set_default_keys(); set_default_keys();
lps_add_enum(lps_relhell, nohelp, 1); lps_add(lps_relhell, nohelp, 1);
lps_add(lps_relhell, nomenukey, true); lps_add(lps_relhell, nomenukey, true);
lps_add(lps_relhell, nomap, true);
lps_add(lps_relhell, no_find_player, true); lps_add(lps_relhell, no_find_player, true);
lps_add(lps_relhell, showstartmenu, false); lps_add(lps_relhell, showstartmenu, false);
lps_add(lps_relhell, mapeditor::drawplayer, false); lps_add(lps_relhell, mapeditor::drawplayer, false);
@ -145,6 +156,24 @@ void default_settings() {
lps_add(lps_relhell, vid.axes3, false); lps_add(lps_relhell, vid.axes3, false);
lps_add(lps_relhell, patterns::whichCanvas, 'r'); lps_add(lps_relhell, patterns::whichCanvas, 'r');
lps_add(lps_relhell, patterns::rwalls, 0); lps_add(lps_relhell, patterns::rwalls, 0);
lps_add(lps_relhell, vid.fov, 150.);
lps_add(lps_relhell_ds_spacetime_klein, pmodel, mdDisk);
lps_add(lps_relhell_ds_spacetime_klein, pconf.alpha, 0.);
lps_add(lps_relhell_ds_spacetime_pers, pmodel, mdPerspective);
lps_add(lps_relhell_ds_spacetime, vid.grid, true);
lps_add(lps_relhell_ds_spacetime, stdgridcolor, 0xFFFFFFFF);
lps_add(lps_relhell_ds_spacetime, models::desitter_projections, true);
lps_add(lps_relhell_space, pmodel, mdDisk);
lps_add(lps_relhell_space, pconf.scale, .95);
lps_add(lps_relhell_ads_spacetime, pmodel, mdRelPerspective);
lps_add(lps_relhell_ads_spacetime, nonisotropic_weird_transforms, true);
lps_add(lps_relhell_ads_spacetime, vid.grid, false);
lps_add(lps_relhell_ads_spacetime, slr::range_xy, 2.);
lps_add(lps_relhell_ads_spacetime, slr::range_z, 2.);
} }
void set_config() { void set_config() {
@ -156,6 +185,7 @@ void run_ads_game_std() {
set_config(); set_config();
set_geometry(gNormal); set_geometry(gNormal);
set_variation(eVariation::pure); set_variation(eVariation::pure);
lps_enable(&lps_relhell_space);
run_ads_game(); run_ads_game();
showstartmenu = false; showstartmenu = false;
} }

View File

@ -735,10 +735,14 @@ void run_ds_game() {
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc); rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
rogueviz::rv_hook(hooks_handleKey, 0, handleKey); rogueviz::rv_hook(hooks_handleKey, 0, handleKey);
rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation); rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation);
rogueviz::on_cleanup_or_next([] {
main_rock = nullptr;
});
} }
void run_ds_game_std() { void run_ds_game_std() {
lps_enable(&lps_relhell); lps_enable(&lps_relhell_space);
enable_canvas(); enable_canvas();
run_ds_game(); run_ds_game();
} }

View File

@ -113,7 +113,7 @@ ads_object *main_rock;
extern string copyright_shown; extern string copyright_shown;
extern local_parameter_set lps_relhell; extern local_parameter_set lps_relhell, lps_relhell_space, lps_relhell_ads_spacetime, lps_relhell_ds_spacetime_pers, lps_relhell_ds_spacetime_klein;
int XSCALE = 48; int XSCALE = 48;
int YSCALE = 48; int YSCALE = 48;

View File

@ -45,27 +45,22 @@ void switch_spacetime() {
geometry = gSpace435; geometry = gSpace435;
variation = eVariation::pure; variation = eVariation::pure;
swap(currentmap, map_hyp); swap(currentmap, map_hyp);
pmodel = hv_klein ? mdDisk : mdPerspective;
if(hv_klein) pconf.alpha = 0;
check_cgi(); check_cgi();
cgi.require_basics(); cgi.require_basics();
cgi.use_count++; cgi.use_count++;
vid.grid = true;
stdgridcolor = 0xFFFFFFFF; stdgridcolor = 0xFFFFFFFF;
initcells(); initcells();
initgame(); initgame();
vid.fov = 150; lps_enable(&(hv_klein ? lps_relhell_ds_spacetime_klein : lps_relhell_ds_spacetime_pers));
models::desitter_projections = true;
} }
else if(hyperbolic) { else if(hyperbolic) {
geometry = gSphere; geometry = gSphere;
variation = eVariation::bitruncated; variation = eVariation::bitruncated;
swap(currentmap, map_hyp); swap(currentmap, map_hyp);
pmodel = mdDisk;
pconf.scale = .95;
check_cgi(); check_cgi();
lps_enable(&lps_relhell_space);
} }
} }
@ -75,22 +70,16 @@ void switch_spacetime() {
cgi.use_count++; cgi.use_count++;
if(hyperbolic) { if(hyperbolic) {
hybrid::switch_to_actual(); hybrid::switch_to_actual();
pmodel = mdRelPerspective;
hyperpoint res; hyperpoint res;
nonisotropic_weird_transforms = true;
NLP = Id; NLP = Id;
Duality = Id; Duality = Id;
for(int a=0; a<4; a++) for(int b=0; b<4; b++) Duality[a][b] = (a^2) == b; for(int a=0; a<4; a++) for(int b=0; b<4; b++) Duality[a][b] = (a^2) == b;
vid.fov = 150; lps_enable(&lps_relhell_ads_spacetime);
vid.grid = false;
slr::range_xy = 2;
slr::range_z = 2;
} }
else if(mhybrid) { else if(mhybrid) {
hybrid::switch_to_underlying(); hybrid::switch_to_underlying();
pmodel = mdDisk; lps_enable(&lps_relhell_space);
pconf.scale = .95;
} }
cgi.use_count++; cgi.use_count++;
} }