Rendering cleanup

Replaces the reflexive instantiation of the Renderes with a factory
method.

Some optimizations to the renderers to no longer push the whole OpenGL state to the stack.

General cleanup of duplicate code, etc
This commit is contained in:
yueh
2015-09-16 18:03:07 +02:00
parent 824ec1eccb
commit d5dfc31210
69 changed files with 435 additions and 343 deletions
@@ -42,17 +42,22 @@ public class RenderBlockQuartzAccelerator extends BaseBlockRender<BlockQuartzGro
public boolean renderInWorld( final BlockQuartzGrowthAccelerator blk, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
{
final TileEntity te = world.getTileEntity( x, y, z );
if( te instanceof TileQuartzGrowthAccelerator )
{
if( ( (TileQuartzGrowthAccelerator) te ).isPowered() )
final TileQuartzGrowthAccelerator tileCGA = (TileQuartzGrowthAccelerator) te;
if( tileCGA.isPowered() )
{
final IIcon top_Bottom = ExtraBlockTextures.BlockQuartzGrowthAcceleratorOn.getIcon();
final IIcon side = ExtraBlockTextures.BlockQuartzGrowthAcceleratorSideOn.getIcon();
blk.getRendererInstance().setTemporaryRenderIcons( top_Bottom, top_Bottom, side, side, side, side );
}
}
final boolean out = super.renderInWorld( blk, world, x, y, z, renderer );
blk.getRendererInstance().setTemporaryRenderIcon( null );
return out;