From: <ave...@us...> - 2003-12-07 09:43:28
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/KEYImporter In directory sc8-pr-cvs1:/tmp/cvs-serv4549 Modified Files: KeyImp.cpp Log Message: Fix: determining the override folder (Override or override) Index: KeyImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/KEYImporter/KeyImp.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** KeyImp.cpp 29 Nov 2003 10:29:23 -0000 1.24 --- KeyImp.cpp 7 Dec 2003 09:43:25 -0000 1.25 *************** *** 32,48 **** #endif ! #ifndef WIN32 ! #include <ctype.h> ! char *strlwr(char *string) ! { ! char *s; ! if(string) ! { ! for(s = string; *s; ++s) ! *s = tolower(*s); ! } ! return string; ! } char * FindInDir(char * Dir, char * Filename) { --- 32,38 ---- #endif ! static char overridesubfolder[9]="override"; + #ifndef WIN32 char * FindInDir(char * Dir, char * Filename) { *************** *** 64,72 **** return fn; } - #endif KeyImp::KeyImp(void) { } --- 54,69 ---- return fn; } #endif KeyImp::KeyImp(void) { + if(core->CaseSensitive) { + char path[_MAX_PATH]; + strcpy(path, core->GamePath); + strcat(path, overridesubfolder); + if(!dir_exists(path) ) { + overridesubfolder[0]=toupper(overridesubfolder[0]); + } + } } *************** *** 193,201 **** char path[_MAX_PATH], BasePath[_MAX_PATH], filename[_MAX_PATH] = {0}; //Search it in the GemRB override Directory ! strcpy(path, "override"); strcat(path, SPathDelimiter); strcat(path, core->GameType); SearchIn(core->GemRBPath, path, resname, type, "[KEYImporter]: Found in GemRB Override...\n"); ! SearchIn(core->GamePath, "override", resname, type, "[KEYImporter]: Found in Override...\n"); SearchIn(core->GamePath, "Data", resname, type, "[KEYImporter]: Found in Local CD1 Folder...\n"); printf("[KEYImporter]: Searching for %.8s%s...\n", resname, core->TypeExt(type)); --- 190,198 ---- char path[_MAX_PATH], BasePath[_MAX_PATH], filename[_MAX_PATH] = {0}; //Search it in the GemRB override Directory ! strcpy(path, overridesubfolder); strcat(path, SPathDelimiter); strcat(path, core->GameType); SearchIn(core->GemRBPath, path, resname, type, "[KEYImporter]: Found in GemRB Override...\n"); ! SearchIn(core->GamePath, overridesubfolder, resname, type, "[KEYImporter]: Found in Override...\n"); SearchIn(core->GamePath, "Data", resname, type, "[KEYImporter]: Found in Local CD1 Folder...\n"); printf("[KEYImporter]: Searching for %.8s%s...\n", resname, core->TypeExt(type)); *************** *** 289,293 **** //Search it in the GemRB override Directory strcpy(path, core->GemRBPath); ! strcat(path, "override"); strcat(path, SPathDelimiter); strcat(path, core->GameType); --- 286,290 ---- //Search it in the GemRB override Directory strcpy(path, core->GemRBPath); ! strcat(path, overridesubfolder); strcat(path, SPathDelimiter); strcat(path, core->GameType); *************** *** 309,313 **** } strcpy(path, core->GamePath); ! strcat(path, "override"); strcat(path, SPathDelimiter); strncat(path, resname, 8); --- 306,310 ---- } strcpy(path, core->GamePath); ! strcat(path, overridesubfolder); strcat(path, SPathDelimiter); strncat(path, resname, 8); |