-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move all text visual related things into vanillin
- Loading branch information
Showing
28 changed files
with
126 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
common/src/vanillin/java/dev/engine_room/vanillin/VanillinInstanceTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package dev.engine_room.vanillin; | ||
|
||
import org.lwjgl.system.MemoryUtil; | ||
|
||
import dev.engine_room.flywheel.api.instance.InstanceType; | ||
import dev.engine_room.flywheel.api.layout.FloatRepr; | ||
import dev.engine_room.flywheel.api.layout.LayoutBuilder; | ||
import dev.engine_room.flywheel.lib.instance.SimpleInstanceType; | ||
import dev.engine_room.flywheel.lib.util.ExtraMemoryOps; | ||
|
||
public class VanillinInstanceTypes { | ||
public static final InstanceType<GlyphInstance> GLYPH = SimpleInstanceType.builder(GlyphInstance::new) | ||
.layout(LayoutBuilder.create() | ||
.matrix("pose", FloatRepr.FLOAT, 4) | ||
.vector("u0u1v0v1", FloatRepr.NORMALIZED_UNSIGNED_SHORT, 4) | ||
.vector("color", FloatRepr.NORMALIZED_UNSIGNED_BYTE, 4) | ||
.vector("light", FloatRepr.UNSIGNED_SHORT, 2) | ||
.build()) | ||
.writer((ptr, instance) -> { | ||
ExtraMemoryOps.putMatrix4f(ptr, instance.pose); | ||
ExtraMemoryOps.put2x16(ptr + 64, instance.packedUs); | ||
ExtraMemoryOps.put2x16(ptr + 68, instance.packedVs); | ||
MemoryUtil.memPutByte(ptr + 72, instance.red); | ||
MemoryUtil.memPutByte(ptr + 73, instance.green); | ||
MemoryUtil.memPutByte(ptr + 74, instance.blue); | ||
MemoryUtil.memPutByte(ptr + 75, instance.alpha); | ||
ExtraMemoryOps.put2x16(ptr + 76, instance.light); | ||
}) | ||
.vertexShader(Vanillin.rl("instance/glyph.vert")) | ||
.cullShader(Vanillin.rl("instance/cull/glyph.glsl")) | ||
.build(); | ||
} |
4 changes: 2 additions & 2 deletions
4
...heel/impl/mixin/text/BakedGlyphMixin.java → .../vanillin/mixin/text/BakedGlyphMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...el/impl/mixin/text/CodePointMapMixin.java → ...anillin/mixin/text/CodePointMapMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lywheel/impl/mixin/text/FontAccessor.java → ...oom/vanillin/mixin/text/FontAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../mixin/text/FontTexture$NodeAccessor.java → .../mixin/text/FontTexture$NodeAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eel/lib/internal/BakedGlyphExtension.java → ...om/vanillin/text/BakedGlyphExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../impl/extension/FontTextureExtension.java → ...m/vanillin/text/FontTextureExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...room/flywheel/impl/FontTextureUpload.java → ...room/vanillin/text/FontTextureUpload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...heel/lib/visual/text/SimpleTextLayer.java → ...e_room/vanillin/text/SimpleTextLayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...m/flywheel/lib/visual/text/TextLayer.java → .../engine_room/vanillin/text/TextLayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../flywheel/lib/visual/text/TextLayers.java → ...engine_room/vanillin/text/TextLayers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
common/src/vanillin/java/dev/engine_room/vanillin/text/TextUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package dev.engine_room.vanillin.text; | ||
|
||
import dev.engine_room.vanillin.mixin.text.FontAccessor; | ||
import net.minecraft.client.gui.Font; | ||
import net.minecraft.client.gui.font.FontSet; | ||
import net.minecraft.client.gui.font.glyphs.BakedGlyph; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class TextUtil { | ||
public static FontSet getFontSet(Font font, ResourceLocation loc) { | ||
return ((FontAccessor) font).flywheel$getFontSet(loc); | ||
} | ||
|
||
public static boolean getFilterFishyGlyphs(Font font) { | ||
return ((FontAccessor) font).flywheel$getFilterFishyGlyphs(); | ||
} | ||
|
||
public static BakedGlyphExtension getBakedGlyphExtension(BakedGlyph glyph) { | ||
return (BakedGlyphExtension) glyph; | ||
} | ||
} |
Oops, something went wrong.