From 3c431559df702cfffa2a2b9399a5ebcfee6b8531 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 17 Jul 2023 14:49:45 -0400 Subject: [PATCH 1/2] Always use `getPath` instead of `paths.get()` directly. --- src/lime/utils/AssetLibrary.hx | 20 ++++++++++---------- src/lime/utils/PackedAssetLibrary.hx | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lime/utils/AssetLibrary.hx b/src/lime/utils/AssetLibrary.hx index b368f7954f..82451f7a3b 100644 --- a/src/lime/utils/AssetLibrary.hx +++ b/src/lime/utils/AssetLibrary.hx @@ -200,7 +200,7 @@ class AssetLibrary } else { - return AudioBuffer.fromFile(paths.get(id)); + return AudioBuffer.fromFile(getPath(id)); } } @@ -239,7 +239,7 @@ class AssetLibrary } else { - return Bytes.fromFile(paths.get(id)); + return Bytes.fromFile(getPath(id)); } } @@ -263,7 +263,7 @@ class AssetLibrary } else { - return Font.fromFile(paths.get(id)); + return Font.fromFile(getPath(id)); } } @@ -283,7 +283,7 @@ class AssetLibrary } else { - return Image.fromFile(paths.get(id)); + return Image.fromFile(getPath(id)); } } @@ -477,7 +477,7 @@ class AssetLibrary } else { - return AudioBuffer.loadFromFile(paths.get(id)); + return AudioBuffer.loadFromFile(getPath(id)); } } } @@ -498,7 +498,7 @@ class AssetLibrary } else { - return Bytes.loadFromFile(paths.get(id)); + return Bytes.loadFromFile(getPath(id)); } } @@ -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 } } @@ -579,7 +579,7 @@ class AssetLibrary } else { - return Image.loadFromFile(paths.get(id)); + return Image.loadFromFile(getPath(id)); } } @@ -607,7 +607,7 @@ class AssetLibrary else { var request = new HTTPRequest(); - return request.load(paths.get(id)); + return request.load(getPath(id)); } } diff --git a/src/lime/utils/PackedAssetLibrary.hx b/src/lime/utils/PackedAssetLibrary.hx index dd976c22e9..f99b0df82a 100644 --- a/src/lime/utils/PackedAssetLibrary.hx +++ b/src/lime/utils/PackedAssetLibrary.hx @@ -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); From 40d70d8e53c1f6236c7100b7fbab9a3292f1bfd7 Mon Sep 17 00:00:00 2001 From: player-03 Date: Thu, 18 Jan 2024 13:56:44 -0500 Subject: [PATCH 2/2] Use `paths.get()` when `pathGroups` was already checked. --- src/lime/utils/AssetLibrary.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lime/utils/AssetLibrary.hx b/src/lime/utils/AssetLibrary.hx index 82451f7a3b..782bd4a433 100644 --- a/src/lime/utils/AssetLibrary.hx +++ b/src/lime/utils/AssetLibrary.hx @@ -477,7 +477,7 @@ class AssetLibrary } else { - return AudioBuffer.loadFromFile(getPath(id)); + return AudioBuffer.loadFromFile(paths.get(id)); } } }