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