1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-19 11:44:48 +00:00

moved wallif to parsecolor from general parse

This commit is contained in:
Zeno Rogue 2024-05-27 12:45:49 +02:00
parent ba05c94d7b
commit bb6df35bf2

View File

@ -339,13 +339,6 @@ cld exp_parser::parse(int prio) {
cld no = parsepar(); cld no = parsepar();
res = abs(cond) < 1e-8 ? yes : no; res = abs(cond) < 1e-8 ? yes : no;
} }
else if(eat("wallif(")) {
cld val0 = parse(0);
force_eat(",");
cld val1 = parsepar();
if(real(extra_params["p"]) >= 3.5) res = val0;
else res = val1;
}
else if(eat("let(")) { else if(eat("let(")) {
string name = next_token(); string name = next_token();
force_eat("="); force_eat("=");
@ -555,6 +548,15 @@ color_t exp_parser::parsecolor(int prio) {
force_eat(")"); force_eat(")");
return part_to_col(parts); return part_to_col(parts);
} }
if(eat("wallif(")) {
ld val0 = rparse();
force_eat(",");
color_t res = parsecolor();
force_eat(")");
res &= 0xFFFFFF;
if(val0 <= 0) res |= 0x1000000;
return res;
}
if(eat("rgb(")) { if(eat("rgb(")) {
array<ld, 4> parts; array<ld, 4> parts;
parts[3] = rparse(); force_eat(","); parts[3] = rparse(); force_eat(",");