Skip to content

Commit 0c87707

Browse files
added buffer to imgae painting + changed directory of maps
1 parent c32539b commit 0c87707

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

TestITProjekt.jar

206 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

src/Stage/Commons.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public interface Commons {
4646

4747
// File path for sprites
4848
final String directoryToSprites = "sprites/";
49-
final String directoryToMaps = "src/LevelDesignTools/";
49+
final String directoryToMaps = "sprites/Maps/";
5050

5151

5252
// Game Piece config variables //

src/Stage/StagePanel.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,9 @@ private static void initFortresses() {
302302
// graphics methode does all the drawing of objects (renders everything)
303303
public void paintComponent(Graphics g) {
304304

305-
// if(!createBufferAsBufferedImage()) {
306-
// return;
307-
// }
308-
// Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics();
309-
Graphics2D g2d = (Graphics2D)g;
305+
if(createBufferAsBufferedImage()) {
306+
Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics();
307+
// Graphics2D g2d = (Graphics2D)g;
310308
// Draw the background
311309
g2d.setColor(new Color(28, 26, 36));
312310
g2d.fillRect(0, 0, w, h);
@@ -383,9 +381,11 @@ public void paintComponent(Graphics g) {
383381
drawCursor(g2d);
384382

385383
g2d.translate(-camera.getPos().x, -camera.getPos().y);
386-
// g.drawImage(bufferedImage, 0, 0, this);
387-
// g.dispose();
384+
g.drawImage(bufferedImage, 0, 0, this);
385+
g.dispose();
388386
g2d.dispose();
387+
}
388+
389389
}
390390

391391
private boolean createBufferAsBufferedImage() {

0 commit comments

Comments
 (0)