@@ -55,9 +55,7 @@ public static MapInfo EmptyMap(int size, float landHeight)
5555 Parallel . For ( 0 , splatRes , i =>
5656 {
5757 for ( int j = 0 ; j < splatRes ; j ++ )
58- {
5958 terrains . alphaMap [ i , j ] = true ;
60- }
6159 } ) ;
6260 terrains . topology = new TerrainMap < int > ( new byte [ ( int ) Mathf . Pow ( splatRes , 2 ) * 4 * 1 ] , 1 ) ;
6361 return terrains ;
@@ -144,12 +142,8 @@ public static MapInfo WorldToTerrain(WorldSerialization world)
144142 }
145143
146144 /// <summary>Converts Unity terrains to WorldSerialization.</summary>
147- public static WorldSerialization TerrainToWorld ( Terrain land , Terrain water , int progressID )
145+ public static WorldSerialization TerrainToWorld ( Terrain land , Terrain water , ( int prefab , int path , int terrain ) ID )
148146 {
149- int prefabID = Progress . Start ( "Prefabs" , null , Progress . Options . Sticky , progressID ) ;
150- int pathID = Progress . Start ( "Paths" , null , Progress . Options . Sticky , progressID ) ;
151- int terrainID = Progress . Start ( "Terrain" , null , Progress . Options . Sticky , progressID ) ;
152-
153147 WorldSerialization world = new WorldSerialization ( ) ;
154148 world . world . size = ( uint ) land . terrainData . size . x ;
155149
@@ -208,8 +202,7 @@ public static WorldSerialization TerrainToWorld(Terrain land, Terrain water, int
208202 world . world . prefabs . Insert ( 0 , p . prefabData ) ;
209203 }
210204 }
211- Progress . Report ( prefabID , 0.99f , "Saved " + PrefabManager . CurrentMapPrefabs . Length + " prefabs." ) ;
212- Progress . Finish ( prefabID , Progress . Status . Succeeded ) ;
205+ Progress . Report ( ID . prefab , 0.99f , "Saved " + PrefabManager . CurrentMapPrefabs . Length + " prefabs." ) ;
213206
214207 foreach ( PathDataHolder p in PathManager . CurrentMapPaths )
215208 {
@@ -224,15 +217,13 @@ public static WorldSerialization TerrainToWorld(Terrain land, Terrain water, int
224217 world . world . paths . Insert ( 0 , p . pathData ) ;
225218 }
226219 }
227- Progress . Report ( pathID , 0.99f , "Saved " + PathManager . CurrentMapPaths . Length + " paths." ) ;
228- Progress . Finish ( pathID , Progress . Status . Succeeded ) ;
220+ Progress . Report ( ID . path , 0.99f , "Saved " + PathManager . CurrentMapPaths . Length + " paths." ) ;
229221
230222 byte [ ] landHeightBytes = FloatArrayToByteArray ( land . terrainData . GetHeights ( 0 , 0 , land . terrainData . heightmapResolution , land . terrainData . heightmapResolution ) ) ;
231223 byte [ ] waterHeightBytes = FloatArrayToByteArray ( water . terrainData . GetHeights ( 0 , 0 , water . terrainData . heightmapResolution , water . terrainData . heightmapResolution ) ) ;
232224
233225 Task . WaitAll ( splatTask , biomeTask , alphaTask , topologyTask ) ;
234- Progress . Report ( terrainID , 0.99f , "Saved " + TerrainManager . TerrainSize . x + " size map." ) ;
235- Progress . Finish ( terrainID , Progress . Status . Succeeded ) ;
226+ Progress . Report ( ID . terrain , 0.99f , "Saved " + TerrainSize . x + " size map." ) ;
236227
237228 world . AddMap ( "terrain" , landHeightBytes ) ;
238229 world . AddMap ( "height" , landHeightBytes ) ;
0 commit comments