mirror of
https://github.com/sarah-walker-pcem/pcem.git
synced 2025-07-23 19:50:35 +02:00
Added a way for executable path configs
To use, all you need to do is put your config folders in a subdirectory called .pcem in the directory the EXE is located in. If the .pcem directory exists in the same directory as the exe it will use it for configs.
This commit is contained in:
@@ -230,10 +230,12 @@ void get_pcem_path(char *s, int size) {
|
||||
mkdir(s, 0700);
|
||||
}
|
||||
#else
|
||||
char* sdlBasePath = SDL_GetBasePath();
|
||||
strcpy(s, sdlBasePath);
|
||||
strcat(s, ".pcem/");
|
||||
if(!wx_dir_exists(s)) {
|
||||
wx_get_home_directory(s);
|
||||
strcat(s, ".pcem/");
|
||||
|
||||
if (!wx_dir_exists(pcem_path))
|
||||
wx_create_directory(pcem_path);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ set(PCEM_SRC_PLUGINAPI
|
||||
|
||||
if(PLUGIN_ENGINE)
|
||||
add_library(pcem-plugin-api SHARED ${PCEM_SRC_PLUGINAPI} ${PCEM_PUBLIC_API})
|
||||
target_link_libraries(pcem-plugin-api ${DISPLAY_ENGINE_LIBRARIES})
|
||||
target_link_libraries(pcem-plugin-api ${SDL2_LIBRARIES} ${DISPLAY_ENGINE_LIBRARIES})
|
||||
target_compile_definitions(pcem-plugin-api PUBLIC ${PCEM_DEFINES})
|
||||
install(TARGETS pcem-plugin-api RUNTIME DESTINATION ${PCEM_BIN_DIR} LIBRARY DESTINATION ${PCEM_LIB_DIR} ARCHIVE DESTINATION ${PCEM_LIB_DIR})
|
||||
set(PCEM_LIBRARIES ${PCEM_LIBRARIES} pcem-plugin-api)
|
||||
|
@@ -418,6 +418,8 @@ void sdl_onconfigloaded() {
|
||||
wx_callback(ghwnd, wx_setupmenu, 0);
|
||||
|
||||
/* create directories */
|
||||
if (!wx_dir_exists(pcem_path))
|
||||
wx_create_directory(pcem_path);
|
||||
if (!wx_dir_exists(configs_path))
|
||||
wx_create_directory(configs_path);
|
||||
if (!wx_dir_exists(nvr_path))
|
||||
|
Reference in New Issue
Block a user