mirror of
https://github.com/chylex/Hardcore-Ender-Expansion-2.git
synced 2025-04-11 03:15:44 +02:00
Add GL.color that takes a Vec3d & update existing code
This commit is contained in:
parent
f20f7eb7e3
commit
0214bfe15f
src/main/java/chylex/hee/client/render
@ -11,9 +11,6 @@ import chylex.hee.system.migration.Facing.WEST
|
||||
import chylex.hee.system.migration.forge.Side
|
||||
import chylex.hee.system.migration.forge.Sided
|
||||
import chylex.hee.system.util.color.IntColor.Companion.RGB
|
||||
import chylex.hee.system.util.component1
|
||||
import chylex.hee.system.util.component2
|
||||
import chylex.hee.system.util.component3
|
||||
import chylex.hee.system.util.facades.Resource
|
||||
import chylex.hee.system.util.floorToInt
|
||||
import chylex.hee.system.util.getState
|
||||
@ -90,9 +87,7 @@ object RenderTileIgneousPlate : TileEntityRenderer<TileEntityIgneousPlate>(){
|
||||
|
||||
if (destroyStage < 0){
|
||||
ModelBlockIgneousPlate.renderOuterBox()
|
||||
|
||||
val (r, g, b) = getInnerBoxColor(tile.clientCombinedHeat)
|
||||
GL.color(r.toFloat(), g.toFloat(), b.toFloat())
|
||||
GL.color(getInnerBoxColor(tile.clientCombinedHeat))
|
||||
}
|
||||
|
||||
GL.disableLighting()
|
||||
|
@ -34,11 +34,6 @@ abstract class SkyCubeBase : IRenderHandler{
|
||||
@Sided(Side.CLIENT)
|
||||
override fun render(ticks: Int, partialTicks: Float, world: ClientWorld, mc: Minecraft){
|
||||
val dist = distance.coerceAtMost(18.5 * mc.gameSettings.renderDistanceChunks)
|
||||
val col = color
|
||||
|
||||
val red = col.x.toFloat()
|
||||
val green = col.y.toFloat()
|
||||
val blue = col.z.toFloat()
|
||||
|
||||
GL.enableBlend()
|
||||
GL.blendFunc(SF_SRC_ALPHA, DF_ONE_MINUS_SRC_ALPHA, SF_ONE, DF_ZERO)
|
||||
@ -47,7 +42,7 @@ abstract class SkyCubeBase : IRenderHandler{
|
||||
GL.disableFog()
|
||||
RenderHelper.disableStandardItemLighting()
|
||||
|
||||
GL.color(red, green, blue, alpha * EnvironmentRenderer.currentSkyAlpha)
|
||||
GL.color(color, alpha * EnvironmentRenderer.currentSkyAlpha)
|
||||
MC.textureManager.bindTexture(texture)
|
||||
|
||||
for(side in 0..5){
|
||||
|
@ -40,11 +40,6 @@ abstract class SunBase : IRenderHandler{
|
||||
override fun render(ticks: Int, partialTicks: Float, world: ClientWorld, mc: Minecraft){
|
||||
val width = size
|
||||
val dist = distance
|
||||
val col = color
|
||||
|
||||
val red = col.x.toFloat()
|
||||
val green = col.y.toFloat()
|
||||
val blue = col.z.toFloat()
|
||||
|
||||
GL.enableBlend()
|
||||
GL.blendFunc(SF_SRC_ALPHA, DF_ONE, SF_ONE, DF_ZERO)
|
||||
@ -55,7 +50,7 @@ abstract class SunBase : IRenderHandler{
|
||||
|
||||
setRotation(world, partialTicks)
|
||||
|
||||
GL.color(red, green, blue, alpha)
|
||||
GL.color(color, alpha)
|
||||
MC.textureManager.bindTexture(texture)
|
||||
|
||||
TESSELLATOR.draw(GL_QUADS, DefaultVertexFormats.POSITION_TEX){
|
||||
|
@ -7,6 +7,7 @@ import com.mojang.blaze3d.platform.GlStateManager.DestFactor
|
||||
import com.mojang.blaze3d.platform.GlStateManager.FogMode
|
||||
import com.mojang.blaze3d.platform.GlStateManager.SourceFactor
|
||||
import com.mojang.blaze3d.platform.GlStateManager.TexGen
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import java.nio.FloatBuffer
|
||||
|
||||
typealias GLSM = GlStateManager
|
||||
@ -78,6 +79,9 @@ object GL{
|
||||
fun color(red: Float, green: Float, blue: Float) = GLSM.color3f(red, green, blue)
|
||||
fun color(red: Float, green: Float, blue: Float, alpha: Float) = GLSM.color4f(red, green, blue, alpha)
|
||||
|
||||
fun color(color: Vec3d) = GLSM.color3f(color.x.toFloat(), color.y.toFloat(), color.z.toFloat())
|
||||
fun color(color: Vec3d, alpha: Float) = GLSM.color4f(color.x.toFloat(), color.y.toFloat(), color.z.toFloat(), alpha)
|
||||
|
||||
// Texture
|
||||
|
||||
fun enableTexture() = GLSM.enableTexture()
|
||||
|
Loading…
Reference in New Issue
Block a user