mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-23 21:59:44 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea4a3cdf0b | ||
|
|
65959268d0 | ||
|
|
58d820cd7e | ||
|
|
685d68bd9c |
No files matched your search
+2
-2
@@ -80,8 +80,8 @@ dependencies {
|
||||
compileOnly "org.apache.ant:ant:1.8.2"
|
||||
|
||||
// Celeritas (transitive=false: deps provided by GTNHLib/runtime)
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-common:2.5.1-GTNH") { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-lwjgl2-service:2.5.1-GTNH") { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-common:2.5.2-GTNH") { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-lwjgl2-service:2.5.2-GTNH") { transitive = false }
|
||||
|
||||
// Because who doesn't want NEI
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.35-GTNH:dev')
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.gtnewhorizon.gtnhlib.util.font.GlyphReplacements;
|
||||
import com.gtnewhorizons.angelica.config.FontConfig;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.FontRendererAccessor;
|
||||
import cpw.mods.fml.client.SplashProgress;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
import net.coderbot.iris.gl.program.Program;
|
||||
import net.coderbot.iris.gl.program.ProgramBuilder;
|
||||
@@ -508,10 +507,16 @@ public class BatchingFontRenderer {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (FontConfig.enableCustomFont) {
|
||||
if (FontConfig.enableCustomFont && FontConfig.enableGlyphReplacements) {
|
||||
String chrReplacement = GlyphReplacements.customGlyphs.get(String.valueOf(chr));
|
||||
if (chrReplacement != null) {
|
||||
chr = chrReplacement.charAt(0);
|
||||
char replacement = chrReplacement.charAt(0);
|
||||
boolean isReplacementCharAvailable =
|
||||
FontProviderCustom.getPrimary().isGlyphAvailable(replacement)
|
||||
|| FontProviderCustom.getFallback().isGlyphAvailable(replacement);
|
||||
if (isReplacementCharAvailable) {
|
||||
chr = replacement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,4 +70,11 @@ public class FontConfig {
|
||||
@Config.DefaultFloat(1.5F)
|
||||
@Config.RangeFloat(min = 0.1F, max = 3F)
|
||||
public static float customFontScale;
|
||||
|
||||
@Config.Comment({"Mods can provide Angelica with a mapping of special characters to either get replaced with " +
|
||||
"different characters or rendered using the default Unicode font. Setting this to false disables the " +
|
||||
"replacement, which is useful in cases where custom fonts have direct support for these special characters. ",
|
||||
"See for additional details: https://github.com/GTNewHorizons/Angelica/issues/1239#issuecomment-3729877936"})
|
||||
@Config.DefaultBoolean(true)
|
||||
public static boolean enableGlyphReplacements;
|
||||
}
|
||||
@@ -328,6 +328,7 @@ public class GLStateManager {
|
||||
@Getter protected static final ViewPortStateStack viewportState = new ViewPortStateStack();
|
||||
|
||||
@Getter protected static int activeProgram = 0;
|
||||
@Getter protected static int listBase = 0;
|
||||
|
||||
public static void reset() {
|
||||
runningSplash = true;
|
||||
@@ -804,6 +805,7 @@ public class GLStateManager {
|
||||
return switch (pname) {
|
||||
case GL11.GL_ALPHA_TEST_FUNC -> alphaState.getFunction();
|
||||
case GL11.GL_DEPTH_FUNC -> depthState.getFunc();
|
||||
case GL11.GL_LIST_BASE -> listBase;
|
||||
case GL11.GL_LIST_MODE -> DisplayListManager.getListMode();
|
||||
case GL11.GL_MATRIX_MODE -> matrixMode.getMode();
|
||||
case GL11.GL_SHADE_MODEL -> shadeModelState.getValue();
|
||||
@@ -2137,7 +2139,7 @@ public class GLStateManager {
|
||||
// TODO: Iris Notifier
|
||||
if (HAS_MULTIPLE_SET.contains(pname)) {
|
||||
GL11.glFog(pname, param);
|
||||
|
||||
|
||||
if (pname == GL11.GL_FOG_COLOR && isCachingEnabled()) {
|
||||
final float red = param.get(0);
|
||||
final float green = param.get(1);
|
||||
@@ -2459,7 +2461,7 @@ public class GLStateManager {
|
||||
// Reset relative transform - subsequent transforms are relative to loaded matrix
|
||||
DisplayListManager.resetRelativeTransform();
|
||||
if (mode == RecordMode.COMPILE) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isCachingEnabled()) {
|
||||
@@ -3584,24 +3586,28 @@ public class GLStateManager {
|
||||
|
||||
// Display List Commands
|
||||
public static void glCallLists(IntBuffer lists) {
|
||||
if (DisplayListManager.isRecording()) {
|
||||
throw new UnsupportedOperationException("glCallLists in display lists not yet implemented - if you see this, please report!");
|
||||
while (lists.hasRemaining()) {
|
||||
final int listId = lists.get() + listBase;
|
||||
glCallList(listId);
|
||||
}
|
||||
}
|
||||
|
||||
public static void glCallLists(ShortBuffer lists) {
|
||||
while (lists.hasRemaining()) {
|
||||
final int listId = (lists.get() & 0xFFFF) + listBase;
|
||||
glCallList(listId);
|
||||
}
|
||||
GL11.glCallLists(lists);
|
||||
}
|
||||
|
||||
public static void glCallLists(ByteBuffer lists) {
|
||||
if (DisplayListManager.isRecording()) {
|
||||
throw new UnsupportedOperationException("glCallLists in display lists not yet implemented - if you see this, please report!");
|
||||
while (lists.hasRemaining()) {
|
||||
final int listId = (lists.get() & 0xFF) + listBase;
|
||||
glCallList(listId);
|
||||
}
|
||||
GL11.glCallLists(lists);
|
||||
}
|
||||
|
||||
public static void glListBase(int base) {
|
||||
if (DisplayListManager.isRecording()) {
|
||||
throw new UnsupportedOperationException("glListBase in display lists not yet implemented - if you see this, please report!");
|
||||
}
|
||||
GL11.glListBase(base);
|
||||
listBase = base;
|
||||
}
|
||||
|
||||
// Clip Plane Commands
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.gtnewhorizons.angelica.mixins.interfaces.IGameSettingsExt;
|
||||
import com.gtnewhorizons.angelica.render.CloudRenderer;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaBlockSafetyRegistry;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasDebugScreenHandler;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasSetup;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.threading.ChunkTaskRegistry;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.threading.DefaultChunkTaskProvider;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.threading.ThreadedChunkTaskProvider;
|
||||
@@ -66,9 +67,7 @@ import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import org.embeddedt.embeddium.impl.gl.device.GLRenderDevice;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@@ -116,8 +115,10 @@ public class ClientProxy extends CommonProxy {
|
||||
HUDCaching.init();
|
||||
}
|
||||
if (AngelicaConfig.enableCeleritas) {
|
||||
GLRenderDevice.VANILLA_STATE_RESETTER = () -> GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
|
||||
CeleritasSetup.ensureInitialized();
|
||||
MinecraftForge.EVENT_BUS.register(CeleritasDebugScreenHandler.INSTANCE);
|
||||
} else {
|
||||
LOGGER.info("Celeritas is disabled, skipping initialization from init()");
|
||||
}
|
||||
if (AngelicaConfig.enableIris) {
|
||||
MinecraftForge.EVENT_BUS.register(IrisDebugScreenHandler.INSTANCE);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gtnewhorizons.angelica.rendering.celeritas;
|
||||
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import org.embeddedt.embeddium.impl.gl.device.GLRenderDevice;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import static com.gtnewhorizons.angelica.loading.AngelicaTweaker.LOGGER;
|
||||
|
||||
public class CeleritasSetup {
|
||||
private static boolean initialized = false;
|
||||
|
||||
public static void ensureInitialized() {
|
||||
if (!initialized && AngelicaConfig.enableCeleritas) {
|
||||
GLRenderDevice.VANILLA_STATE_RESETTER = () -> GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
|
||||
LOGGER.debug("Celeritas init");
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -7,6 +7,7 @@ import com.gtnewhorizons.angelica.mixins.interfaces.IRenderGlobalExt;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
|
||||
import com.gtnewhorizons.angelica.rendering.RenderingState;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.BlockRenderLayer;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasSetup;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasWorldRenderer;
|
||||
import net.coderbot.iris.Iris;
|
||||
import net.coderbot.iris.layer.GbufferPrograms;
|
||||
@@ -212,6 +213,7 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
|
||||
@Unique
|
||||
public void angelica$reload() {
|
||||
CeleritasSetup.ensureInitialized();
|
||||
RenderDevice.enterManagedCode();
|
||||
try {
|
||||
this.celeritas$renderer.reload();
|
||||
|
||||
Reference in new issue
Block a user