unsynchronized tile rendering
This commit is contained in:
parent
99db881d43
commit
43759f2d21
@ -129,9 +129,7 @@ public class TileRenderer {
|
|||||||
return renderImage(layer, tileX, tileY, zoom, true);
|
return renderImage(layer, tileX, tileY, zoom, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized BufferedImage renderImage(Layer layer, int tileX, int tileY, int zoom, boolean usecache) throws IllegalArgumentException, DataFormatException, IOException, ExecutionException {
|
public BufferedImage renderImage(Layer layer, int tileX, int tileY, int zoom, boolean usecache) throws IllegalArgumentException, DataFormatException, IOException, ExecutionException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Check if binary cached, use cached version for rendering
|
//Check if binary cached, use cached version for rendering
|
||||||
if (usecache && cache.has(layer.id, tileX, tileY, zoom)) {
|
if (usecache && cache.has(layer.id, tileX, tileY, zoom)) {
|
||||||
@ -142,22 +140,6 @@ public class TileRenderer {
|
|||||||
return ImageIO.read(new ByteArrayInputStream(data));
|
return ImageIO.read(new ByteArrayInputStream(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Second cache check in critical section
|
|
||||||
//Check if binary cached, use cached version for rendering
|
|
||||||
if (usecache && cache.has(layer.id, tileX, tileY, zoom)) {
|
|
||||||
byte[] data = cache.get(layer.id, tileX, tileY, zoom);
|
|
||||||
|
|
||||||
if (data != null && data.length > 0)
|
|
||||||
//In case the cache disappears
|
|
||||||
return ImageIO.read(new ByteArrayInputStream(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BufferedImage tile = createTile();
|
BufferedImage tile = createTile();
|
||||||
|
|
||||||
//16x16 mapblocks on a tile
|
//16x16 mapblocks on a tile
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
tilerenderer.initialrendering.enable=true
|
#tilerenderer.initialrendering.enable=true
|
||||||
|
|
||||||
#log.tile.updatetimings=true
|
#log.tile.updatetimings=true
|
||||||
tilerenderer.updateinterval=10
|
tilerenderer.updateinterval=10
|
||||||
@ -10,4 +10,4 @@ minetest.db.url=jdbc:postgresql://127.0.0.1:5432/postgres
|
|||||||
static.files.location=src/main/resources/public
|
static.files.location=src/main/resources/public
|
||||||
|
|
||||||
# local save
|
# local save
|
||||||
debug.mapblock.save=true
|
#debug.mapblock.save=true
|
Loading…
x
Reference in New Issue
Block a user