package client.renderer.entity;

import org.lwjgl.opengl.GL11;

import client.renderer.layers.LayerArachnoidArmor;
import client.renderer.model.ModelArachnoid;
import common.entity.npc.EntityNPC;


public class RenderArachnoid extends RenderHumanoid
{
    public RenderArachnoid(RenderManager renderManagerIn)
    {
        super(renderManagerIn, new ModelArachnoid(), 12, 12, false, "textures/npc/arachnoid.png");
    	this.addLayer(new LayerArachnoidArmor(this));
//        this.addLayer(new LayerSpiderEyes(this));
    }

//    protected float getDeathMaxRotation(EntityNPC entityLivingBaseIn)
//    {
//        return 180.0F;
//    }
    
    protected void renderLayers(EntityNPC entity, float swing, float amount, float partial, float time, float dYaw, float dPitch, float scale) {
    	GL11.glPushMatrix();
    	GL11.glTranslatef(0.0f, 3.0f / 16.0f, 0.0f);
    	super.renderLayers(entity, swing, amount, partial, time, dYaw, dPitch, scale);
    	GL11.glPopMatrix();
    }

    public ModelArachnoid getMainModel()
    {
        return (ModelArachnoid)super.getMainModel();
    }
    
//    public boolean canSneak() {
//    	return false;
//    }

//	public int getCompressedSize() {
//		return super.getCompressedSize() + 2616;
//	}

//	public int compToImage(byte[] comp, int[] img, int stride) {
//		int pos = super.compToImage(comp, img, stride);
//		
//		pos = copyData(comp, pos, stride, img,  84, 0,  32, 2, false);
//		pos = copyData(comp, pos, stride, img,  82, 2,  36, 2, false);
//		pos = copyData(comp, pos, stride, img, 80, 12, 20, 16, false);
//		pos = copyData(comp, pos, stride, img, 64, 28,  52, 8, false);
//		
//		return pos;
//	}
//
//	public int imageToComp(byte[] comp, int[] img, int stride) {
//		int pos = super.imageToComp(comp, img, stride);
//
//		pos = copyData(stride, img,  84, 0,  32, 2, comp, pos, false);
//		pos = copyData(stride, img,  82, 2,  36, 2, comp, pos, false);
//		pos = copyData(stride, img, 80, 12, 20, 16, comp, pos, false);
//		pos = copyData(stride, img, 64, 28,  52, 8, comp, pos, false);
//		
//		return pos;
//	}
	
    public void getSegments(TexList opaque, TexList alpha) {
    	super.getSegments(opaque, alpha);
    	opaque.add(84, 0 , 32, 2 );
    	opaque.add(82, 2,  36, 2 );
    	opaque.add(80, 12, 20, 16);
    	opaque.add(64, 28, 52, 8 );
    }
}
