diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-06-05 20:28:55 -0500 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2021-06-05 20:28:55 -0500 |
| commit | 037d96a5d96bae6e341d8f7ca4f485d519cde02b (patch) | |
| tree | 6b25ebc80bd2ce74372241793ec2e4724acb71f1 /src/text_file_functions.cpp | |
| parent | d27501313cae78b838c1e738ebfaeae4740a23b4 (diff) | |
Use intuitive behavior for loading assets with ambiguous extensions
Diffstat (limited to 'src/text_file_functions.cpp')
| -rw-r--r-- | src/text_file_functions.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index c92287fb..9c463417 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -495,32 +495,21 @@ QString AOApplication::get_court_sfx(QString p_identifier, QString p_misc) return ""; } -QString AOApplication::get_suffix(VPath path_to_check, QStringList suffixes) { - for (const QString &suffix : suffixes) { - QString path = get_real_path(VPath(path_to_check.toQString() + suffix)); - if (!path.isEmpty()) - return path; - } - - return QString(); -} - QString AOApplication::get_sfx_suffix(VPath sound_to_check) { - return get_suffix(sound_to_check, { "", ".opus", ".ogg", ".mp3", ".wav" }); + return get_real_suffixed_path(sound_to_check, + { "", ".opus", ".ogg", ".mp3", ".wav" }); } QString AOApplication::get_image_suffix(VPath path_to_check, bool static_image) { QStringList suffixes { "" }; - // A better method would to actually use AOImageReader and see if these images have more than 1 frame. - // However, that might not be performant. if (!static_image) { suffixes.append({ ".webp", ".apng", ".gif" }); } suffixes.append(".png"); - return get_suffix(path_to_check, suffixes); + return get_real_suffixed_path(path_to_check, suffixes); } // returns whatever is to the right of "search_line =" within target_tag and |
