changed //EX to #if HDR; removed #if EX

This commit is contained in:
Zeno Rogue 2019-08-09 19:03:29 +02:00
parent 24a2e6178a
commit 85e9e7cd11
3 changed files with 21 additions and 11 deletions

View File

@ -6,7 +6,7 @@
namespace hr {
EX namespace binary {
#if EX CAP_BT
#if CAP_BT
enum bindir {
bd_right = 0,

View File

@ -20,6 +20,7 @@ void mark_file() {
bool do_endif;
bool in_hdr;
void gen(string s) {
which_file = s;
@ -28,16 +29,18 @@ void gen(string s) {
while(getline(in, s)) {
while(s != "" && s[0] == ' ') s = s.substr(1);
while(s.back() == 10 || s.back() == 13) s = s.substr(0, s.size() - 1);
if(s.substr(0, 7) == "#if EX ") {
cout << ind() << s << "\n";
do_endif = true;
if(in_hdr) {
if(s == "#endif" && in_hdr) {
in_hdr = false;
}
else cout << ind() << s << "\n";
continue;
}
if(s.substr(0, 4) == "//EX") {
auto t = s.substr(4);
while(t != "" && t[0] == ' ') t = t.substr(1);
cout << ind() << t << "\n";
if(s == "#if HDR") {
in_hdr = true;
}
if(s.substr(0, 4) == "EX }") {
mark_file();
cout << ind() << "}\n";
indent -= 2;
}
@ -49,6 +52,7 @@ void gen(string s) {
indent += 2;
}
else {
mark_file();
for(int i=0;; i++) {
if(i == int(t.size())) { cerr << "Error: unrecognizable EX: " << s << "\n"; }
else if(t[i] == '{') {

View File

@ -9,7 +9,9 @@ EX namespace nisot {
typedef array<float, 3> ptlow;
EX transmatrix local_perspective;
//EX inline bool local_perspective_used() { return nonisotropic; }
#if HDR
inline bool local_perspective_used() { return nonisotropic; }
#endif
EX bool geodesic_movement = true;
@ -443,7 +445,9 @@ EX namespace nilv {
hyperpoint mvec_to_point(mvec m) { return hpxy3(m[0], m[1], m[2]); }
//EX static const int nilv_S7 = 8;
#if HDR
static const int nilv_S7 = 8;
#endif
array<mvec, nilv_S7> movevectors = {{ mvec(-1,0,0), mvec(-1,0,1), mvec(0,-1,0), mvec(0,0,-1), mvec(1,0,0), mvec(1,0,-1), mvec(0,1,0), mvec(0,0,1) }};
@ -546,7 +550,9 @@ EX namespace nisot {
return true;
}
//EX enum iePrecision { iLazy, iTable };
#if HDR
enum iePrecision { iLazy, iTable };
#endif
EX hyperpoint inverse_exp(const hyperpoint h, iePrecision p) {
if(sol) return solv::get_inverse_exp(h, p == iLazy);