Refactor DiceOS to use ResourceLoader for texture management and remove unused background texture

This commit is contained in:
2025-12-16 13:17:25 +01:00
parent 9320d5adc0
commit d79702ef96
3 changed files with 1 additions and 8 deletions

View File

@@ -22,7 +22,6 @@ public class DiceOS extends ApplicationAdapter {
private final DisplayService display;
private final CursorService cursorService;
private final List<OnStartup> startupTasks;
private Texture background;
private Texture clouds;
private Texture border;
private NinePatch menubar;
@@ -35,8 +34,7 @@ public class DiceOS extends ApplicationAdapter {
@Override
public void create() {
log.info("DiceOS starting...");
background = new Texture("src/main/resources/background.png");
clouds = new Texture("src/main/resources/clouds.png");
clouds = resourceLoader.loadTexture("backgrounds/clouds.png");
border = resourceLoader.loadTexture("system/border.png");
loadMenubar();
@@ -83,11 +81,6 @@ public class DiceOS extends ApplicationAdapter {
ScreenUtils.clear(Color.GREEN);
// Render background
for (int y = 0; y < display.getHeight(); y += 8) {
for (int x = 0; x < display.getWidth(); x += 8) {
display.draw(background, x, y);
}
}
display.draw(clouds, 0, 0);
// Render menubar

View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

View File

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 280 KiB