rogueviz:: added CAP_RAY and CAP_SOLV guards

This commit is contained in:
Zeno Rogue 2021-06-25 13:54:17 +02:00
parent 28d334c660
commit d7326e7f87
4 changed files with 26 additions and 1 deletions

View File

@ -410,7 +410,9 @@ auto explore_structure(int _shapeid) {
enable();
crystal::crystal_period = 4;
start_game();
#if CAP_RAY
ray::max_cells = 4096;
#endif
}
if(mode == pmKey || mode == pmGeometrySpecial) {
stop_game();

View File

@ -71,13 +71,17 @@ auto geoslide(eGeometry g, char canvas, int jhole, int jblock) {
if(sl2) {
addMessage("Raycaster not implemented here.");
}
#if CAP_RAY
else if(ray::want_use != 2) {
ray::want_use = 2;
ray::max_cells = 4096;
addMessage("Using a raycaster.");
}
#endif
else {
#if CAP_RAY
ray::want_use = 0;
#endif
addMessage("Using primitives.");
}
}

View File

@ -4,6 +4,8 @@
#include "rogueviz.h"
#if CAP_RAY
/**
* mg 2 in old video
@ -322,6 +324,7 @@ struct hrmap_notknot : hrmap {
return ac[0]->master;
}
#if CAP_SOLV
heptagon *create_solv_knot() {
dynamicval<eGeometry> g(geometry, base);
dynamicval<hrmap*> m(currentmap, euc);
@ -353,6 +356,7 @@ struct hrmap_notknot : hrmap {
return ac[0]->master;
}
#endif
heptagon *interpret_basemap() {
dynamicval<eGeometry> g(geometry, base);
@ -376,8 +380,10 @@ struct hrmap_notknot : hrmap {
return create_trifoil_knot();
else if(base == gNil)
return create_nil_knot();
#if CAP_SOLV
else if(base == gArnoldCat)
return create_solv_knot();
#endif
throw hr_exception();
}
@ -601,6 +607,7 @@ struct hrmap_notknot : hrmap {
}
}
#if CAP_SOLV
if(base_map == "" && base == gArnoldCat) {
if(u->where->zebraval & 16) {
@ -644,6 +651,7 @@ struct hrmap_notknot : hrmap {
}
}
}
#endif
if(base == gCubeTiling) {
special = true;
@ -863,7 +871,9 @@ struct hrmap_notknot : hrmap {
}
/* flat areas */
#if CAP_SOLV
if(!asonov::in())
#endif
for(int k=0; k<u->where->type; k++)
for(int l=0; l<u->where->type; l++) {
auto uk = gen_adj(u, k);
@ -1234,7 +1244,8 @@ void launch_sphereknot() {
pmodel = mdPerspective;
((hrmap_notknot*)currentmap)->add_fog();
}
#if CAP_SOLV
void launch_solv() {
stop_game();
set_geometry(gArnoldCat);
@ -1258,6 +1269,7 @@ void launch_solv() {
pmodel = mdGeodesic;
((hrmap_notknot*)currentmap)->add_fog();
}
#endif
void show() {
cmode = sm::SIDE | sm::MAYDARK;
@ -1283,8 +1295,10 @@ void show() {
dialog::addItem("knotted portal in spherical geometry", 'd');
dialog::add_action(launch_sphereknot);
#if CAP_SOLV
dialog::addItem("a portal in Solv geometry", 'e');
dialog::add_action(launch_solv);
#endif
dialog::display();
});
@ -1549,3 +1563,4 @@ auto hook1=
}
}
#endif

View File

@ -214,8 +214,10 @@ auto hooks =
set_geometry(gRotSpace);
slide_backup(rots::underlying_scale, .25);
slide_backup(qmode, m);
#if CAP_RAY
slide_backup(ray::max_cells, 32768);
slide_backup(ray::fixed_map, true);
#endif
slide_backup(smooth_scrolling, true);
slide_backup(camera_speed, .1);
enable();
@ -238,9 +240,11 @@ auto hooks =
set_geometry(gRotSpace);
slide_backup(rots::underlying_scale, .25);
slide_backup(qmode, m);
#if CAP_RAY
slide_backup(ray::max_cells, 32768);
slide_backup(ray::fixed_map, true);
slide_backup(ray::want_use, 2);
#endif
slide_backup(smooth_scrolling, true);
slide_backup(camera_speed, .1);
enable();