Fix gas render in mech pipe

This commit is contained in:
Aidan C. Brady 2013-12-03 11:24:23 -05:00
parent 7956748e8f
commit ef8b6c1c78
3 changed files with 24 additions and 7 deletions

View file

@ -49,6 +49,7 @@ public class RenderPartTransmitter implements IIconRegister
private static final int stages = 40; private static final int stages = 40;
private static final double height = 0.45; private static final double height = 0.45;
private static final double offset = 0.015; private static final double offset = 0.015;
private HashMap<ForgeDirection, HashMap<Fluid, DisplayInteger[]>> cachedLiquids = new HashMap<ForgeDirection, HashMap<Fluid, DisplayInteger[]>>(); private HashMap<ForgeDirection, HashMap<Fluid, DisplayInteger[]>> cachedLiquids = new HashMap<ForgeDirection, HashMap<Fluid, DisplayInteger[]>>();
static static
@ -131,11 +132,11 @@ public class RenderPartTransmitter implements IIconRegister
public void renderContents(PartMechanicalPipe pipe, Vector3 pos) public void renderContents(PartMechanicalPipe pipe, Vector3 pos)
{ {
if(pipe.getTransmitterNetwork().fluidScale > 0) Fluid fluid = pipe.getTransmitterNetwork().refFluid;
{ float scale = pipe.getTransmitterNetwork().fluidScale;
Fluid fluid = pipe.getTransmitterNetwork().refFluid;
float scale = pipe.getTransmitterNetwork().fluidScale;
if(scale > 0 && fluid != null)
{
push(); push();
MekanismRenderer.glowOn(fluid.getLuminosity()); MekanismRenderer.glowOn(fluid.getLuminosity());
@ -143,6 +144,8 @@ public class RenderPartTransmitter implements IIconRegister
CCRenderState.changeTexture((MekanismRenderer.getBlocksTexture())); CCRenderState.changeTexture((MekanismRenderer.getBlocksTexture()));
GL11.glTranslated(pos.x, pos.y, pos.z); GL11.glTranslated(pos.x, pos.y, pos.z);
boolean gas = fluid.isGaseous();
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{ {
if(PartTransmitter.connectionMapContainsSide(pipe.getAllCurrentConnections(), side)) if(PartTransmitter.connectionMapContainsSide(pipe.getAllCurrentConnections(), side))
@ -151,7 +154,14 @@ public class RenderPartTransmitter implements IIconRegister
if(displayLists != null) if(displayLists != null)
{ {
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render(); if(!gas)
{
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render();
}
else {
GL11.glColor4f(1F, 1F, 1F, scale);
displayLists[stages-1].render();
}
} }
} }
} }
@ -160,7 +170,14 @@ public class RenderPartTransmitter implements IIconRegister
if(displayLists != null) if(displayLists != null)
{ {
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render(); if(!gas)
{
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render();
}
else {
GL11.glColor4f(1F, 1F, 1F, scale);
displayLists[stages-1].render();
}
} }
MekanismRenderer.glowOff(); MekanismRenderer.glowOff();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB