mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 18:40:12 -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)
|
static bool InitPaletteList(const string& filename)
|
||||||
{
|
{
|
||||||
auto paletteList = PaletteList<float>::Instance();
|
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 =
|
static vector<string> paths =
|
||||||
{
|
{
|
||||||
"./"
|
s
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
, "~",
|
, "~/",
|
||||||
"~/.config/fractorium",
|
"~/.config/fractorium/",
|
||||||
"/usr/share/fractorium",
|
"/usr/share/fractorium/",
|
||||||
"/usr/local/share/fractorium"
|
"/usr/local/share/fractorium/"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
bool added = false;
|
bool added = false;
|
||||||
@ -139,7 +147,7 @@ static bool InitPaletteList(const string& filename)
|
|||||||
for (auto& p : paths)
|
for (auto& p : paths)
|
||||||
{
|
{
|
||||||
if (!added)
|
if (!added)
|
||||||
added |= paletteList->Add(p + "/" + filename);
|
added |= paletteList->Add(p + filename);
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user