void DrawObject()
{
var obj = GetVarOrDirectWord(OpCodeParameter.Param1);
var xpos = GetVarOrDirectByte(OpCodeParameter.Param2);
var ypos = GetVarOrDirectByte(OpCodeParameter.Param3);
var idx = GetObjectIndex(obj);
if (idx == -1)
return;
var od = _objs[idx];
if (xpos != 0xFF)
{
od.Walk = new Point(od.Walk.X + (xpos * 8) - od.Position.X, od.Walk.Y + (ypos * 8) - od.Position.Y);
od.Position = new Point(xpos * 8, ypos * 8);
}
AddObjectToDrawQue((byte)idx);
var x = od.Position.X;
var y = od.Position.Y;
var w = od.Width;
var h = od.Height;
var i = _objs.Length;
while ((i--) != 0)
{
if (_objs[i].Number != 0 && _objs[i].Position.X == x && _objs[i].Position.Y == y && _objs[i].Width == w && _objs[i].Height == h)
PutState(_objs[i].Number, GetStateCore(_objs[i].Number) & ~(byte)ObjectStateV2.State8);
}
PutState(obj, GetStateCore(od.Number) | (byte)ObjectStateV2.State8);
}