Skip to content

Commit

Permalink
Improved memory utilization
Browse files Browse the repository at this point in the history
  • Loading branch information
HeDo88TH committed Oct 30, 2023
1 parent d8a213e commit 99591ef
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Obj2Tiles/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,74 +34,76 @@ private static IEnumerable<string> GetMtlDependencies(string mtlPath)
var mtlFile = File.ReadAllLines(mtlPath);

var dependencies = new List<string>();


foreach (var line in mtlFile)
{
if (line.Trim().StartsWith("map_Kd"))

var trimmedLine = line.Trim();

if (trimmedLine.StartsWith("map_Kd"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.Trim().StartsWith("map_Ka"))
if (trimmedLine.StartsWith("map_Ka"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.Trim().StartsWith("norm"))
if (trimmedLine.StartsWith("norm"))
{
dependencies.Add(line[5..].Trim());

continue;
}

if (line.Trim().StartsWith("map_Ks"))
if (trimmedLine.StartsWith("map_Ks"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.Trim().StartsWith("map_Bump"))
if (trimmedLine.StartsWith("map_Bump"))
{
dependencies.Add(line[8..].Trim());

continue;
}

if (line.Trim().StartsWith("map_d"))
if (trimmedLine.StartsWith("map_d"))
{
dependencies.Add(line[6..].Trim());

continue;
}

if (line.Trim().StartsWith("map_Ns"))
if (trimmedLine.StartsWith("map_Ns"))
{
dependencies.Add(line[7..].Trim());

continue;
}

if (line.Trim().StartsWith("bump"))
if (trimmedLine.StartsWith("bump"))
{
dependencies.Add(line[5..].Trim());

continue;
}

if (line.Trim().StartsWith("disp"))
if (trimmedLine.StartsWith("disp"))
{
dependencies.Add(line[5..].Trim());

continue;
}

if (line.Trim().StartsWith("decal"))
if (trimmedLine.StartsWith("decal"))
{
dependencies.Add(line[6..].Trim());

Expand Down

0 comments on commit 99591ef

Please sign in to comment.