Remove FlaxException

This commit is contained in:
Wojtek Figat
2022-03-27 23:57:36 +02:00
parent e89e6edfb8
commit 5d0c27dff3
19 changed files with 55 additions and 95 deletions

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Tools.Terrain.Brushes;
using FlaxEngine;
@@ -129,9 +130,7 @@ namespace FlaxEditor.Tools.Terrain.Paint
// Get the patch data (cached internally by the c++ core in editor)
var sourceData = TerrainTools.GetSplatMapData(terrain, ref patch.PatchCoord, splatmapIndex);
if (sourceData == null)
{
throw new FlaxException("Cannot modify terrain. Loading splatmap failed. See log for more info.");
}
throw new Exception("Cannot modify terrain. Loading splatmap failed. See log for more info.");
// Record patch data before editing it
if (!gizmo.CurrentEditUndoAction.HashPatch(ref patch.PatchCoord))

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Tools.Terrain.Brushes;
using FlaxEngine;
@@ -128,9 +129,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt
float* sourceHeights = EditHoles ? null : TerrainTools.GetHeightmapData(terrain, ref patch.PatchCoord);
byte* sourceHoles = EditHoles ? TerrainTools.GetHolesMaskData(terrain, ref patch.PatchCoord) : null;
if (sourceHeights == null && sourceHoles == null)
{
throw new FlaxException("Cannot modify terrain. Loading heightmap failed. See log for more info.");
}
throw new Exception("Cannot modify terrain. Loading heightmap failed. See log for more info.");
// Record patch data before editing it
if (!gizmo.CurrentEditUndoAction.HashPatch(ref patch.PatchCoord))

View File

@@ -37,7 +37,7 @@ namespace FlaxEditor.Tools.Terrain.Undo
var offset = Int2.Zero;
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
if (TerrainTools.ModifyHeightMap(Terrain, ref patchCoord, (float*)data, ref offset, ref size))
throw new FlaxException("Failed to modify the heightmap.");
throw new Exception("Failed to modify the heightmap.");
}
}
}

View File

@@ -37,7 +37,7 @@ namespace FlaxEditor.Tools.Terrain.Undo
var offset = Int2.Zero;
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
if (TerrainTools.ModifyHolesMask(Terrain, ref patchCoord, (byte*)data, ref offset, ref size))
throw new FlaxException("Failed to modify the terrain holes.");
throw new Exception("Failed to modify the terrain holes.");
}
}
}

View File

@@ -37,7 +37,7 @@ namespace FlaxEditor.Tools.Terrain.Undo
var offset = Int2.Zero;
var size = new Int2((int)Mathf.Sqrt(_heightmapLength));
if (TerrainTools.ModifySplatMap(Terrain, ref patchCoord, (int)tag, (Color32*)data, ref offset, ref size))
throw new FlaxException("Failed to modify the splatmap.");
throw new Exception("Failed to modify the splatmap.");
}
}
}