Skip to content

Commit

Permalink
- 移动了 packed 的赋值位置。
Browse files Browse the repository at this point in the history
- DEBUG log 修改。
  • Loading branch information
KasumiNova committed Sep 14, 2024
1 parent 5cd3301 commit 94e1e09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ private void injectGetVertexData(final CallbackInfoReturnable<int[]> cir) {
if (packed) {
return;
}
packed = true;
// Lazy init array
((AccessorBakedQuad) (Object) this).stellar_core$setVertexData(new int[format.getSize()]);
for (int v = 0; v < 4; v++) {
Expand All @@ -70,6 +69,7 @@ private void injectGetVertexData(final CallbackInfoReturnable<int[]> cir) {
}
}
((AccessorBakedQuad) (Object) this).stellar_core$setVertexData(StellarUnpackedDataPool.canonicalize(vertexData));
packed = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.llamalad7.mixinextras.sugar.Local;
import github.kasuminova.stellarcore.StellarCore;
import github.kasuminova.stellarcore.client.texture.SpriteBufferedImageCache;
import github.kasuminova.stellarcore.common.config.StellarCoreConfig;
import github.kasuminova.stellarcore.common.util.StellarLog;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
Expand Down Expand Up @@ -189,7 +190,9 @@ private PngSizeInfo redirectLoadTextureMakeFromResource(final IResource pngsizei
)
private IResource redirectLoadTextureGetResource(final IResourceManager instance, final ResourceLocation resourceLocation) throws IOException {
if (!stellar_core$cachedLocations.contains(resourceLocation)) {
StellarLog.LOG.info("[StellarCore-DEBUG] Loading uncached texture resource: {}", resourceLocation);
if (StellarCoreConfig.DEBUG.enableDebugLog) {
StellarLog.LOG.info("[StellarCore-DEBUG] Loading uncached texture resource: {}", resourceLocation);
}
return instance.getResource(resourceLocation);
}
return null;
Expand Down Expand Up @@ -288,7 +291,9 @@ private PngSizeInfo redirectLoadTextureAtlasMakeFromResource(final IResource png
@SuppressWarnings({"MixinAnnotationTarget", "UnresolvedMixinReference", "InvalidInjectorMethodSignature"})
private IResource redirectLoadTextureAtlasGetResource(final IResourceManager instance, final ResourceLocation resourceLocation) throws IOException {
if (!stellar_core$cachedLocations.contains(resourceLocation)) {
StellarLog.LOG.info("[StellarCore-DEBUG] Loading uncached texture resource: {}", resourceLocation);
if (StellarCoreConfig.DEBUG.enableDebugLog) {
StellarLog.LOG.info("[StellarCore-DEBUG] Loading uncached texture resource: {}", resourceLocation);
}
return instance.getResource(resourceLocation);
}
return null;
Expand Down

0 comments on commit 94e1e09

Please sign in to comment.