Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Same thing, more performance
Browse files Browse the repository at this point in the history
  • Loading branch information
CiroZDP committed Sep 9, 2024
1 parent b3398b6 commit 7f704e2
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/main/java/net/opencraft/renderer/screens/Menuscreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import static net.opencraft.OpenCraft.*;
import static net.opencraft.renderer.texture.Assets.*;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

Expand All @@ -31,16 +30,12 @@ private Menuscreen() {

@Override
public void render(Graphics2D g2d) {
int width = Display.width();
int height = Display.height();
final int width = Display.width();
final int height = Display.height();

g2d.setColor(Color.BLACK);

for (int x = 0; x < width; x += 64) {
for (int y = 0; y < height; y += 64) {
g2d.drawImage(oc.assets.getBackground(), x, y, 64, 64, null);
}
}
g2d.setPaint(new TexturePaint(oc.assets.getBackground(), new Rectangle(0, 0, 64, 64)));
g2d.fillRect(0, 0, width, height);

g2d.drawImage(oc.assets.getLogo(), (width - 500) / 2, (480 > height) ? 10 : 30, 500, 87, null);

Expand Down

0 comments on commit 7f704e2

Please sign in to comment.