mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-06 02:37:19 +00:00
mapeditor:: loading maps now sets the default settings like pmodel for 3D
This commit is contained in:
parent
23a860d405
commit
a5228b06a5
@ -522,6 +522,7 @@ EX namespace mapstream {
|
||||
}
|
||||
|
||||
EX void load_geometry(hstream& f) {
|
||||
bool was_default = pmodel == default_model();
|
||||
auto vernum = f.get_vernum();
|
||||
f.read(geometry);
|
||||
char nbtype;
|
||||
@ -649,6 +650,7 @@ EX namespace mapstream {
|
||||
}
|
||||
if(vernum >= 0xA810)
|
||||
f.read(mine_adjacency_rule);
|
||||
geometry_settings(was_default);
|
||||
}
|
||||
|
||||
EX hookset<void(fhstream&)> hooks_savemap, hooks_loadmap_old;
|
||||
|
10
system.cpp
10
system.cpp
@ -1329,6 +1329,12 @@ EX eModel default_model() {
|
||||
|
||||
EX purehookset hooks_on_geometry_change;
|
||||
|
||||
EX void geometry_settings(bool was_default) {
|
||||
if(was_default) pmodel = default_model();
|
||||
if(WDIM == 2 && (cgflags & qIDEAL) && vid.always3 && vid.texture_step < 32) vid.texture_step = 32;
|
||||
if(sl2) nisot::geodesic_movement = true;
|
||||
}
|
||||
|
||||
EX void set_geometry(eGeometry target) {
|
||||
bool was_default = pmodel == default_model();
|
||||
callhooks(hooks_on_geometry_change);
|
||||
@ -1363,9 +1369,7 @@ EX void set_geometry(eGeometry target) {
|
||||
if(INVERSE && !hybri) variation = gp::variation_for(gp::param);
|
||||
if(ginf[target].default_variation == eVariation::pure && geometry != gArchimedean)
|
||||
variation = eVariation::pure;
|
||||
if(was_default) pmodel = default_model();
|
||||
if(WDIM == 2 && (cgflags & qIDEAL) && vid.always3 && vid.texture_step < 32) vid.texture_step = 32;
|
||||
if(sl2) nisot::geodesic_movement = true;
|
||||
geometry_settings(was_default);
|
||||
|
||||
if(geometry == gArbitrary) {
|
||||
arb::convert::base_geometry = geometry;
|
||||
|
Loading…
x
Reference in New Issue
Block a user