diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index f96d03da2..2f512cb87 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -66,7 +66,8 @@ object RenderUtils { private val beaconBeam = ResourceLocation("textures/entity/beacon_beam.png") - private val matrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private val matrixBuffer = GLAllocation.createDirectFloatBuffer(16) + private val colourBuffer = GLAllocation.createDirectFloatBuffer(16) infix fun Slot.highlight(color: LorenzColor) { highlight(color.toColor()) @@ -1630,4 +1631,11 @@ object RenderUtils { Utils.drawTexturedRect(x, y, scaledWidth.toFloat(), scaledHeight.toFloat(), GL11.GL_NEAREST) } } + + fun getAlpha(): Float { + colourBuffer.clear() + GlStateManager.getFloat(GL11.GL_CURRENT_COLOR, colourBuffer) + if (colourBuffer.limit() < 4) return 1f + return colourBuffer.get(3) + } } |