Skip to content

Commit

Permalink
fixed #23
Browse files Browse the repository at this point in the history
  • Loading branch information
nekit508 committed Apr 24, 2024
1 parent b0a5d3e commit 57f7bb8
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/fos/graphics/FOSOreRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class FOSOreRenderer {
vertexSize = 2 + 1 + 2,
spriteSize = vertexSize * 4,
maxSprites = chunkSize * chunkSize * 9;
private static final float pad = tilesize/2f;
private static final float pad = tilesize / 2f;
private static final boolean dynamic = false;

private float[] vertices = new float[maxSprites * vertexSize * 4];
Expand Down Expand Up @@ -100,14 +100,12 @@ void main(){

/** Queues up a cache change for a tile. Only runs in render loop. */
public void recacheTile(Tile tile){
//recaching all layers may not be necessary
recacheSet.add(Point2.pack(tile.x / chunkSize, tile.y / chunkSize));
}

public void drawOre(){
if(cache == null){
if(cache == null)
return;
}

Camera camera = Core.camera;

Expand Down Expand Up @@ -145,9 +143,8 @@ public void drawOre(){
}

IntSet.IntSetIterator it = drawnLayerSet.iterator();
while(it.hasNext){
while(it.hasNext)
drawnLayers.add(it.next());
}

drawnLayers.sort();

Expand Down Expand Up @@ -205,9 +202,8 @@ public void checkChanges(){
}

public void beginDraw(){
if(cache == null){
if(cache == null)
return;
}

Draw.flush();

Expand All @@ -217,17 +213,15 @@ public void beginDraw(){
}

public void endDraw(){
if(cache == null){
if(cache == null)
return;
}

endc();
}

public void drawLayer(CacheLayer layer){
if(cache == null){
if(cache == null)
return;
}

Camera camera = Core.camera;

Expand Down

0 comments on commit 57f7bb8

Please sign in to comment.