Skip to content

Commit

Permalink
Merge branch 'master' into MapMacros
Browse files Browse the repository at this point in the history
  • Loading branch information
Clownacy committed Jun 3, 2015
2 parents 564a1ef + 213118c commit 92e9652
Show file tree
Hide file tree
Showing 6 changed files with 696 additions and 692 deletions.
103 changes: 52 additions & 51 deletions SonLVL INI Files/Common/InvisibleBlock.cs
Expand Up @@ -5,64 +5,65 @@

namespace S2ObjectDefinitions.Common
{
class InvisibleBlock : ObjectDefinition
{
private Sprite img;
class InvisibleBlock : ObjectDefinition
{
private Sprite img;

public override void Init(ObjectData data)
{
byte[] artfile = ObjectHelper.OpenArtFile("../art/nemesis/Monitor and contents.bin", CompressionType.Nemesis);
img = ObjectHelper.MapASMToBmp(artfile, "../mappings/sprite/obj74.asm", 0, 0);
}
public override void Init(ObjectData data)
{
byte[] artfile = ObjectHelper.OpenArtFile("../art/nemesis/Monitor and contents.bin", CompressionType.Nemesis);
byte[] mapfile = System.IO.File.ReadAllBytes("../mappings/sprite/obj74.asm");
img = ObjectHelper.MapASMToBmp(artfile, mapfile, 0, 0);
}

public override ReadOnlyCollection<byte> Subtypes
{
get { return new ReadOnlyCollection<byte>(new byte[] { 0 }); }
}
public override ReadOnlyCollection<byte> Subtypes
{
get { return new ReadOnlyCollection<byte>(new byte[] { 0 }); }
}

public override string Name
{
get { return "Invisible Solid Block"; }
}
public override string Name
{
get { return "Invisible Solid Block"; }
}

public override bool RememberState
{
get { return true; }
}
public override bool RememberState
{
get { return true; }
}

public override string SubtypeName(byte subtype)
{
return ((subtype >> 4) + 1) + "x" + ((subtype & 0xF) + 1) + " blocks";
}
public override string SubtypeName(byte subtype)
{
return ((subtype >> 4) + 1) + "x" + ((subtype & 0xF) + 1) + " blocks";
}

public override Sprite Image
{
get { return img; }
}
public override Sprite Image
{
get { return img; }
}

public override Sprite SubtypeImage(byte subtype)
{
return img;
}
public override Sprite SubtypeImage(byte subtype)
{
return img;
}

public override Sprite GetSprite(ObjectEntry obj)
{
int w = ((obj.SubType >> 4) + 1) * 16;
int h = ((obj.SubType & 0xF) + 1) * 16;
BitmapBits bmp = new BitmapBits(w, h);
bmp.DrawRectangle(0x1C, 0, 0, w - 1, h - 1);
Sprite spr = new Sprite(new Sprite(bmp, new Point(-(w / 2), -(h / 2))), img);
spr.Offset = new Point(spr.X + obj.X, spr.Y + obj.Y);
return spr;
}
public override Sprite GetSprite(ObjectEntry obj)
{
int w = ((obj.SubType >> 4) + 1) * 16;
int h = ((obj.SubType & 0xF) + 1) * 16;
BitmapBits bmp = new BitmapBits(w, h);
bmp.DrawRectangle(0x1C, 0, 0, w - 1, h - 1);
Sprite spr = new Sprite(new Sprite(bmp, new Point(-(w / 2), -(h / 2))), img);
spr.Offset = new Point(spr.X + obj.X, spr.Y + obj.Y);
return spr;
}

public override Rectangle GetBounds(ObjectEntry obj, Point camera)
{
int w = ((obj.SubType >> 4) + 1) * 16;
int h = ((obj.SubType & 0xF) + 1) * 16;
return new Rectangle(obj.X - (w / 2) - camera.X, obj.Y - (h / 2) - camera.Y, w, h);
}
public override Rectangle GetBounds(ObjectEntry obj, Point camera)
{
int w = ((obj.SubType >> 4) + 1) * 16;
int h = ((obj.SubType & 0xF) + 1) * 16;
return new Rectangle(obj.X - (w / 2) - camera.X, obj.Y - (h / 2) - camera.Y, w, h);
}

public override bool Debug { get { return true; } }
}
}
public override bool Debug { get { return true; } }
}
}

0 comments on commit 92e9652

Please sign in to comment.