fixed crash on invalid input followed by -i for texture packer command.
This commit is contained in:
parent
442ec92d32
commit
74a9ff74b2
@ -64,12 +64,17 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools
|
|||||||
if (input == "q") return;
|
if (input == "q") return;
|
||||||
if (input.Length == 0) break;
|
if (input.Length == 0) break;
|
||||||
} while (!int.TryParse(input, out mp));
|
} while (!int.TryParse(input, out mp));
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int indexOfInputArg = IndexOfArgumentIn("-i", arguments);
|
||||||
|
if (indexOfInputArg + 1 >= arguments.Length) throw new ArgumentException("-i is not followed by input path.");
|
||||||
path = arguments[1 + IndexOfArgumentIn("-i", arguments)];
|
path = arguments[1 + IndexOfArgumentIn("-i", arguments)];
|
||||||
int.TryParse(arguments[IndexOfArgumentIn("-mp", arguments) + 1], out mp);
|
int.TryParse(arguments[IndexOfArgumentIn("-mp", arguments) + 1], out mp);
|
||||||
int.TryParse(arguments[IndexOfArgumentIn("-sp", arguments) + 1], out sp);
|
int.TryParse(arguments[IndexOfArgumentIn("-sp", arguments) + 1], out sp);
|
||||||
|
int indexOfOutputArg = IndexOfArgumentIn("-o", arguments);
|
||||||
|
if (indexOfOutputArg + 1 >= arguments.Length) throw new ArgumentException("-o is not followed by input path.");
|
||||||
output = arguments[IndexOfArgumentIn("-o", arguments) + 1];
|
output = arguments[IndexOfArgumentIn("-o", arguments) + 1];
|
||||||
if (HasArgument("-dau", arguments)) dau = true;
|
if (HasArgument("-dau", arguments)) dau = true;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\RecrownedAthenaeum.Pipeline\RecrownedAthenaeum.Pipeline.csproj">
|
<ProjectReference Include="..\RecrownedAthenaeum.Pipeline\RecrownedAthenaeum.Pipeline.csproj">
|
||||||
<Project>{b38f9812-b1d1-4bfe-89ee-fc4dd4ebaa3f}</Project>
|
<Project>{b38f9812-b1d1-4bfe-89ee-fc4dd4ebaa3f}</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user