1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-26 15:12:48 +00:00

slr:: in_actual is now exported and also actually works

This commit is contained in:
Zeno Rogue 2022-09-14 18:29:39 +02:00
parent db32bae51e
commit db3d710dd4

View File

@ -1118,6 +1118,7 @@ EX namespace hybrid {
EX geometry_information *pcgip; EX geometry_information *pcgip;
EX eGeometry actual_geometry; EX eGeometry actual_geometry;
#if HDR
template<class T> auto in_actual(const T& t) -> decltype(t()) { template<class T> auto in_actual(const T& t) -> decltype(t()) {
dynamicval<eGeometry> g(geometry, actual_geometry); dynamicval<eGeometry> g(geometry, actual_geometry);
dynamicval<geometry_information*> gc(cgip, pcgip); dynamicval<geometry_information*> gc(cgip, pcgip);
@ -1125,6 +1126,9 @@ EX namespace hybrid {
dynamicval<hrmap*> gup(pmap, NULL); dynamicval<hrmap*> gup(pmap, NULL);
return t(); return t();
} }
#define PIA(x) hr::hybrid::in_actual([&] { return (x); })
#endif
struct hrmap_hybrid : hrmap { struct hrmap_hybrid : hrmap {
@ -1360,8 +1364,8 @@ EX namespace hybrid {
#if HDR #if HDR
template<class T> auto in_underlying_geometry(const T& f) -> decltype(f()) { template<class T> auto in_underlying_geometry(const T& f) -> decltype(f()) {
if(!hybri) return f(); if(!hybri) return f();
dynamicval<eGeometry> g(geometry, underlying);
dynamicval<eGeometry> gag(actual_geometry, geometry); dynamicval<eGeometry> gag(actual_geometry, geometry);
dynamicval<eGeometry> g(geometry, underlying);
dynamicval<int> gss(underlying_cgip->single_step, cgi.single_step); dynamicval<int> gss(underlying_cgip->single_step, cgi.single_step);
dynamicval<int> gsp(underlying_cgip->psl_steps, cgi.psl_steps); dynamicval<int> gsp(underlying_cgip->psl_steps, cgi.psl_steps);
dynamicval<geometry_information*> gc(cgip, underlying_cgip); dynamicval<geometry_information*> gc(cgip, underlying_cgip);