summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <devnull@localhost>2011-04-11 03:53:12 +0000
committerunknown <devnull@localhost>2011-04-11 03:53:12 +0000
commita1f421485391e95f27ec17b801bb8e3632ca377f (patch)
treefb69c7009d2c3fe70a59eefa3b4c7609e3682b85
parent2969e076c27e17bff76585181446013cb2901ee2 (diff)
MainMemory - S2LVL: Now exports FG and BG layouts as 8bpp bitmaps. Object Definitions updated to allow this.
-rw-r--r--S2LVL INI Files/ARZ/Platform.cs7
-rw-r--r--S2LVL INI Files/CPZ/Barrier.cs8
-rw-r--r--S2LVL INI Files/CPZ/Platform.cs7
-rw-r--r--S2LVL INI Files/Common/Monitor.cs38
-rw-r--r--S2LVL INI Files/Common/PathSwapper.cs8
-rw-r--r--S2LVL INI Files/Common/RingGroup.cs19
-rw-r--r--S2LVL INI Files/Common/Spikes.cs7
-rw-r--r--S2LVL INI Files/Common/Spring.cs7
-rw-r--r--S2LVL INI Files/EHZ/Bridge.cs10
-rw-r--r--S2LVL INI Files/EHZ/Platform.cs7
-rw-r--r--S2LVL INI Files/EHZ/Waterfall.cs8
11 files changed, 95 insertions, 31 deletions
diff --git a/S2LVL INI Files/ARZ/Platform.cs b/S2LVL INI Files/ARZ/Platform.cs
index a60bed6a..69e1bf51 100644
--- a/S2LVL INI Files/ARZ/Platform.cs
+++ b/S2LVL INI Files/ARZ/Platform.cs
@@ -77,6 +77,13 @@ namespace S2ObjectDefinitions.ARZ
return new Rectangle(loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y, imgws[(subtype & 0x10) >> 4], imghs[(subtype & 0x10) >> 4]);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(imgs[(subtype & 0x10) >> 4]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y));
+ }
+
public override Type ObjectType
{
get
diff --git a/S2LVL INI Files/CPZ/Barrier.cs b/S2LVL INI Files/CPZ/Barrier.cs
index bc78929a..91187ee9 100644
--- a/S2LVL INI Files/CPZ/Barrier.cs
+++ b/S2LVL INI Files/CPZ/Barrier.cs
@@ -82,6 +82,14 @@ namespace S2ObjectDefinitions.CPZ
return new Rectangle(loc.X + offsets[subtype].X, loc.Y + offsets[subtype].Y, imgws[subtype], imghs[subtype]);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ if (subtype > 3) subtype = 0;
+ BitmapBits bits = new BitmapBits(imgs[subtype]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[subtype].X, loc.Y + offsets[subtype].Y));
+ }
+
public override void PaletteChanged(System.Drawing.Imaging.ColorPalette pal)
{
foreach (Bitmap item in imgs)
diff --git a/S2LVL INI Files/CPZ/Platform.cs b/S2LVL INI Files/CPZ/Platform.cs
index 60dd0ac0..415acff5 100644
--- a/S2LVL INI Files/CPZ/Platform.cs
+++ b/S2LVL INI Files/CPZ/Platform.cs
@@ -82,6 +82,13 @@ namespace S2ObjectDefinitions.CPZ
return new Rectangle(loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y, imgws[(subtype & 0x10) >> 4], imghs[(subtype & 0x10) >> 4]);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(imgs[(subtype & 0x10) >> 4]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y));
+ }
+
public override Type ObjectType
{
get
diff --git a/S2LVL INI Files/Common/Monitor.cs b/S2LVL INI Files/Common/Monitor.cs
index 99275706..05738807 100644
--- a/S2LVL INI Files/Common/Monitor.cs
+++ b/S2LVL INI Files/Common/Monitor.cs
@@ -81,39 +81,13 @@ namespace S2ObjectDefinitions.Common
case 10:
return "Broken";
default:
- return string.Empty;
+ return "Invalid";
}
}
public override string FullName(byte subtype)
{
- switch (subtype)
- {
- case 0:
- return "Static Monitor";
- case 1:
- return "Sonic Monitor";
- case 2:
- return "Tails Monitor";
- case 3:
- return "Eggman Monitor";
- case 4:
- return "Rings Monitor";
- case 5:
- return "Shoes Monitor";
- case 6:
- return "Shield Monitor";
- case 7:
- return "Invincibility Monitor";
- case 8:
- return "Teleport Monitor";
- case 9:
- return "Random Monitor";
- case 10:
- return "Broken Monitor";
- default:
- return "Monitor";
- }
+ return SubtypeName(subtype) + " " + Name();
}
public override Bitmap Image()
@@ -151,5 +125,13 @@ namespace S2ObjectDefinitions.Common
for (int i = 0; i <= 10; i++)
imgs[i].Palette = pal;
}
+
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ if (subtype > 10) subtype = 0;
+ BitmapBits bits = new BitmapBits(imgs[subtype]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[subtype].X, loc.Y + offsets[subtype].Y));
+ }
}
} \ No newline at end of file
diff --git a/S2LVL INI Files/Common/PathSwapper.cs b/S2LVL INI Files/Common/PathSwapper.cs
index 66f60903..961b539a 100644
--- a/S2LVL INI Files/Common/PathSwapper.cs
+++ b/S2LVL INI Files/Common/PathSwapper.cs
@@ -83,6 +83,14 @@ namespace S2ObjectDefinitions.Common
return new Rectangle(loc.X + offsets[subtype & 7].X, loc.Y + offsets[subtype & 7].Y, imgws[subtype & 7], imghs[subtype & 7]);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ if (!includeDebug) return;
+ BitmapBits bits = new BitmapBits(imgs[subtype & 7]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[subtype & 7].X, loc.Y + offsets[subtype & 7].Y));
+ }
+
public override Type ObjectType
{
get
diff --git a/S2LVL INI Files/Common/RingGroup.cs b/S2LVL INI Files/Common/RingGroup.cs
index 5c950561..50b944d9 100644
--- a/S2LVL INI Files/Common/RingGroup.cs
+++ b/S2LVL INI Files/Common/RingGroup.cs
@@ -70,5 +70,22 @@ namespace S2ObjectDefinitions.Common
{
img.Palette = pal;
}
+
+ public override void DrawExport(BitmapBits bmp, Point loc, Direction direction, byte count, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(img);
+ for (int i = 0; i < count; i++)
+ {
+ switch (direction)
+ {
+ case SonicRetro.S2LVL.Direction.Horizontal:
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offset.X + (i * spacing), loc.Y + offset.Y));
+ break;
+ case SonicRetro.S2LVL.Direction.Vertical:
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offset.X, loc.Y + offset.Y + (i * spacing)));
+ break;
+ }
+ }
+ }
}
-}
+} \ No newline at end of file
diff --git a/S2LVL INI Files/Common/Spikes.cs b/S2LVL INI Files/Common/Spikes.cs
index 37b480db..7003de3d 100644
--- a/S2LVL INI Files/Common/Spikes.cs
+++ b/S2LVL INI Files/Common/Spikes.cs
@@ -82,6 +82,13 @@ namespace S2ObjectDefinitions.Common
gfx.DrawImageFlipped(imgs[(subtype & 0x70) >> 4], loc.X + offsets[(subtype & 0x70) >> 4].X, loc.Y + offsets[(subtype & 0x70) >> 4].Y, XFlip, YFlip);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(imgs[(subtype & 0x70) >> 4]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[(subtype & 0x70) >> 4].X, loc.Y + offsets[(subtype & 0x70) >> 4].Y));
+ }
+
public override Rectangle Bounds(Point loc, byte subtype)
{
return new Rectangle(loc.X + offsets[(subtype & 0x70) >> 4].X, loc.Y + offsets[(subtype & 0x70) >> 4].Y, imgws[(subtype & 0x70) >> 4], imghs[(subtype & 0x70) >> 4]);
diff --git a/S2LVL INI Files/Common/Spring.cs b/S2LVL INI Files/Common/Spring.cs
index 31a584ef..308017fa 100644
--- a/S2LVL INI Files/Common/Spring.cs
+++ b/S2LVL INI Files/Common/Spring.cs
@@ -152,6 +152,13 @@ namespace S2ObjectDefinitions.Common
return new Rectangle(loc.X + offsets[imgindex(subtype)].X, loc.Y + offsets[imgindex(subtype)].Y, imgws[imgindex(subtype)], imghs[imgindex(subtype)]);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(imgs[imgindex(subtype)]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[imgindex(subtype)].X, loc.Y + offsets[imgindex(subtype)].Y));
+ }
+
public override Type ObjectType
{
get
diff --git a/S2LVL INI Files/EHZ/Bridge.cs b/S2LVL INI Files/EHZ/Bridge.cs
index 95fbe2d5..0c1cf75a 100644
--- a/S2LVL INI Files/EHZ/Bridge.cs
+++ b/S2LVL INI Files/EHZ/Bridge.cs
@@ -62,9 +62,15 @@ namespace S2ObjectDefinitions.EHZ
{
int st = Bounds(loc, subtype).X;
for (int i = 0; i < (subtype & 0x1F); i++)
- {
gfx.DrawImageFlipped(img, st + (i * imgw), loc.Y + offset.Y, false, false);
- }
+ }
+
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(img);
+ int st = Bounds(loc, subtype).X;
+ for (int i = 0; i < (subtype & 0x1F); i++)
+ bmp.DrawBitmapComposited(bits, new Point(st + (i * imgw), loc.Y + offset.Y));
}
public override Rectangle Bounds(Point loc, byte subtype)
diff --git a/S2LVL INI Files/EHZ/Platform.cs b/S2LVL INI Files/EHZ/Platform.cs
index f391b0fd..fd628585 100644
--- a/S2LVL INI Files/EHZ/Platform.cs
+++ b/S2LVL INI Files/EHZ/Platform.cs
@@ -72,6 +72,13 @@ namespace S2ObjectDefinitions.EHZ
gfx.DrawImageFlipped(imgs[(subtype & 0x10) >> 4], loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y, XFlip, YFlip);
}
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ BitmapBits bits = new BitmapBits(imgs[(subtype & 0x10) >> 4]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y));
+ }
+
public override Rectangle Bounds(Point loc, byte subtype)
{
return new Rectangle(loc.X + offsets[(subtype & 0x10) >> 4].X, loc.Y + offsets[(subtype & 0x10) >> 4].Y, imgws[(subtype & 0x10) >> 4], imghs[(subtype & 0x10) >> 4]);
diff --git a/S2LVL INI Files/EHZ/Waterfall.cs b/S2LVL INI Files/EHZ/Waterfall.cs
index a75da58d..6fe98bb6 100644
--- a/S2LVL INI Files/EHZ/Waterfall.cs
+++ b/S2LVL INI Files/EHZ/Waterfall.cs
@@ -108,5 +108,13 @@ namespace S2ObjectDefinitions.EHZ
item.Palette = pal;
}
}
+
+ public override void DrawExport(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
+ {
+ if (subtype > 5) subtype = 1;
+ BitmapBits bits = new BitmapBits(imgs[subtype]);
+ bits.Flip(XFlip, YFlip);
+ bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[subtype].X, loc.Y + offsets[subtype].Y));
+ }
}
}