mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
now compiles in C++11
This commit is contained in:
parent
ebfd17f6a1
commit
86c9f84df8
17
crystal.cpp
17
crystal.cpp
@ -147,7 +147,9 @@ struct crystal_structure {
|
|||||||
next_insert(a, prev[a][at], val);
|
next_insert(a, prev[a][at], val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int errors = 0;
|
int errors;
|
||||||
|
|
||||||
|
crystal_structure() { errors = 0; }
|
||||||
|
|
||||||
bool may_next_insert(int a, int at, int val) {
|
bool may_next_insert(int a, int at, int val) {
|
||||||
if(isize(next[a]) != dir) {
|
if(isize(next[a]) != dir) {
|
||||||
@ -407,9 +409,12 @@ struct hrmap_crystal : hrmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ldcoord get_coord(cell *c) {
|
ldcoord get_coord(cell *c) {
|
||||||
auto b = sgc.emplace(c, ldc0);
|
// in C++14?
|
||||||
ldcoord& res = b.first->second;
|
// auto b = sgc.emplace(c, ldc0);
|
||||||
if(b.second) {
|
// ldcoord& res = b.first->second;
|
||||||
|
if(sgc.count(c)) return sgc[c];
|
||||||
|
ldcoord& res = (sgc[c] = ldc0);
|
||||||
|
{ // if(b.second) {
|
||||||
if(BITRUNCATED && c->master->c7 != c) {
|
if(BITRUNCATED && c->master->c7 != c) {
|
||||||
for(int i=0; i<c->type; i+=2)
|
for(int i=0; i<c->type; i+=2)
|
||||||
res = res + told(hcoords[c->cmove(i)->master]);
|
res = res + told(hcoords[c->cmove(i)->master]);
|
||||||
@ -486,8 +491,8 @@ void create_step(heptagon *h, int d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
array<array<int,2>, MAX_EDGE> distlimit_table = {{
|
array<array<int,2>, MAX_EDGE> distlimit_table = {{
|
||||||
{SEE_ALL,SEE_ALL}, {SEE_ALL,SEE_ALL}, {SEE_ALL,SEE_ALL}, {SEE_ALL,SEE_ALL}, {15, 10},
|
{{SEE_ALL,SEE_ALL}}, {{SEE_ALL,SEE_ALL}}, {{SEE_ALL,SEE_ALL}}, {{SEE_ALL,SEE_ALL}}, {{15, 10}},
|
||||||
{6, 4}, {5, 3}, {4, 3}, {4, 3}, {3, 2}, {3, 2}, {3, 2}, {3, 2}, {3, 2}
|
{{6, 4}}, {{5, 3}}, {{4, 3}}, {{4, 3}}, {{3, 2}}, {{3, 2}}, {{3, 2}}, {{3, 2}}, {{3, 2}}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
color_t colorize(cell *c) {
|
color_t colorize(cell *c) {
|
||||||
|
3
hyper.h
3
hyper.h
@ -4334,7 +4334,8 @@ inline void special_log(char c) { putchar(c); }
|
|||||||
|
|
||||||
struct logger : hstream {
|
struct logger : hstream {
|
||||||
int indentation;
|
int indentation;
|
||||||
bool doindent = false;
|
bool doindent;
|
||||||
|
logger() { doindent = false; }
|
||||||
virtual void write_char(char c) { if(doindent) { doindent = false; for(int i=0; i<indentation; i++) special_log(' '); } special_log(c); if(c == 10) doindent = true; }
|
virtual void write_char(char c) { if(doindent) { doindent = false; for(int i=0; i<indentation; i++) special_log(' '); } special_log(c); if(c == 10) doindent = true; }
|
||||||
virtual char read_char() { throw hstream_exception(); }
|
virtual char read_char() { throw hstream_exception(); }
|
||||||
};
|
};
|
||||||
|
2
rug.cpp
2
rug.cpp
@ -981,7 +981,7 @@ int detect_cusps() {
|
|||||||
max_edge_length = max(max_edge_length, e.len);
|
max_edge_length = max(max_edge_length, e.len);
|
||||||
anticusp_dist = anticusp_factor * max_edge_length;
|
anticusp_dist = anticusp_factor * max_edge_length;
|
||||||
|
|
||||||
array<int, 3> stats = {0,0,0};
|
array<int, 3> stats = {{0,0,0}};
|
||||||
|
|
||||||
map<bincode, vector<rugpoint*> > code_to_point;
|
map<bincode, vector<rugpoint*> > code_to_point;
|
||||||
for(auto p: points) if(p->valid)
|
for(auto p: points) if(p->valid)
|
||||||
|
Loading…
Reference in New Issue
Block a user