mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-15 01:34:48 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f738adbdef | ||
|
|
70d15f2383 | ||
|
|
d66b5577f4 | ||
|
|
e293f12fb8 | ||
|
|
b69eca6749 | ||
|
|
03342f08c6 | ||
|
|
b85614f983 |
No files matched your search
@@ -8,19 +8,19 @@
|
||||
* It's the angel that pulls you out of OptiFine's hell -Roadhog360
|
||||
|
||||
## **Beta Quality - Here there be Dragons**
|
||||
* Shaders sneak preview - Please don't report issues yet, but please do submit fixes
|
||||
* Shaders - Beta
|
||||
* Complementary & BSL mostly function, but have some bugs
|
||||
* Sildurs, Seus, and any other shader probably doesn't work
|
||||
|
||||
|
||||
# Required Dependencies
|
||||
* [UniMixins](https://github.com/LegacyModdingMC/UniMixins/releases) >= 0.1.14
|
||||
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.4.2
|
||||
* [UniMixins](https://github.com/LegacyModdingMC/UniMixins/releases) >= 0.1.19
|
||||
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.5.20
|
||||
* NOTE: Some mods are not required, but a specific version is required if present - see: `Permanent Incompatibilities` below.
|
||||
|
||||
# Known (temporary) Incompatibilities
|
||||
* Forge Relocation - Currently non Thread Safe; safe if not in use
|
||||
* ProjectRed Frames - Currently non Thread Safe; safe if not in use'
|
||||
* ProjectRed Frames - Currently non Thread Safe; safe if not in use
|
||||
|
||||
# Potential Incompatibilities
|
||||
* EndlessIDs - Compat commits have been made, might work, might not - not fully tested
|
||||
|
||||
@@ -148,4 +148,13 @@ public class AngelicaConfig {
|
||||
@Config.RangeInt(min = 64, max = 1024)
|
||||
public static int itemRendererDisplayListCacheSize;
|
||||
|
||||
@Config.Comment("Render distance for the spinning mob inside mod spawners")
|
||||
@Config.DefaultDouble(16D)
|
||||
@Config.RangeDouble(min = 16D, max = 64D)
|
||||
public static double mobSpawnerRenderDistance;
|
||||
|
||||
@Config.Comment("Switches to an alternate FPS limiter that gives more stable frametimes, in exchange for slightly " +
|
||||
"more latency. Will never introduce more than one frame of latency, and has a lower impact at higher framerates.")
|
||||
@Config.DefaultBoolean(false)
|
||||
public static boolean sleepBeforeSwap;
|
||||
}
|
||||
@@ -69,6 +69,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.DoubleBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -960,32 +961,52 @@ public class GLStateManager {
|
||||
glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j);
|
||||
}
|
||||
|
||||
public static void glDrawArrays(int mode, int first, int count) {
|
||||
// Iris -- TODO: This doesn't seem to work and is related to matchPass()
|
||||
if(AngelicaConfig.enableIris) {
|
||||
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
|
||||
}
|
||||
GL11.glDrawArrays(mode, first, count);
|
||||
}
|
||||
|
||||
public static void glDrawBuffer(int mode) {
|
||||
GL11.glDrawBuffer(mode);
|
||||
}
|
||||
|
||||
public static void glDrawElements(int mode, IntBuffer indices) {
|
||||
if(AngelicaConfig.enableIris) {
|
||||
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
|
||||
}
|
||||
GL11.glDrawElements(mode, indices);
|
||||
}
|
||||
|
||||
public static void glBegin(int mode) {
|
||||
public static void trySyncProgram() {
|
||||
if (AngelicaConfig.enableIris) {
|
||||
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
|
||||
}
|
||||
}
|
||||
|
||||
public static void glBegin(int mode) {
|
||||
trySyncProgram();
|
||||
GL11.glBegin(mode);
|
||||
}
|
||||
|
||||
public static void glDrawElements(int mode, ByteBuffer indices) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawElements(mode, indices);
|
||||
}
|
||||
|
||||
public static void glDrawElements(int mode, IntBuffer indices) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawElements(mode, indices);
|
||||
}
|
||||
|
||||
public static void glDrawElements(int mode, ShortBuffer indices) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawElements(mode, indices);
|
||||
}
|
||||
|
||||
public static void glDrawElements(int mode, int indices_count, int type, long indices_buffer_offset) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawElements(mode, indices_count, type, indices_buffer_offset);
|
||||
}
|
||||
|
||||
public static void glDrawElements(int mode, int count, int type, ByteBuffer indices) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawElements(mode, count, type, indices);
|
||||
}
|
||||
|
||||
public static void glDrawBuffer(int mode) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawBuffer(mode);
|
||||
}
|
||||
|
||||
public static void glDrawArrays(int mode, int first, int count) {
|
||||
trySyncProgram();
|
||||
GL11.glDrawArrays(mode, first, count);
|
||||
}
|
||||
|
||||
public static void glLogicOp(int opcode) {
|
||||
GL11.glLogicOp(opcode);
|
||||
}
|
||||
@@ -1240,6 +1261,7 @@ public class GLStateManager {
|
||||
if(list < 0) {
|
||||
VBOManager.get(list).render();
|
||||
} else {
|
||||
trySyncProgram();
|
||||
GL11.glCallList(list);
|
||||
if(glListChanges.containsKey(list)) {
|
||||
for(Map.Entry<IStateStack<?>, ISettableState<?>> entry : glListChanges.get(list)) {
|
||||
|
||||
@@ -137,6 +137,7 @@ public enum Mixins {
|
||||
,"sodium.MixinRenderGlobal"
|
||||
,"sodium.MixinWorldClient"
|
||||
,"sodium.MixinTileEntity"
|
||||
,"sodium.MixinTileEntityMobSpawner"
|
||||
,"sodium.MixinEffectRenderer"
|
||||
,"sodium.MixinTileEntityRendererDispatcher"
|
||||
,"sodium.MixinLongHashMap"
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
package jss.notfine.proxy;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import jss.notfine.config.NotFineConfig;
|
||||
import jss.notfine.core.Settings;
|
||||
import jss.notfine.core.SettingsManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
if(!NotFineConfig.allowAdvancedOpenGL) {
|
||||
Minecraft.getMinecraft().gameSettings.advancedOpengl = false;
|
||||
}
|
||||
@@ -29,12 +33,13 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) { }
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
SettingsManager.settingsFile.loadSettings();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldLoad(WorldEvent.Load event) {
|
||||
SettingsManager.graphicsUpdated();
|
||||
}
|
||||
}
|
||||
@@ -127,6 +127,15 @@ public class SodiumGameOptionPages {
|
||||
}
|
||||
}, (opts) -> opts.fullScreen)
|
||||
.build())
|
||||
.add(OptionImpl.createBuilder(boolean.class, angelicaOpts)
|
||||
.setName(I18n.format("options.angelica.sleepbeforeswap"))
|
||||
.setTooltip(I18n.format("options.angelica.sleepbeforeswap.tooltip"))
|
||||
.setControl(TickBoxControl::new)
|
||||
.setBinding((opts, value) -> {
|
||||
AngelicaConfig.sleepBeforeSwap = value;
|
||||
}, opts -> AngelicaConfig.sleepBeforeSwap)
|
||||
.setImpact(OptionImpact.VARIES)
|
||||
.build())
|
||||
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
|
||||
.setName(I18n.format("options.vsync"))
|
||||
.setTooltip(I18n.format("sodium.options.v_sync.tooltip"))
|
||||
@@ -164,6 +173,15 @@ public class SodiumGameOptionPages {
|
||||
.setImpact(OptionImpact.MEDIUM)
|
||||
.build()
|
||||
)
|
||||
.add(
|
||||
OptionImpl.createBuilder(int.class, angelicaOpts)
|
||||
.setName(I18n.format("options.angelica.mobSpawnerRenderDistance"))
|
||||
.setTooltip(I18n.format("options.angelica.mobSpawnerRenderDistance.tooltip"))
|
||||
.setControl(option -> new SliderControl(option, 16, 64, 1, ControlValueFormatter.number()))
|
||||
.setBinding((options, value) -> AngelicaConfig.mobSpawnerRenderDistance = value, options -> (int) AngelicaConfig.mobSpawnerRenderDistance)
|
||||
.setImpact(OptionImpact.MEDIUM)
|
||||
.build()
|
||||
)
|
||||
.build());
|
||||
|
||||
return new OptionPage(I18n.format("stat.generalButton"), ImmutableList.copyOf(groups));
|
||||
@@ -178,8 +196,10 @@ public class SodiumGameOptionPages {
|
||||
.setTooltip(I18n.format("sodium.options.graphics_quality.tooltip"))
|
||||
.setControl(option -> new CyclingControl<>(option, GraphicsMode.class))
|
||||
.setBinding(
|
||||
(opts, value) -> { opts.fancyGraphics = value.isFancy();
|
||||
SettingsManager.graphicsUpdated(); },
|
||||
(opts, value) -> {
|
||||
opts.fancyGraphics = value.isFancy();
|
||||
SettingsManager.graphicsUpdated();
|
||||
},
|
||||
opts -> GraphicsMode.fromBoolean(opts.fancyGraphics))
|
||||
.setImpact(OptionImpact.HIGH)
|
||||
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
|
||||
|
||||
@@ -137,8 +137,12 @@ options.dynamic_lights_shader_force=Dynamic Lights - Forced With Shaders
|
||||
options.dynamic_lights_shader_force.tooltip=Enabled - Dynamic Lights are shown even when a shader is active, Disabled - Dynamic Lights are disabled when a shader is active.
|
||||
options.angelica.droppedItemLimit=Dropped Item Render Limit
|
||||
options.angelica.droppedItemLimit.tooltip=The maximum number of dropped items that will be rendered. Lower values can improve performance.
|
||||
options.angelica.mobSpawnerRenderDistance=Mod spawner render distance
|
||||
options.angelica.mobSpawnerRenderDistance.tooltip=Render distance for the spinning mob inside mod spawners
|
||||
options.angelica.itemdisplaylistcount=Item Renderer Display List Cache Size
|
||||
options.angelica.itemdisplaylistcount.tooltip=The maximum number of display lists to cache in the optimized item renderer. Higher values will increase performance but increase VRAM usage.
|
||||
options.angelica.sleepbeforeswap=Alternate FPS Limiter
|
||||
options.angelica.sleepbeforeswap.tooltip=Switches to an alternate FPS limiter that gives more stable frametimes, in exchange for slightly more latency. Will never introduce more than one frame of latency, and has a lower impact at higher framerates.
|
||||
pack.iris.select.title=Select
|
||||
pack.iris.configure.title=Configure
|
||||
label.iris.true=On
|
||||
|
||||
+32
-1
@@ -1,7 +1,10 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.angelica;
|
||||
|
||||
import com.gtnewhorizons.angelica.AngelicaMod;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.IGameSettingsExt;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
@@ -14,10 +17,16 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Minecraft.class)
|
||||
public class MixinMinecraft {
|
||||
public abstract class MixinMinecraft {
|
||||
@Shadow
|
||||
public GameSettings gameSettings;
|
||||
|
||||
@Shadow
|
||||
public abstract boolean isFramerateLimitBelowMax();
|
||||
|
||||
@Shadow
|
||||
public abstract int getLimitFramerate();
|
||||
|
||||
@Unique
|
||||
private long angelica$lastFrameTime = 0;
|
||||
|
||||
@@ -29,16 +38,38 @@ public class MixinMinecraft {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "func_147120_f",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;update()V", shift = At.Shift.BEFORE, remap = false)
|
||||
)
|
||||
private void angelica$limitFPS(CallbackInfo ci) {
|
||||
if (!AngelicaConfig.sleepBeforeSwap) return;
|
||||
if (isFramerateLimitBelowMax()) {
|
||||
final long target = angelica$lastFrameTime + (long) (1.0 / getLimitFramerate() * 1_000_000) * 1_000;
|
||||
while (target - System.nanoTime() > 100) {
|
||||
Thread.yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "func_147120_f",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;update()V", shift = At.Shift.AFTER, remap = false)
|
||||
)
|
||||
private void angelica$trackFrametimes(CallbackInfo ci) {
|
||||
if (AngelicaMod.proxy == null) return;
|
||||
|
||||
long time = System.nanoTime();
|
||||
AngelicaMod.proxy.putFrametime(time - angelica$lastFrameTime);
|
||||
angelica$lastFrameTime = time;
|
||||
}
|
||||
|
||||
@WrapOperation(method = "runGameLoop", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;sync(I)V"))
|
||||
private void angelica$noopFPSLimiter(int fps, Operation<Void> original) {
|
||||
if (AngelicaConfig.sleepBeforeSwap) return;
|
||||
original.call(fps);
|
||||
}
|
||||
|
||||
@Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreen;isShiftKeyDown()Z", shift = At.Shift.AFTER))
|
||||
private void angelica$setShowFpsGraph(CallbackInfo ci) {
|
||||
((IGameSettingsExt) gameSettings).angelica$setShowFpsGraph(Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU));
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(TileEntityMobSpawner.class)
|
||||
public class MixinTileEntityMobSpawner extends TileEntity {
|
||||
|
||||
@Override
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
final double d = AngelicaConfig.mobSpawnerRenderDistance;
|
||||
return d * d;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user