Skip to content

Commit

Permalink
- icon for enable/disable physic layer
Browse files Browse the repository at this point in the history
- fixes in plugin (changes in MapRender class api)
  • Loading branch information
spiiin committed Nov 10, 2018
1 parent a69bd4f commit a2d426d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
Binary file added CadEditor/icons/icon-f.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions PluginExportScreens/PluginExportScreens.cs
Expand Up @@ -72,15 +72,20 @@ private void bttExportPic_Click(object sender, EventArgs e)
{
if (SaveScreensCount.count <= 0)
{
MessageBox.Show("Screens count value must be greater than 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Screens count value must be greater than 0", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}

int saveLastIndex = SaveScreensCount.first + SaveScreensCount.count;
var screens = ConfigScript.loadScreens();
int screensCount = screens.Length;
if (saveLastIndex > screensCount)
{
MessageBox.Show(string.Format("First screen + Screens Count value ({0}) must be less than Total Screen Count in the game ({1}", saveLastIndex, screensCount), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(
string.Format(
"First screen + Screens Count value ({0}) must be less than Total Screen Count in the game ({1}",
saveLastIndex, screensCount), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

Expand All @@ -89,7 +94,17 @@ private void bttExportPic_Click(object sender, EventArgs e)
int firstH = screens[0].height;
float curScale = formMain.curScale;
//only for screens with same sizes
var probeIm = MapEditor.screenToImage(formMain.bigBlocks,formMain.screens, formMain.screenNo, curScale, false, 0, 0, firstW, firstH);

var renderParams = new MapEditor.RenderParams
{
bigBlocks = formMain.bigBlocks,
curScale = curScale,
showBorder = false,
width = firstW,
height = firstH
};

var probeIm = MapEditor.screenToImage(formMain.screens, formMain.screenNo, renderParams);
int screenCount = SaveScreensCount.count;
var resultImage = new Bitmap(probeIm.Width * screenCount, probeIm.Height);
using (var g = Graphics.FromImage(resultImage))
Expand All @@ -98,7 +113,7 @@ private void bttExportPic_Click(object sender, EventArgs e)
{
int width = screens[i].width;
int height = screens[i].height;
var im = MapEditor.screenToImage(formMain.bigBlocks, formMain.screens, first + i, curScale, false, 0, 0, width, height);
var im = MapEditor.screenToImage(formMain.screens, first + i, renderParams);
g.DrawImage(im, new Point(i * im.Width, 0));
}
}
Expand Down
12 changes: 9 additions & 3 deletions PluginVideoNes/PluginVideoNes.cs
Expand Up @@ -293,11 +293,17 @@ public Bitmap makeScreen(int scrNo, int levelNo, int videoNo, int bigBlockNo, in
//var bigBlocks = makeBigBlocks(videoNo, bigBlockNo, blockNo, palleteNo, MapViewType.ObjType,MapViewType.Tiles, withBorders);
var screens = ConfigScript.loadScreens(); //Need to send it to function parameters to avoid reloads for every screen
Screen screen = screens[scrNo];
int scrW = screen.width;
int scrH = screen.height;
//capcom hardcode

return new Bitmap(MapEditor.screenToImage(bigBlocks, screens, scrNo, 2.0f, false, 0, 0, scrW, scrH));
return new Bitmap(MapEditor.screenToImage(screens, scrNo, new MapEditor.RenderParams
{
bigBlocks = bigBlocks,
curScale = 2.0f,
showBorder = false,
width = screen.width,
height = screen.height

}));
}

public Color[] defaultNesColors
Expand Down

0 comments on commit a2d426d

Please sign in to comment.