mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
fixed read_model() which was crashing
This commit is contained in:
parent
d11b768bf1
commit
528cf9867a
@ -600,7 +600,7 @@ vector<geometryinfo> ginf = {
|
||||
#define X3(x) x, x, x
|
||||
|
||||
/** list of available models (i.e., projections) */
|
||||
const modelinfo mdinf[int(mdPolynomial)+1] = {
|
||||
vector<modelinfo> mdinf = {
|
||||
{"disk/Gans", "general perspective", "general perspective", mf::azimuthal | mf::conformal},
|
||||
{"half-plane", "inversion", "half-plane", mf::conformal},
|
||||
{"band", "band", "Mercator", mf::band | mf::conformal},
|
||||
@ -629,7 +629,7 @@ const modelinfo mdinf[int(mdPolynomial)+1] = {
|
||||
{X3("Mollweide"), mf::euc_boring | mf::pseudoband | mf::equiarea },
|
||||
{X3("central cylindrical"), mf::euc_boring | mf::band },
|
||||
{X3("Collignon"), mf::pseudoband | mf::equiarea },
|
||||
{X3(""), 0},
|
||||
{X3("guard"), 0},
|
||||
{X3("polynomial"), mf::conformal}
|
||||
};
|
||||
|
||||
|
@ -350,6 +350,6 @@ struct modelinfo {
|
||||
const char* name;
|
||||
};
|
||||
|
||||
extern const modelinfo mdinf[int(mdPolynomial)+1];
|
||||
extern std::vector<modelinfo> mdinf;
|
||||
|
||||
}
|
||||
|
@ -658,7 +658,7 @@ EX namespace models {
|
||||
#if CAP_COMMANDLINE
|
||||
|
||||
eModel read_model(const string& ss) {
|
||||
for(int i=0; i<isize(ginf); i++) {
|
||||
for(int i=0; i<isize(mdinf); i++) {
|
||||
if(appears(mdinf[i].name_hyperbolic, ss)) return eModel(i);
|
||||
if(appears(mdinf[i].name_euclidean, ss)) return eModel(i);
|
||||
if(appears(mdinf[i].name_spherical, ss)) return eModel(i);
|
||||
|
Loading…
Reference in New Issue
Block a user