mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-21 21:02:15 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e158faada0 |
No files matched your search
@@ -236,6 +236,9 @@ public class GLStateManager {
|
||||
|
||||
}
|
||||
|
||||
public static boolean isMainThread() {
|
||||
return Thread.currentThread() == MainThread;
|
||||
}
|
||||
|
||||
public static void assertMainThread() {
|
||||
if (Thread.currentThread() != CurrentThread && !runningSplash) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class TextureInfoCache {
|
||||
}
|
||||
|
||||
public TextureInfo getInfo(int id) {
|
||||
if(id < 0) return null;
|
||||
if(id < 0 || !GLStateManager.isMainThread()) return null;
|
||||
return cache.computeIfAbsent(id, TextureInfo::new);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class TextureInfoCache {
|
||||
}
|
||||
|
||||
public void onDeleteTexture(int id) {
|
||||
if(id >= 0) cache.remove(id);
|
||||
if(id >= 0 && GLStateManager.isMainThread()) cache.remove(id);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user