WIP logic display transform matrix support

This commit is contained in:
Anuken
2024-02-26 10:29:14 -05:00
parent 755c369496
commit e3b24ac980
3 changed files with 76 additions and 6 deletions

View File

@@ -1025,14 +1025,17 @@ public class LExecutor{
exec.textBuffer.setLength(0);
}
}else{
int num1 = exec.numi(p1);
int num1 = exec.numi(p1), xval = packSign(exec.numi(x)), yval = packSign(exec.numi(y));
if(type == LogicDisplay.commandImage){
num1 = exec.obj(p1) instanceof UnlockableContent u ? u.iconId : 0;
}else if(type == LogicDisplay.commandScale){
xval = packSign((int)(exec.numf(x) / LogicDisplay.scaleStep));
yval = packSign((int)(exec.numf(y) / LogicDisplay.scaleStep));
}
//add graphics calls, cap graphics buffer size
exec.graphicsBuffer.add(DisplayCmd.get(type, packSign(exec.numi(x)), packSign(exec.numi(y)), packSign(num1), packSign(exec.numi(p2)), packSign(exec.numi(p3)), packSign(exec.numi(p4))));
exec.graphicsBuffer.add(DisplayCmd.get(type, xval, yval, packSign(num1), packSign(exec.numi(p2)), packSign(exec.numi(p3)), packSign(exec.numi(p4))));
}
}

View File

@@ -260,6 +260,13 @@ public class LStatements{
}, 2, cell -> cell.size(165, 50)));
}, Styles.logict, () -> {}).size(165, 40).color(s.color).left().padLeft(2);
}
case translate, scale -> {
fields(s, "x", x, v -> x = v);
fields(s, "y", y, v -> y = v);
}
case rotate -> {
fields(s, "degrees", p1, v -> p1 = v);
}
}
}).expand().left();
}