mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-30 04:54:07 +00:00
arb:: new command cscale
This commit is contained in:
parent
07b1eaeda5
commit
21e256fe12
@ -37,6 +37,8 @@ struct arbi_tiling {
|
|||||||
vector<shape> shapes;
|
vector<shape> shapes;
|
||||||
string name;
|
string name;
|
||||||
string comment;
|
string comment;
|
||||||
|
|
||||||
|
ld cscale;
|
||||||
|
|
||||||
geometryinfo1& get_geometry();
|
geometryinfo1& get_geometry();
|
||||||
eGeometryClass get_class() { return get_geometry().kind; }
|
eGeometryClass get_class() { return get_geometry().kind; }
|
||||||
@ -190,6 +192,7 @@ EX void load(const string& fname) {
|
|||||||
c.shapes.clear();
|
c.shapes.clear();
|
||||||
c.name = unnamed;
|
c.name = unnamed;
|
||||||
c.comment = "";
|
c.comment = "";
|
||||||
|
c.cscale = 1;
|
||||||
exp_parser ep;
|
exp_parser ep;
|
||||||
ep.s = s;
|
ep.s = s;
|
||||||
ld angleunit = 1, distunit = 1, angleofs = 0;
|
ld angleunit = 1, distunit = 1, angleofs = 0;
|
||||||
@ -271,6 +274,10 @@ EX void load(const string& fname) {
|
|||||||
affine_limit = ep.iparse();
|
affine_limit = ep.iparse();
|
||||||
ep.force_eat(")");
|
ep.force_eat(")");
|
||||||
}
|
}
|
||||||
|
else if(ep.eat("cscale(")) {
|
||||||
|
c.cscale = ep.rparse();
|
||||||
|
ep.force_eat(")");
|
||||||
|
}
|
||||||
else if(ep.eat("conway(\"")) {
|
else if(ep.eat("conway(\"")) {
|
||||||
string s = "";
|
string s = "";
|
||||||
while(true) {
|
while(true) {
|
||||||
|
@ -597,6 +597,13 @@ void geometry_information::prepare_basics() {
|
|||||||
rhexf = u->rhexf * fake::scale;
|
rhexf = u->rhexf * fake::scale;
|
||||||
hexvdist = u->hexvdist * fake::scale;
|
hexvdist = u->hexvdist * fake::scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(arb::in()) {
|
||||||
|
auto& csc = arb::current.cscale;
|
||||||
|
scalefactor = csc;
|
||||||
|
hcrossf = crossf = orbsize = hcrossf7 * csc;
|
||||||
|
hexf = rhexf = hexvdist = csc * .5;
|
||||||
|
}
|
||||||
|
|
||||||
if(scale_used()) scalefactor *= vid.creature_scale;
|
if(scale_used()) scalefactor *= vid.creature_scale;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user