More JoeyDev work.

This commit is contained in:
Scott Duensing 2021-05-17 21:12:49 -05:00
parent b76e19467c
commit fd5875e651

View file

@ -1054,32 +1054,40 @@ jbool jlUtilInputRead(jbyte *key) {
char *jlUtilMakePathname(char *filename, char *extension) { char *jlUtilMakePathname(char *filename, char *extension) {
char temp[2]; char temp[2];
// If JOEY_TOOLS is defined, we use the filename as-is and just append the extension.
// However, if JOEY_DEV_DATA_PATH is defined, we pre-pend the name with the data path and add the extension.
// Otherwise, we pre-pend with 'data' and add the extension.
temp[0] = JOEY_PATH_SEPARATOR; temp[0] = JOEY_PATH_SEPARATOR;
temp[1] = 0; temp[1] = 0;
_jlTempString[0] = 0; _jlTempString[0] = 0;
#ifdef JOEY_TOOLS #ifdef JOEY_TOOLS
(void)temp;
#ifdef JOEY_DEV_DATA_PATH #ifdef JOEY_DEV_DATA_PATH
// However, if JOEY_DEV_DATA_PATH is defined, we pre-pend the name with the data path and add the extension.
// Running *UNDER* JoeyDev as a JoeyLib app. JOEY_DEV_DATA_PATH defined. // Running *UNDER* JoeyDev as a JoeyLib app. JOEY_DEV_DATA_PATH defined.
(void)temp;
strcat(_jlTempString, JOEY_DEV_DATA_PATH); strcat(_jlTempString, JOEY_DEV_DATA_PATH);
#endif
#else
// Standard use case - compiled application.
strcat(_jlTempString, "data");
strcat(_jlTempString, temp);
#endif
// Add extension.
strcat(_jlTempString, filename); strcat(_jlTempString, filename);
if (extension != NULL) { if (extension != NULL) {
strcat(_jlTempString, "."); strcat(_jlTempString, ".");
strcat(_jlTempString, extension); strcat(_jlTempString, extension);
} }
#else
// If JOEY_TOOLS is defined alone, we use the filename as-is.
(void)temp;
(void)extension;
strcat(_jlTempString, filename);
#endif
#else
// Otherwise, we pre-pend with 'data' and add the extension.
// Standard use case - compiled application.
strcat(_jlTempString, "data");
strcat(_jlTempString, temp);
strcat(_jlTempString, filename);
if (extension != NULL) {
strcat(_jlTempString, ".");
strcat(_jlTempString, extension);
}
#endif
//printf("%s\n", _jlTempString);
return _jlTempString; return _jlTempString;
} }