Skip to content

Commit

Permalink
Fixing blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
MainMemory committed Apr 17, 2015
1 parent 42c841c commit fedcb8b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions SonLVL/MainForm.cs
Expand Up @@ -4294,13 +4294,15 @@ private void ImportImage(Bitmap bmp)
match = true;
cnk.Blocks[bx, by].Block = (ushort)i;
cnk.Blocks[bx, by].XFlip = true;
break;
}
flip = blk.Flip(false, true);
if (flip.Equals(LevelData.Blocks[i]))
{
match = true;
cnk.Blocks[bx, by].Block = (ushort)i;
cnk.Blocks[bx, by].YFlip = true;
break;
}
flip = blk.Flip(true, true);
if (flip.Equals(LevelData.Blocks[i]))
Expand All @@ -4309,6 +4311,7 @@ private void ImportImage(Bitmap bmp)
cnk.Blocks[bx, by].Block = (ushort)i;
cnk.Blocks[bx, by].XFlip = true;
cnk.Blocks[bx, by].YFlip = true;
break;
}
}
if (match) continue;
Expand Down Expand Up @@ -4415,11 +4418,31 @@ private void ImportImage(Bitmap bmp)
}
match = false;
for (int i = 0; i < LevelData.Blocks.Count; i++)
{
if (blk.Equals(LevelData.Blocks[i]))
{
match = true;
break;
}
Block flip = blk.Flip(true, false);
if (flip.Equals(LevelData.Blocks[i]))
{
match = true;
break;
}
flip = blk.Flip(false, true);
if (flip.Equals(LevelData.Blocks[i]))
{
match = true;
break;
}
flip = blk.Flip(true, true);
if (flip.Equals(LevelData.Blocks[i]))
{
match = true;
break;
}
}
if (match) continue;
LevelData.Blocks.Add(blk);
LevelData.ColInds1.Add(0);
Expand Down Expand Up @@ -7266,13 +7289,15 @@ private void pasteOverToolStripMenuItem_Click(object sender, EventArgs e)
match = true;
cnk.Blocks[bx, by].Block = (ushort)i;
cnk.Blocks[bx, by].XFlip = true;
break;
}
flip = blk.Flip(false, true);
if (flip.Equals(LevelData.Blocks[i]))
{
match = true;
cnk.Blocks[bx, by].Block = (ushort)i;
cnk.Blocks[bx, by].YFlip = true;
break;
}
flip = blk.Flip(true, true);
if (flip.Equals(LevelData.Blocks[i]))
Expand All @@ -7281,6 +7306,7 @@ private void pasteOverToolStripMenuItem_Click(object sender, EventArgs e)
cnk.Blocks[bx, by].Block = (ushort)i;
cnk.Blocks[bx, by].XFlip = true;
cnk.Blocks[bx, by].YFlip = true;
break;
}
}
if (match) continue;
Expand Down

0 comments on commit fedcb8b

Please sign in to comment.