mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] egl: set the active preset if specified at launch
This commit is contained in:
parent
c7389285f9
commit
fb4bdaee2b
@ -123,7 +123,8 @@ static void loadPresetList(struct EGL_PostProcess * this)
|
|||||||
|
|
||||||
struct dirent * entry;
|
struct dirent * entry;
|
||||||
const char * preset = option_get_string("egl", "preset");
|
const char * preset = option_get_string("egl", "preset");
|
||||||
bool presetValid = false;
|
this->activePreset = -1;
|
||||||
|
|
||||||
while ((entry = readdir(dir)) != NULL)
|
while ((entry = readdir(dir)) != NULL)
|
||||||
{
|
{
|
||||||
if (entry->d_type != DT_REG)
|
if (entry->d_type != DT_REG)
|
||||||
@ -139,15 +140,14 @@ static void loadPresetList(struct EGL_PostProcess * this)
|
|||||||
stringlist_push(this->presets, name);
|
stringlist_push(this->presets, name);
|
||||||
|
|
||||||
if (preset && strcmp(preset, name) == 0)
|
if (preset && strcmp(preset, name) == 0)
|
||||||
presetValid = true;
|
this->activePreset = stringlist_count(this->presets) - 1;
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
||||||
this->activePreset = -1;
|
|
||||||
|
|
||||||
if (preset)
|
if (preset)
|
||||||
{
|
{
|
||||||
if (presetValid)
|
if (this->activePreset > -1)
|
||||||
loadPreset(this, preset);
|
loadPreset(this, preset);
|
||||||
else
|
else
|
||||||
DEBUG_WARN("egl:preset '%s' does not exist", preset);
|
DEBUG_WARN("egl:preset '%s' does not exist", preset);
|
||||||
|
Loading…
Reference in New Issue
Block a user