diff --git a/src/app/app.cpp b/src/app/app.cpp index a33f0c464..a500f1125 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -134,11 +134,14 @@ App::App(int argc, const char* argv[]) RenderEngine::loadConfig(); // Default palette. - if (!options.paletteFileName().empty()) { - const char* palFile = options.paletteFileName().c_str(); - PRINTF("Loading custom palette file: %s\n", palFile); + base::string palFile(!options.paletteFileName().empty() ? + options.paletteFileName(): + base::string(get_config_string("GfxMode", "Palette", ""))); - base::UniquePtr pal(Palette::load(palFile)); + if (!palFile.empty()) { + PRINTF("Loading custom palette file: %s\n", palFile.c_str()); + + base::UniquePtr pal(Palette::load(palFile.c_str())); if (pal.get() == NULL) throw base::Exception("Error loading default palette from: %s", palFile); diff --git a/src/app/commands/cmd_load_palette.cpp b/src/app/commands/cmd_load_palette.cpp index 5138b26c3..b574af385 100644 --- a/src/app/commands/cmd_load_palette.cpp +++ b/src/app/commands/cmd_load_palette.cpp @@ -24,6 +24,7 @@ #include "app/context_access.h" #include "app/document_api.h" #include "app/file_selector.h" +#include "app/ini_file.h" #include "app/modules/palettes.h" #include "app/undo_transaction.h" #include "base/compiler_specific.h" @@ -70,6 +71,7 @@ void LoadPaletteCommand::onExecute(Context* context) } else { set_default_palette(palette); + set_config_string("GfxMode", "Palette", filename.c_str()); } // Set the palette calling the hooks