summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/DataLoader.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-12 19:18:05 +0200
committerAki <please@ignore.pl>2022-04-12 19:18:05 +0200
commit63e7217838a6f795bc2e40a475f2a61100f89dad (patch)
treecf21ec16983e6986ade1a20d06255876dd787533 /StarsEx/DataLoader.cpp
parentdc55c64d0d7fef87fce72c272d02f874efff4397 (diff)
downloadstarshatter-63e7217838a6f795bc2e40a475f2a61100f89dad.zip
starshatter-63e7217838a6f795bc2e40a475f2a61100f89dad.tar.gz
starshatter-63e7217838a6f795bc2e40a475f2a61100f89dad.tar.bz2
Removed prefix from data sources
This to avoid any potential issues due to use of mutable state across several objects that is in the end expected to be the same. This fits well as a function parameter.
Diffstat (limited to 'StarsEx/DataLoader.cpp')
-rw-r--r--StarsEx/DataLoader.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/StarsEx/DataLoader.cpp b/StarsEx/DataLoader.cpp
index 95e8444..2ef84c3 100644
--- a/StarsEx/DataLoader.cpp
+++ b/StarsEx/DataLoader.cpp
@@ -224,9 +224,7 @@ DataLoader::FindFile(const char* name)
// first check current directory:
if (work_directory_source) {
- work_directory_source->SetPrefix(datapath);
- bool found = work_directory_source->Find(name);
- work_directory_source->SetPrefix();
+ bool found = work_directory_source->Find(datapath, name);
if (found)
return true;
}
@@ -335,9 +333,7 @@ void
DataLoader::ListFileSystem(const char* filter, List<Text>& list, Text base_path, bool recurse)
{
if (work_directory_source) {
- work_directory_source->SetPrefix(base_path);
- work_directory_source->ListFiles(filter, list, recurse);
- work_directory_source->SetPrefix();
+ work_directory_source->ListFiles(base_path, filter, list, recurse);
}
}
@@ -354,9 +350,7 @@ DataLoader::LoadBuffer(const char* name, BYTE*& buf, bool null_terminate, bool o
strcat_s(filename, name);
if (work_directory_source) {
- work_directory_source->SetPrefix(datapath);
- int len = work_directory_source->Load(name, buf, null_terminate);
- work_directory_source->SetPrefix();
+ int len = work_directory_source->Load(datapath, name, buf, null_terminate);
if (len > 0)
return len;
if (buf)