Added additional settings to control assets prefix.

This commit is contained in:
2021-08-27 20:30:53 -07:00
parent 23c0bdaba6
commit 01c26b9e16
4 changed files with 13 additions and 8 deletions

View File

@ -35,14 +35,14 @@ char * assetStringLoad(char *assetName) {
assetbuffer_t * assetBufferOpen(char *assetName) {
// Get the directory based on the raw input by creating a new string.
size_t lenAsset = strlen(assetName);// Get the length of asset
size_t lenPrefix = strlen(ASSET_PREFIX);// Get the length of the prefix
size_t lenPrefix = strlen(SETTING_ASSET_PREFIX);// Get the length of the prefix
// Create str to house both the prefix and asset, and null terminator
char *joined = malloc(lenAsset + lenPrefix + 1);
if(joined == NULL) return NULL;// Mem okay?
joined[0] = '\0';//Start at null
strcat(joined, ASSET_PREFIX);//Add prefix
strcat(joined, SETTING_ASSET_PREFIX);//Add prefix
strcat(joined, assetName);//Add body
printf("Opening up %s\n", joined);