Skip to content

Commit

Permalink
Removed scale parameter for .schematic file
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarbuz committed Sep 17, 2021
1 parent b342402 commit db45f2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 6 additions & 12 deletions SchematicToVoxCore/Converter/SchematicToSchematic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ namespace FileToVox.Converter
{
public class SchematicToSchematic : AbstractToSchematic
{
private readonly int mScale;

private readonly bool mExcavate;
private readonly Dictionary<Tuple<int, int>, Color> mColors = new Dictionary<Tuple<int, int>, Color>();

public SchematicToSchematic(string path, bool excavate, float scale) : base(path)
public SchematicToSchematic(string path, bool excavate) : base(path)
{
mScale = (int)scale;
mExcavate = excavate;
LoadBlocks();
}
Expand Down Expand Up @@ -125,20 +122,17 @@ private Schematic CreateSchematic(RawSchematic rawSchematic)
//Sorted by height (bottom to top) then length then width -- the index of the block at X,Y,Z is (Y×length + Z)×width + X.
Schematic schematic = new Schematic();

int total = (rawSchematic.Heigth * mScale) * (rawSchematic.Length * mScale) * (rawSchematic.Width * mScale);
int total = (rawSchematic.Heigth) * (rawSchematic.Length) * (rawSchematic.Width);
int indexProgress = 0;
using (ProgressBar progressbar = new ProgressBar())
{
for (int y = 0; y < (rawSchematic.Heigth * mScale); y++)
for (int y = 0; y < (rawSchematic.Heigth); y++)
{
for (int z = 0; z < (rawSchematic.Length * mScale); z++)
for (int z = 0; z < (rawSchematic.Length); z++)
{
for (int x = 0; x < (rawSchematic.Width * mScale); x++)
for (int x = 0; x < (rawSchematic.Width); x++)
{
int yProgress = (y / mScale);
int zProgress = (z / mScale);
int xProgress = (x / mScale);
int index = (yProgress * rawSchematic.Length + zProgress) * rawSchematic.Width + xProgress;
int index = (y * rawSchematic.Length + z) * rawSchematic.Width + x;
int blockId = rawSchematic.Blocks[index];
if (blockId != 0)
{
Expand Down
4 changes: 2 additions & 2 deletions SchematicToVoxCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private static void DisplayArguments()
Console.WriteLine("[INFO] Specified shaders file: " + INPUT_SHADER_FILE);
if (COLOR_LIMIT != 256)
Console.WriteLine("[INFO] Specified color limit: " + COLOR_LIMIT);
if (GRID_SIZE != 1)
if (GRID_SIZE != 10)
Console.WriteLine("[INFO] Specified grid size: " + GRID_SIZE);
if (Schematic.CHUNK_SIZE != 128)
Console.WriteLine("[INFO] Specified chunk size: " + Schematic.CHUNK_SIZE);
Expand Down Expand Up @@ -255,7 +255,7 @@ private static AbstractToSchematic GetConverter(string path)
case ".qb":
return new QBToSchematic(path);
case ".schematic":
return new SchematicToSchematic(path, EXCAVATE, GRID_SIZE);
return new SchematicToSchematic(path, EXCAVATE);
case ".tif":
return new TIFtoSchematic(path, INPUT_COLOR_FILE, HEIGHT_MAP, EXCAVATE, COLOR, COLOR_LIMIT);
case ".xyz":
Expand Down

0 comments on commit db45f2a

Please sign in to comment.