Fix sheep model.

This commit is contained in:
UnknownShadow200 2015-09-12 09:43:03 +10:00
parent 5a8ec25957
commit 3f199816f8
2 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,7 @@ namespace ClassicalSharp.Model {
}
public void InitCache() {
vertices = new VertexPos3fTex2fCol4b[384];
vertices = new VertexPos3fTex2fCol4b[24 * 12];
vb = api.CreateDynamicVb( VertexFormat.Pos3fTex2fCol4b, vertices.Length );
cache["humanoid"] = new PlayerModel( game );
}

View File

@ -8,7 +8,6 @@ namespace ClassicalSharp.Model {
public class SheepModel : IModel {
public bool Fur = true;
int furTextureId;
public SheepModel( Game window ) : base( window ) {
vertices = new VertexPos3fTex2fCol4b[partVertices * 6 * ( Fur ? 2 : 1 )];
@ -80,7 +79,11 @@ namespace ClassicalSharp.Model {
DrawRotate( 0, 0.75f, -0.3125f, p.rightLegXRot, 0, 0, RightLegFront );
DrawRotate( 0, 0.75f, 0.4375f, p.rightLegXRot, 0, 0, LeftLegBack );
DrawRotate( 0, 0.75f, 0.4375f, p.leftLegXRot, 0, 0, RightLegBack );
// Need to draw the two parts separately.
graphics.DrawDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 );
graphics.AlphaTest = true;
index = 0;
if( Fur ) {
graphics.BindTexture( cache.SheepFurTexId );
DrawPart( FurTorso );