@@ -36,6 +36,7 @@ class Program
36
36
private static int _heightMap = 1 ;
37
37
private static int _gridSize = 126 ;
38
38
private static int _colorLimit = 256 ;
39
+ private static int _chunkSize = 125 ;
39
40
40
41
private const int MAX_WORLD_WIDTH = 2001 ;
41
42
private const int MAX_WORLD_HEIGHT = 2001 ;
@@ -50,6 +51,7 @@ public static void Main(string[] args)
50
51
{ "c|color" , "enable color when generating heightmap" , v => _color = v != null } ,
51
52
{ "cm|color-from-file=" , "load colors from file" , v => _inputColorFile = v } ,
52
53
{ "cl|color-limit=" , "set the maximal number of colors for the palette" , ( int v ) => _colorLimit = v } ,
54
+ { "cs|chunk-size=" , "set the chunk size" , ( int v ) => _chunkSize = v } ,
53
55
{ "e|excavate" , "delete all voxels which doesn't have at least one face connected with air" , v => _excavate = v != null } ,
54
56
{ "fl|flood" , "fill all invisible voxels" , v => _flood = v != null } ,
55
57
{ "flo|fix-lonely" , "delete all voxels where all connected voxels are air" , v => _lonely = v != null } ,
@@ -146,7 +148,8 @@ private static void CheckArguments()
146
148
throw new ArgumentException ( "[ERROR] --color-limit argument must be positive" ) ;
147
149
if ( _colorLimit > 256 )
148
150
throw new ArgumentException ( "[ERROR] --color-limit argument must be lower than 256" ) ;
149
-
151
+ if ( _chunkSize <= 10 || _chunkSize > 255 )
152
+ throw new ArgumentException ( "[ERROR] --chunk-size argument must be lower than 256 and greater than 10" ) ;
150
153
}
151
154
152
155
private static void DisplayArguments ( )
@@ -169,6 +172,8 @@ private static void DisplayArguments()
169
172
Console . WriteLine ( "[INFO] Specified increase size: " + _scale ) ;
170
173
if ( _gridSize != 126 )
171
174
Console . WriteLine ( "[INFO] Specified grid size: " + _gridSize ) ;
175
+ if ( _chunkSize != 125 )
176
+ Console . WriteLine ( "[INFO] Specified chunk size: " + _chunkSize ) ;
172
177
if ( _slow != 0 )
173
178
Console . WriteLine ( "[INFO] Specified winding_number: " + _slow ) ;
174
179
if ( _excavate )
@@ -305,11 +310,11 @@ private static void SchematicToVox(AbstractToSchematic converter, string outputP
305
310
{
306
311
PaletteSchematicConverter converterPalette = new PaletteSchematicConverter ( _inputPaletteFile , _colorLimit ) ;
307
312
schematic = converterPalette . ConvertSchematic ( schematic ) ;
308
- writer . WriteModel ( outputPath + ".vox" , converterPalette . GetPalette ( ) , schematic ) ;
313
+ writer . WriteModel ( _chunkSize , outputPath + ".vox" , converterPalette . GetPalette ( ) , schematic ) ;
309
314
}
310
315
else
311
316
{
312
- writer . WriteModel ( outputPath + ".vox" , null , schematic ) ;
317
+ writer . WriteModel ( _chunkSize , outputPath + ".vox" , null , schematic ) ;
313
318
}
314
319
}
315
320
0 commit comments