Skip to content

Commit

Permalink
Reduce direct buffer allocations (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-OOG-ah authored Dec 7, 2024
1 parent 6b2e41e commit 2e45080
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
// Add your dependencies here

dependencies {
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.46-GTNH:dev")

compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.16:api") {
compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.19:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Mantle:0.4.1:dev") {
compileOnly("com.github.GTNewHorizons:Mantle:0.4.2:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.12-GTNH:dev") {
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.16-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.6:dev") {
compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.9:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.0:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.71:dev") {
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.81:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.50.38:dev") {
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.50.78:dev") {
transitive = false
}

Expand All @@ -41,5 +41,5 @@ dependencies {
transitive = false
}

runtimeOnly("com.github.GTNewHorizons:GTNHLib:0.5.14:dev")
runtimeOnly("com.github.GTNewHorizons:GTNHLib:0.5.20:dev")
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29'
}


Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
public class LudicrousRenderEvents {

private static final int cosmicCount = 10;
public static String[] cosmicTextures = new String[cosmicCount];
public static final String[] cosmicTextures = new String[cosmicCount];

static {
for (int i = 0; i < cosmicCount; i++) {
cosmicTextures[i] = "avaritia:cosmic" + i;
}
}

public static FloatBuffer cosmicUVs = BufferUtils.createFloatBuffer(4 * cosmicTextures.length);
public static IIcon[] cosmicIcons = new IIcon[cosmicTextures.length];
public static final FloatBuffer cosmicUVs = BufferUtils.createFloatBuffer(4 * cosmicTextures.length);
public static final IIcon[] cosmicIcons = new IIcon[cosmicTextures.length];

@SubscribeEvent
public void letsMakeAQuilt(TextureStitchEvent.Pre event) {
Expand Down Expand Up @@ -63,10 +63,10 @@ public void weMadeAQuilt(TextureStitchEvent.Post event) {
@SubscribeEvent
public void pushTheCosmicFancinessToTheLimit(RenderTickEvent event) {
if (event.phase == Phase.START) {
cosmicUVs = BufferUtils.createFloatBuffer(4 * cosmicIcons.length);
for (IIcon icon : cosmicIcons) {
if (Avaritia.isHodgepodgeLoaded && icon instanceof IPatchedTextureAtlasSprite) {
((IPatchedTextureAtlasSprite) icon).markNeedsAnimationUpdate();
if (Avaritia.isHodgepodgeLoaded
&& icon instanceof IPatchedTextureAtlasSprite patchedTextureAtlasSprite) {
patchedTextureAtlasSprite.markNeedsAnimationUpdate();
}
cosmicUVs.put(icon.getMinU());
cosmicUVs.put(icon.getMinV());
Expand Down

0 comments on commit 2e45080

Please sign in to comment.