public void DrawCreature(SpriteBatch Batch, GameTime Time, ClientCreature Creature, Vector2 Offset, Color clr) { if (Creature.Outfit.LookItem != 0) { DrawSprite(Batch, Time, null, GameData.GetItemSprite(Creature.Outfit.LookItem), 1, -1, Offset, clr); } else if (Creature.Outfit.LookType != 0) { GameSprite Sprite = GameData.GetCreatureSprite(Creature.Outfit.LookType); Offset.X += Sprite.RenderOffset; Offset.Y += Sprite.RenderOffset; if (Sprite != null) { for (int cx = 0; cx != Sprite.Width; ++cx) { for (int cy = 0; cy != Sprite.Height; ++cy) { GameImage Image = Sprite.GetImage( cx, cy, Creature.Direction, Creature.Outfit, (int)(Time.TotalGameTime.TotalMilliseconds / Sprite.AnimationSpeed) ); Rectangle rect = new Rectangle((int)Offset.X - 32 * cx, (int)Offset.Y - 32 * cy, 32, 32); DrawImage(Batch, Image, rect, clr); } } } } }
public void DrawSprite(SpriteBatch Batch, GameTime Time, ClientTile Tile, GameSprite Sprite, int SubType, int Frame, ref Vector2 Position, Color clr) { if (Sprite == null) { return; } int xdiv = 0, ydiv = 0, zdiv = 0; if (Tile != null) { MapPosition mPos = Tile.Position; xdiv = mPos.X % Sprite.XDiv; ydiv = mPos.Y % Sprite.YDiv; zdiv = mPos.Z % Sprite.ZDiv; } /* * if (Sprite.IsHangable) * { * if (Tile->hasProperty(ISVERTICAL)) * { * xdiv = 2; * } * else if (Tile->hasProperty(ISHORIZONTAL)) * { * xdiv = 1; * } * else * { * xdiv = -0; * } * } * else */if (Sprite.IsStackable) { if (SubType <= 1) { SubType = 0; } else if (SubType <= 2) { SubType = 1; } else if (SubType <= 3) { SubType = 2; } else if (SubType <= 4) { SubType = 3; } else if (SubType < 10) { SubType = 4; } else if (SubType < 25) { SubType = 5; } else if (SubType < 50) { SubType = 6; } else { SubType = 7; } } Vector2 Offset = Position; Offset.X += Sprite.RenderOffset; Offset.Y += Sprite.RenderOffset; if (Frame == -1) { Frame = (int)(Time.TotalGameTime.TotalMilliseconds / Sprite.AnimationSpeed); } for (int cx = 0; cx != Sprite.Width; cx++) { for (int cy = 0; cy != Sprite.Height; cy++) { for (int cf = 0; cf != Sprite.BlendFrames; cf++) { GameImage Image = Sprite.GetImage( cx, cy, cf, SubType, xdiv, ydiv, zdiv, Frame ); Rectangle rect = new Rectangle((int)Offset.X - 32 * cx, (int)Offset.Y - 32 * cy, 32, 32); DrawImage(Batch, Image, rect, clr); } } } if (Sprite.RenderHeight > 0) { Position.X -= Sprite.RenderHeight; Position.Y -= Sprite.RenderHeight; } }
public void DrawSprite(SpriteBatch Batch, GameTime Time, ClientTile Tile, GameSprite Sprite, int SubType, int Frame, ref Vector2 Position, Color clr) { if (Sprite == null) return; int xdiv = 0, ydiv = 0, zdiv = 0; if (Tile != null) { MapPosition mPos = Tile.Position; xdiv = mPos.X % Sprite.XDiv; ydiv = mPos.Y % Sprite.YDiv; zdiv = mPos.Z % Sprite.ZDiv; } /* if (Sprite.IsHangable) { if (Tile->hasProperty(ISVERTICAL)) { xdiv = 2; } else if (Tile->hasProperty(ISHORIZONTAL)) { xdiv = 1; } else { xdiv = -0; } } else */ if (Sprite.IsStackable) { if (SubType <= 1) SubType = 0; else if (SubType <= 2) SubType = 1; else if (SubType <= 3) SubType = 2; else if (SubType <= 4) SubType = 3; else if (SubType < 10) SubType = 4; else if (SubType < 25) SubType = 5; else if (SubType < 50) SubType = 6; else SubType = 7; } Vector2 Offset = Position; Offset.X += Sprite.RenderOffset; Offset.Y += Sprite.RenderOffset; if (Frame == -1) Frame = (int)(Time.TotalGameTime.TotalMilliseconds / Sprite.AnimationSpeed); for (int cx = 0; cx != Sprite.Width; cx++) { for (int cy = 0; cy != Sprite.Height; cy++) { for (int cf = 0; cf != Sprite.BlendFrames; cf++) { GameImage Image = Sprite.GetImage( cx, cy, cf, SubType, xdiv, ydiv, zdiv, Frame ); Rectangle rect = new Rectangle((int)Offset.X - 32 * cx, (int)Offset.Y - 32 * cy, 32, 32); DrawImage(Batch, Image, rect, clr); } } } if (Sprite.RenderHeight > 0) { Position.X -= Sprite.RenderHeight; Position.Y -= Sprite.RenderHeight; } }