paint: fix packed assets import
This commit is contained in:
@@ -121,10 +121,14 @@ void import_arm_unpack_asset(project_t *project, char *abs, char *file, bool gc_
|
|||||||
pa->name = string_copy(string_replace_all(pa->name, "\\", "/"));
|
pa->name = string_copy(string_replace_all(pa->name, "\\", "/"));
|
||||||
#endif
|
#endif
|
||||||
pa->name = string_copy(path_normalize(pa->name));
|
pa->name = string_copy(path_normalize(pa->name));
|
||||||
if (string_equals(pa->name, file)) {
|
bool matches = string_equals(pa->name, file) || string_equals(pa->name, abs);
|
||||||
pa->name = string_copy(abs); // From relative to absolute
|
if (!matches) {
|
||||||
|
char *pa_name = substring(pa->name, string_last_index_of(pa->name, PATH_SEP) + 1, string_length(pa->name));
|
||||||
|
char *file_name = substring(file, string_last_index_of(file, PATH_SEP) + 1, string_length(file));
|
||||||
|
matches = string_equals(pa_name, file_name);
|
||||||
}
|
}
|
||||||
if (string_equals(pa->name, abs)) {
|
if (matches) {
|
||||||
|
pa->name = string_copy(abs);
|
||||||
if (!project_packed_asset_exists(g_project->packed_assets, pa->name)) {
|
if (!project_packed_asset_exists(g_project->packed_assets, pa->name)) {
|
||||||
|
|
||||||
if (gc_copy) {
|
if (gc_copy) {
|
||||||
|
|||||||
Reference in New Issue
Block a user