mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-23 00:54:47 +00:00
improved in the OO fashion: draw, relative_matrix, create_step, and several minor functions are now virtual in hrmap
This commit is contained in:
12
cell.cpp
12
cell.cpp
@@ -39,16 +39,11 @@ struct cdata {
|
||||
hrmap *currentmap;
|
||||
vector<hrmap*> allmaps;
|
||||
|
||||
// --- auxiliary hyperbolic map for horocycles ---
|
||||
struct hrmap_alternate : hrmap {
|
||||
heptagon *origin;
|
||||
hrmap_alternate(heptagon *o) { origin = o; }
|
||||
~hrmap_alternate() { clearfrom(origin); }
|
||||
};
|
||||
|
||||
hrmap *newAltMap(heptagon *o) { return new hrmap_alternate(o); }
|
||||
hrmap *newAltMap(heptagon *o) { return new hrmap_hyperbolic(o); }
|
||||
// --- hyperbolic geometry ---
|
||||
|
||||
hrmap_hyperbolic::hrmap_hyperbolic(heptagon *o) { origin = o; }
|
||||
|
||||
hrmap_hyperbolic::hrmap_hyperbolic() {
|
||||
// printf("Creating hyperbolic map: %p\n", this);
|
||||
origin = tailored_alloc<heptagon> (S7);
|
||||
@@ -235,6 +230,7 @@ void initcells() {
|
||||
else if(DIM == 3 && !binarytiling) currentmap = reg3::new_map();
|
||||
else if(sphere) currentmap = new hrmap_spherical;
|
||||
else if(quotient) currentmap = new quotientspace::hrmap_quotient;
|
||||
else if(binarytiling) currentmap = binary::new_map();
|
||||
else currentmap = new hrmap_hyperbolic;
|
||||
|
||||
allmaps.push_back(currentmap);
|
||||
|
||||
Reference in New Issue
Block a user