Skip to content

Commit eda4f95

Browse files
committedFeb 25, 2025
Fix scheduling render-tasks in correct order
1 parent 9e1a197 commit eda4f95

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎common/src/main/java/de/bluecolored/bluemap/common/rendermanager/RenderManager.java

+13
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ public boolean scheduleRenderTask(RenderTask task) {
150150
}
151151
}
152152

153+
public int scheduleRenderTasks(RenderTask... tasks) {
154+
synchronized (this.renderTasks) {
155+
int count = 0;
156+
for (RenderTask task : tasks) {
157+
if (scheduleRenderTask(task)) count++;
158+
}
159+
return count;
160+
}
161+
}
162+
153163
public boolean scheduleRenderTaskNext(RenderTask task) {
154164
synchronized (this.renderTasks) {
155165
if (renderTasks.size() <= 1) return scheduleRenderTask(task);
@@ -164,6 +174,9 @@ public boolean scheduleRenderTaskNext(RenderTask task) {
164174

165175
public int scheduleRenderTasksNext(RenderTask... tasks) {
166176
synchronized (this.renderTasks) {
177+
if (renderTasks.size() <= 1)
178+
return scheduleRenderTasks(tasks);
179+
167180
int count = 0;
168181
for (int i = tasks.length - 1; i >= 0; i--) {
169182
if (scheduleRenderTaskNext(tasks[i])) count++;

0 commit comments

Comments
 (0)
Failed to load comments.