SDL: Install vba-over.ini in the data directory and use it.

This commit is contained in:
bgk 2011-12-28 10:23:38 +00:00
parent 4817403abf
commit 9ca7db29f5
2 changed files with 16 additions and 8 deletions

View File

@ -416,6 +416,7 @@ IF( ENABLE_SDL )
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
DESTINATION ${SYSCONFDIR} DESTINATION ${SYSCONFDIR}
RENAME vbam.cfg) RENAME vbam.cfg)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vba-over.ini DESTINATION ${DATA_INSTALL_DIR})
ENDIF( ENABLE_SDL ) ENDIF( ENABLE_SDL )
IF( ENABLE_GTK ) IF( ENABLE_GTK )

View File

@ -468,14 +468,7 @@ FILE *sdlFindFile(const char *name)
if(f != NULL) if(f != NULL)
return f; return f;
} }
#else // ! _WIN32
fprintf(stdout, "Searching system config directory: %s\n", SYSCONFDIR);
sprintf(path, "%s%c%s", SYSCONFDIR, FILE_SEP, name);
f = fopen(path, "r");
if(f != NULL)
return f;
#endif // ! _WIN32
if(!strchr(arg0, '/') && if(!strchr(arg0, '/') &&
!strchr(arg0, '\\')) { !strchr(arg0, '\\')) {
char *path = getenv("PATH"); char *path = getenv("PATH");
@ -515,6 +508,20 @@ FILE *sdlFindFile(const char *name)
return f; return f;
} }
} }
#else // ! _WIN32
fprintf(stdout, "Searching data directory: %s\n", PKGDATADIR);
sprintf(path, "%s%c%s", PKGDATADIR, FILE_SEP, name);
f = fopen(path, "r");
if(f != NULL)
return f;
fprintf(stdout, "Searching system config directory: %s\n", SYSCONFDIR);
sprintf(path, "%s%c%s", SYSCONFDIR, FILE_SEP, name);
f = fopen(path, "r");
if(f != NULL)
return f;
#endif // ! _WIN32
return NULL; return NULL;
} }