Pixelated rendering for modern skins

This commit is contained in:
Jordan Eldredge 2021-07-17 14:02:54 -07:00
parent be2361906f
commit 3b09d2f8b1
2 changed files with 9 additions and 4 deletions

View file

@ -212,6 +212,13 @@ export class UIRoot {
assume(false, `Unknown global action: ${action}`);
}
}
draw() {
this._div.style.imageRendering = "pixelated";
for (const container of this.getContainers()) {
container.draw();
this._div.appendChild(container.getDiv());
}
}
dispose() {
this._div.remove();

View file

@ -39,16 +39,14 @@ async function loadSkin(skinData: Blob) {
setStatus("Parsing XML and initializing images...");
const parser = new SkinParser(zip, UI_ROOT);
// This is always the same as the global singleton.
const uiRoot = await parser.parse();
setStatus("Enabling Colors...");
uiRoot.enableDefaultGammaSet();
setStatus("Rendering skin for the first time...");
for (const container of uiRoot.getContainers()) {
container.draw();
UI_ROOT.getRootDiv().appendChild(container.getDiv());
}
uiRoot.draw();
setStatus("Initializing Maki...");
for (const container of uiRoot.getContainers()) {