Refactor DiceOS to use ResourceLoader for texture management and remove unused background texture
This commit is contained in:
@@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
Reference in New Issue
Block a user