Skip to content

Commit

Permalink
Merge pull request #1700 from EliteMasterEric/bugfix/library-get-path
Browse files Browse the repository at this point in the history
Always use `getPath` instead of `paths.get()` directly.
  • Loading branch information
player-03 committed Jan 18, 2024
2 parents c121dfd + 40d70d8 commit 558fd07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/lime/utils/AssetLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class AssetLibrary
}
else
{
return AudioBuffer.fromFile(paths.get(id));
return AudioBuffer.fromFile(getPath(id));
}
}

Expand Down Expand Up @@ -239,7 +239,7 @@ class AssetLibrary
}
else
{
return Bytes.fromFile(paths.get(id));
return Bytes.fromFile(getPath(id));
}
}

Expand All @@ -263,7 +263,7 @@ class AssetLibrary
}
else
{
return Font.fromFile(paths.get(id));
return Font.fromFile(getPath(id));
}
}

Expand All @@ -283,7 +283,7 @@ class AssetLibrary
}
else
{
return Image.fromFile(paths.get(id));
return Image.fromFile(getPath(id));
}
}

Expand Down Expand Up @@ -498,7 +498,7 @@ class AssetLibrary
}
else
{
return Bytes.loadFromFile(paths.get(id));
return Bytes.loadFromFile(getPath(id));
}
}

Expand All @@ -521,9 +521,9 @@ class AssetLibrary
else
{
#if (js && html5)
return Font.loadFromName(paths.get(id));
return Font.loadFromName(getPath(id));
#else
return Font.loadFromFile(paths.get(id));
return Font.loadFromFile(getPath(id));
#end
}
}
Expand Down Expand Up @@ -579,7 +579,7 @@ class AssetLibrary
}
else
{
return Image.loadFromFile(paths.get(id));
return Image.loadFromFile(getPath(id));
}
}

Expand Down Expand Up @@ -607,7 +607,7 @@ class AssetLibrary
else
{
var request = new HTTPRequest<String>();
return request.load(paths.get(id));
return request.load(getPath(id));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lime/utils/PackedAssetLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ import flash.media.Sound;
else
{
var basePath = rootPath == null || rootPath == "" ? "" : Path.addTrailingSlash(rootPath);
var libPath = paths.exists(id) ? paths.get(id) : id;
var libPath = paths.exists(id) ? getPath(id) : id;

var path = Path.join([basePath, libPath]);
path = __cacheBreak(path);
Expand Down

1 comment on commit 558fd07

@player-03
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking closer, getPath() only matters if the asset is in pathGroups, which only happens for music and sound assets. Most of these changes don't matter yet, but they're still good in case we start grouping other assets.

Please sign in to comment.