Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce direct buffer allocations #45

Merged
merged 3 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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