Skip to content

Commit

Permalink
Optimizing other levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
MainMemory committed May 25, 2015
1 parent 312b8e2 commit fd692ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
6 changes: 1 addition & 5 deletions EHZ/EHZ.cs
Expand Up @@ -56,7 +56,6 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
lock (bgimg)
{
Camera_X_pos = (ushort)(Camera_X_pos + Camera_X_pos_diff);
BitmapBits bmp = new BitmapBits(levelimg);
//Array.Clear(Horiz_Scroll_Buf, 0, 22);
int bgpos = Camera_X_pos >> 6;
Horiz_Scroll_Buf.FastFill(bgpos, 22, 58);
Expand Down Expand Up @@ -103,10 +102,7 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
bgpos2.sl += scrlamt * 4;
}
Horiz_Scroll_Buf.FastFill(-bgpos2.hsw, 252, 3);
bmp.ScrollHorizontal((int[])Horiz_Scroll_Buf.Clone());
if (Width < bmp.Width)
bmp = bmp.GetSection(0, 0, Width, bmp.Height);
tmpimg.DrawBitmapBounded(bmp, 0, tmpimg.Height - bmp.Height);
levelimg.ScrollHV(tmpimg, tmpimg.Height - levelimg.Height, 0, Horiz_Scroll_Buf);
bgimg = tmpimg.ToBitmap(LevelData.BmpPal);
}
}
Expand Down
6 changes: 1 addition & 5 deletions S2CNZ/S2CNZ.cs
Expand Up @@ -61,7 +61,6 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
lock (bgimg)
{
Camera_X_pos += Camera_X_pos_diff;
BitmapBits bmp = new BitmapBits(levelimg);
short d2 = Camera_X_pos;
int a1 = 0;
BWL d0 = d2;
Expand Down Expand Up @@ -109,10 +108,7 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
}
}
}
bmp.ScrollHorizontal((int[])Horiz_Scroll_Buf.Clone());
if (Width < bmp.Width)
bmp = bmp.GetSection(0, 0, Width, bmp.Height);
tmpimg.DrawBitmapBounded(bmp, 0, tmpimg.Height - bmp.Height);
levelimg.ScrollHV(tmpimg, tmpimg.Height - levelimg.Height, 0, Horiz_Scroll_Buf);
bgimg = tmpimg.ToBitmap(LevelData.BmpPal);
}
}
Expand Down
8 changes: 2 additions & 6 deletions SBZ1/SBZ1.cs
Expand Up @@ -93,7 +93,6 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
d4.sl <<= 5;
d4.sl += d4.sl * 2;
Camera_BG2_X_pos.l += d4.l;
BitmapBits bmp = new BitmapBits(levelimg);
int a1 = 0;
BWL d2 = Camera_X_pos;
d2.sw >>= 2;
Expand All @@ -120,15 +119,12 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
a1 += 11;
int a2 = 0;
a1 = 0;
while (a1 < bmp.Height)
while (a1 < levelimg.Height)
{
Horiz_Scroll_Buf.FastFill(TempArray_LayerDef[a2++], a1, 16);
a1 += 16;
}
bmp.ScrollHorizontal((int[])Horiz_Scroll_Buf.Clone());
if (Width < bmp.Width)
bmp = bmp.GetSection(0, 0, Width, bmp.Height);
tmpimg.DrawBitmapBounded(bmp, 0, tmpimg.Height - bmp.Height);
levelimg.ScrollHV(tmpimg, tmpimg.Height - levelimg.Height, 0, Horiz_Scroll_Buf);
bgimg = tmpimg.ToBitmap(LevelData.BmpPal);
}
}
Expand Down
8 changes: 2 additions & 6 deletions SYZ/SYZ.cs
Expand Up @@ -41,7 +41,6 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
lock (bgimg)
{
Camera_X_pos += Camera_X_pos_diff;
BitmapBits bmp = new BitmapBits(levelimg);
int a1 = 0;
BWL d2 = Camera_X_pos;
BWL d0 = d2.sw >> 3;
Expand Down Expand Up @@ -87,15 +86,12 @@ public override void UpdateScrolling(short Camera_X_pos_diff, short Camera_Y_pos
}
int a2 = 0;
a1 = 0;
while (a1 < bmp.Height)
while (a1 < levelimg.Height)
{
Horiz_Scroll_Buf.FastFill(TempArray_LayerDef[a2++], a1, 16);
a1 += 16;
}
bmp.ScrollHorizontal((int[])Horiz_Scroll_Buf.Clone());
if (Width < bmp.Width)
bmp = bmp.GetSection(0, 0, Width, bmp.Height);
tmpimg.DrawBitmapBounded(bmp, 0, tmpimg.Height - bmp.Height);
levelimg.ScrollHV(tmpimg, Math.Max(0, tmpimg.Height - levelimg.Height), 0, Horiz_Scroll_Buf);
bgimg = tmpimg.ToBitmap(LevelData.BmpPal);
}
}
Expand Down

0 comments on commit fd692ab

Please sign in to comment.