1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-24 06:50:09 +00:00

rogueviz::objmodels:: root option

This commit is contained in:
Zeno Rogue 2021-09-30 11:37:53 +02:00
parent d29cf4bda5
commit 36ee3b7ebe

View File

@ -21,6 +21,8 @@ bool model::available() {
return false; return false;
} }
bool root = false;
void model::load_obj(model_data& md) { void model::load_obj(model_data& md) {
md.prec_used = prec; md.prec_used = prec;
@ -69,9 +71,9 @@ void model::load_obj(model_data& md) {
if(s == "Kd") { if(s == "Kd") {
ld a, b, c; ld a, b, c;
scan(fsm, a, b, c); scan(fsm, a, b, c);
part(nextcol, 1) = a * 319.99; part(nextcol, 3) = root ? sqrt(a) * 255.99 : a * 319.99;
part(nextcol, 2) = b * 319.99; part(nextcol, 2) = root ? sqrt(b) * 255.99 : b * 319.99;
part(nextcol, 3) = c * 319.99; part(nextcol, 1) = root ? sqrt(c) * 255.99 : c * 319.99;
} }
if(s == "newmtl") { if(s == "newmtl") {
emit_material(); emit_material();