mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 13:10:04 -05:00
--Bug fixes
-Allow running from outside of the folder the executable is in on Windows, by adding the install folder to the PATH variable. This was needed to properly find the palette file (even though it's mostly unneeded).
This commit is contained in:
parent
f15620375b
commit
ccf5a7e80f
@ -124,14 +124,22 @@ template <typename T>
|
||||
static bool InitPaletteList(const string& filename)
|
||||
{
|
||||
auto paletteList = PaletteList<float>::Instance();
|
||||
#ifdef _WIN32
|
||||
vector<char> fullpath;
|
||||
fullpath.resize(2048);
|
||||
GetModuleFileName(nullptr, fullpath.data(), fullpath.size());
|
||||
string s = GetPath(string(fullpath.data()));
|
||||
#else
|
||||
string s = "./";
|
||||
#endif
|
||||
static vector<string> paths =
|
||||
{
|
||||
"./"
|
||||
s
|
||||
#ifndef _WIN32
|
||||
, "~",
|
||||
"~/.config/fractorium",
|
||||
"/usr/share/fractorium",
|
||||
"/usr/local/share/fractorium"
|
||||
, "~/",
|
||||
"~/.config/fractorium/",
|
||||
"/usr/share/fractorium/",
|
||||
"/usr/local/share/fractorium/"
|
||||
#endif
|
||||
};
|
||||
bool added = false;
|
||||
@ -139,7 +147,7 @@ static bool InitPaletteList(const string& filename)
|
||||
for (auto& p : paths)
|
||||
{
|
||||
if (!added)
|
||||
added |= paletteList->Add(p + "/" + filename);
|
||||
added |= paletteList->Add(p + filename);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user