Finally fixed linux asset weirdness
This commit is contained in:
@@ -40,11 +40,11 @@ errorret_t assetInitLinux(void) {
|
|||||||
// We found the directory, set as system path
|
// We found the directory, set as system path
|
||||||
stringCopy(ASSET.platform.systemPath, buffer, ASSET_FILE_PATH_MAX);
|
stringCopy(ASSET.platform.systemPath, buffer, ASSET_FILE_PATH_MAX);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Default system path, intended to be overridden by the platform
|
||||||
|
stringCopy(ASSET.platform.systemPath, ".", ASSET_FILE_PATH_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default system path, intended to be overridden by the platform
|
|
||||||
stringCopy(ASSET.platform.systemPath, ".", ASSET_FILE_PATH_MAX);
|
|
||||||
|
|
||||||
// Open zip file
|
// Open zip file
|
||||||
char_t searchPath[ASSET_FILE_PATH_MAX];
|
char_t searchPath[ASSET_FILE_PATH_MAX];
|
||||||
const char_t **path = ASSET_LINUX_SEARCH_PATHS;
|
const char_t **path = ASSET_LINUX_SEARCH_PATHS;
|
||||||
@@ -57,6 +57,7 @@ errorret_t assetInitLinux(void) {
|
|||||||
*path,
|
*path,
|
||||||
ASSET_FILE_NAME
|
ASSET_FILE_NAME
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ensure combined length does not exceed ASSET_FILE_PATH_MAX
|
// Ensure combined length does not exceed ASSET_FILE_PATH_MAX
|
||||||
size_t syslen = strlen(ASSET.platform.systemPath);
|
size_t syslen = strlen(ASSET.platform.systemPath);
|
||||||
size_t slashlen = 1; // for '/'
|
size_t slashlen = 1; // for '/'
|
||||||
@@ -71,13 +72,13 @@ errorret_t assetInitLinux(void) {
|
|||||||
ASSET.platform.systemPath,
|
ASSET.platform.systemPath,
|
||||||
temp
|
temp
|
||||||
);
|
);
|
||||||
|
printf("Try open asset file: %s\n", searchPath);
|
||||||
|
|
||||||
// Try open
|
// Try open
|
||||||
|
error = 0;
|
||||||
ASSET.zip = zip_open(searchPath, ZIP_RDONLY, &error);
|
ASSET.zip = zip_open(searchPath, ZIP_RDONLY, &error);
|
||||||
if(ASSET.zip == NULL) continue;
|
if(ASSET.zip == NULL) {
|
||||||
if(error != 0) {
|
|
||||||
printf("Opened asset file with non-zero error code: %d\n", error);
|
printf("Opened asset file with non-zero error code: %d\n", error);
|
||||||
ASSET.zip = NULL;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;// Found!
|
break;// Found!
|
||||||
|
|||||||
Reference in New Issue
Block a user