mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-25 14:34:54 +00:00
Clarity pass
This commit is contained in:
1 parent
0e6f01f84d
commit
0fc657c9d9
4 files changed
+12
-12
No files matched your search
@@ -164,8 +164,8 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glLineWidth(1.5F);
|
||||
// the band of `MobOverlayStyle.CONNECTED` lies in the plane of the tint. With depth writes on, the depth test
|
||||
// discards most of the band
|
||||
// the outline of `MobOverlayStyle.CONNECTED` lies in the plane of the tint. With depth writes on, the depth
|
||||
// test discards most of the outline
|
||||
GL11.glDepthMask(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ public final class MobOverlayDisplayList {
|
||||
private long compiledTicks;
|
||||
|
||||
/**
|
||||
* After a style change, a compile is due at once. After a {@link MobOverlayScan#getModesVersion} change, a compile
|
||||
* is due {@code MIN_COMPILE_TICKS} or more ticks after the last compile. A compile takes a millisecond or more, and
|
||||
* the version changes several times per second while the player moves fast.
|
||||
* Compiles after a {@link MobOverlayScan#getModesVersion} change are debounced to one per {@code MIN_COMPILE_TICKS}
|
||||
* ticks, because the version changes several times per second while the player moves fast, and a compile takes a
|
||||
* millisecond or more.
|
||||
*/
|
||||
public boolean isCompileDue(int currentModesVersion, MobOverlayStyle currentStyle, long worldTicks) {
|
||||
final int MIN_COMPILE_TICKS = 5;
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class MobOverlayFace {
|
||||
|
||||
public boolean isJoined(int offsetX, int offsetZ) {
|
||||
final byte neighbourMode = neighbourModes[indexNeighbour(offsetX, offsetZ)];
|
||||
// no band along the edge of the scan
|
||||
// no outline along the edge of the scan
|
||||
return neighbourMode == neighbourModes[indexNeighbour(0, 0)] || neighbourMode == OUTSIDE_SCAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,21 +28,21 @@ public enum MobOverlayStyle {
|
||||
},
|
||||
|
||||
/**
|
||||
* A light tint, with a stronger band along the outline of each area of one spawn mode, like a connected texture.
|
||||
* A light tint, with a stronger outline around each area of one spawn mode, like a connected texture.
|
||||
*/
|
||||
CONNECTED(GL11.GL_QUADS) {
|
||||
|
||||
@Override
|
||||
public void addVertices(MobOverlayFace face) {
|
||||
final double BAND_WIDTH = 1.0 / 16;
|
||||
final double OUTLINE_WIDTH = 1.0 / 16;
|
||||
face.addFullFace();
|
||||
face.applyColor(Colouring.OVERLAY, MARK_ALPHA);
|
||||
for (int offsetX = -1; offsetX <= 1; offsetX++) {
|
||||
for (int offsetZ = -1; offsetZ <= 1; offsetZ++) {
|
||||
// a corner cell is drawn when either edge next to the corner has a band, and on an inside corner
|
||||
final boolean isBand = !(face.isJoined(offsetX, offsetZ) && face.isJoined(offsetX, 0)
|
||||
// a corner cell is drawn when either edge next to the corner is outlined, and on an inside corner
|
||||
final boolean isOutline = !(face.isJoined(offsetX, offsetZ) && face.isJoined(offsetX, 0)
|
||||
&& face.isJoined(0, offsetZ));
|
||||
if (isBand) face.addCell(offsetX, offsetZ, BAND_WIDTH);
|
||||
if (isOutline) face.addCell(offsetX, offsetZ, OUTLINE_WIDTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public enum MobOverlayStyle {
|
||||
public static final MobOverlayStyle DEFAULT = CONNECTED;
|
||||
|
||||
private static final float TINT_ALPHA = 0.15F;
|
||||
// at the tint's opacity, a small mark is too faint to see
|
||||
// the square and the outline cover a small part of the block and need more opacity than the tint to stay visible
|
||||
private static final float MARK_ALPHA = 0.45F;
|
||||
|
||||
public final int glMode;
|
||||
|
||||
Reference in new issue
Block a user