better way of checking if a chunk needs VBO creation
old way had some concurrency issues on slower hardware
This commit is contained in:
parent
c7505cb8ce
commit
620dc275d1
|
@ -167,8 +167,8 @@ public class TileMap extends TileContainer implements Disposable {
|
|||
if (!isUpdating())
|
||||
return true; // done updating (or we were never updating in the first place ...)
|
||||
|
||||
if (updater.isWaitingForVboCreation()) {
|
||||
TileChunk chunkNeedingVboCreation = updater.chunkNeedingVboCreation;
|
||||
if (chunkNeedingVboCreation != null) {
|
||||
ChunkVertexGenerator.GeneratedChunkMeshes meshes = vertexGenerator.createMeshFromVertices();
|
||||
chunkNeedingVboCreation.setMeshes(meshes);
|
||||
updater.signalDoneVboCreation();
|
||||
|
|
|
@ -24,6 +24,10 @@ public class TileMapUpdater implements Runnable {
|
|||
return chunkNeedingVboCreation;
|
||||
}
|
||||
|
||||
public boolean isWaitingForVboCreation() {
|
||||
return waitingForVboCreation;
|
||||
}
|
||||
|
||||
public synchronized void signalDoneVboCreation() {
|
||||
waitingForVboCreation = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue