Rearrange resource structure
- All resources are now under data/ - Editors and Blades of Exile Base are no longer in Scenario Editor subfolder - User scenarios are now stored in %APPDATA% / "Application Support"
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "cursors.hpp"
|
||||
|
||||
bool mac_is_intel;
|
||||
fs::path progDir, tempDir;
|
||||
fs::path progDir, tempDir, scenDir;
|
||||
|
||||
// Cursors included here so that they needn't be unnecessarily duplicated in platform-specific files
|
||||
cursor_type current_cursor = sword_curs;
|
||||
@@ -36,13 +36,12 @@ void init_directories(const char* exec_path) {
|
||||
progDir = progDir.parent_path().parent_path().parent_path();
|
||||
#endif
|
||||
progDir = progDir.parent_path();
|
||||
if(progDir.filename() == "Scenario Editor") progDir = progDir.parent_path();
|
||||
// Initialize the resource manager paths
|
||||
ResMgr::pushPath<ImageRsrc>(progDir/"Scenario Editor"/"graphics.exd"/"mac");
|
||||
ResMgr::pushPath<CursorRsrc>(progDir/"Scenario Editor"/"graphics.exd"/"mac"/"cursors");
|
||||
ResMgr::pushPath<ImageRsrc>(progDir/"data"/"graphics");
|
||||
ResMgr::pushPath<CursorRsrc>(progDir/"data"/"cursors");
|
||||
ResMgr::pushPath<FontRsrc>(progDir/"data"/"fonts");
|
||||
ResMgr::pushPath<StringRsrc>(progDir/"data"/"strings");
|
||||
ResMgr::pushPath<SoundRsrc>(progDir/"Scenario Editor"/"sounds.exa");
|
||||
ResMgr::pushPath<SoundRsrc>(progDir/"data"/"sounds");
|
||||
|
||||
// We need a location for temporary files, primarily for loading and saving operations
|
||||
// The scenario editor may also use this location as "scratch space"
|
||||
@@ -57,6 +56,7 @@ void init_directories(const char* exec_path) {
|
||||
tempDir /= ".oboe/blades";
|
||||
#endif // __APPLE__
|
||||
#endif // _Win32||_Win64
|
||||
scenDir = tempDir/"Scenarios";
|
||||
tempDir /= "Temporary Files";
|
||||
|
||||
// Depending on the build environment, we may need to redirect stdout and stderr.
|
||||
|
@@ -64,14 +64,14 @@ bool load_scenario(fs::path file_to_load, cScenario& scenario, bool only_header)
|
||||
// Before loading a scenario, we may need to pop scenario resource paths.
|
||||
fs::path graphics_path = ResMgr::popPath<ImageRsrc>();
|
||||
for(auto p : graphics_path) {
|
||||
if(p.string() == "graphics.exd") {
|
||||
if(p.string() == "graphics") {
|
||||
ResMgr::pushPath<ImageRsrc>(graphics_path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fs::path sounds_path = ResMgr::popPath<SoundRsrc>();
|
||||
for(auto p : sounds_path) {
|
||||
if(p.string() == "sounds.exa") {
|
||||
if(p.string() == "sounds") {
|
||||
ResMgr::pushPath<SoundRsrc>(sounds_path);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user