Skip to content

Commit 6e023fa

Browse files
committed
Merge branch 'master' of github.com:blind-coder/pz-mapmap
2 parents 52157b2 + 6ffbf87 commit 6e023fa

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

MapMap/Main.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Main
3333
private bool bigtree = false;
3434
private static int numThreads = 0;
3535
private int maxThreads = 1;
36+
private int scale = 1;
3637

3738
private MMCellData childMapData;
3839

@@ -117,7 +118,7 @@ private void parseMapData()
117118
}
118119
MapMap.Main.numThreads++;
119120
Console.WriteLine("Threads: {0}/{1}", MapMap.Main.numThreads, maxThreads);
120-
MMPlotter plotter = new MMPlotter(this.divider, this.tex, this.dolayers, this.bigtree);
121+
MMPlotter plotter = new MMPlotter(this.divider, this.tex, this.dolayers, this.bigtree, this.scale);
121122
//ThreadStart childref = new ThreadStart(this.RunPlotter);
122123
//Thread childThread = new Thread(childref);
123124
Thread childThread = new Thread(() => RunPlotter(plotter, mapdata, this.OutputDir, cellx, celly));
@@ -227,6 +228,9 @@ private bool parseArgs(string[] args)
227228
case "-maxy":
228229
this.maxY = Convert.ToInt32(args[id + 1]);
229230
break;
231+
case "-scale":
232+
this.scale = Convert.ToInt32(args[id + 1]);
233+
break;
230234
}
231235
}
232236
Console.Clear();

MapMapLib/MMPlotter.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ public class MMPlotter
2626
private Random rand;
2727
private BushInit[] bush;
2828
private PlantInit[] plant;
29+
private Int32 scale;
2930

30-
public MMPlotter(int divider, MMTextures textures, bool dolayers, bool bigtree)
31+
public MMPlotter(int divider, MMTextures textures, bool dolayers, bool bigtree, Int32 scale)
3132
{
3233
Dictionary<String, List<String>> collageCategory;
3334
List<String> collageSprites;
@@ -353,6 +354,7 @@ public MMPlotter(int divider, MMTextures textures, bool dolayers, bool bigtree)
353354

354355
this.rand = new Random();
355356
this.subDiv = divider;
357+
this.scale = scale;
356358
this.subWH = (300 / this.subDiv);
357359
this.startX = (1280 * 30 / this.subDiv / 2) - 64;
358360
this.dolayers = dolayers;
@@ -455,13 +457,19 @@ public void PlotData( MMCellData cellData, string outputDir, int cellx, int cell
455457
}
456458
if (this.dolayers == true && drawCnt > 0)
457459
{
458-
this.subCell.Save(outputDir + "cell_" + cellx + "_" + celly + "_subcell_" + subx + "_" + suby + "_layer_" + z + ".png", System.Drawing.Imaging.ImageFormat.Png);
460+
Bitmap resized = new Bitmap(this.subCell,new Size(this.subCell.Width/this.scale,this.subCell.Height/this.scale));
461+
resized.Save(outputDir + "cell_" + cellx + "_" + celly + "_subcell_" + subx + "_" + suby + "_layer_" + z + ".png", System.Drawing.Imaging.ImageFormat.Png);
462+
463+
//this.subCell.Save(outputDir + "cell_" + cellx + "_" + celly + "_subcell_" + subx + "_" + suby + "_layer_" + z + ".png", System.Drawing.Imaging.ImageFormat.Png);
459464
gfx.Clear(Color.Transparent);
460465
}
461466
}
462467
if (this.dolayers == false)
463468
{
464-
this.subCell.Save(outputDir + "cell_" + cellx + "_" + celly + "_subcell_" + subx + "_" + suby + "_full.png", System.Drawing.Imaging.ImageFormat.Png);
469+
Bitmap resized = new Bitmap(this.subCell,new Size(this.subCell.Width/this.scale,this.subCell.Height/this.scale));
470+
resized.Save(outputDir + "cell_" + cellx + "_" + celly + "_subcell_" + subx + "_" + suby + "_full.png", System.Drawing.Imaging.ImageFormat.Png);
471+
472+
//this.subCell.Save(outputDir + "cell_" + cellx + "_" + celly + "_subcell_" + subx + "_" + suby + "_full.png", System.Drawing.Imaging.ImageFormat.Png);
465473
gfx.Clear(Color.Transparent);
466474
}
467475
}

0 commit comments

Comments
 (0)