mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
VideoCommon: add logic to read a GraphicsMod from configuration
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
// Copyright 2022 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModFeature.h"
|
||||
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
bool GraphicsModFeatureConfig::DeserializeFromConfig(const picojson::object& obj)
|
||||
{
|
||||
if (auto group_iter = obj.find("group"); group_iter != obj.end())
|
||||
{
|
||||
if (!group_iter->second.is<std::string>())
|
||||
{
|
||||
ERROR_LOG_FMT(
|
||||
VIDEO,
|
||||
"Failed to load mod configuration file, specified feature's group is not a string");
|
||||
return false;
|
||||
}
|
||||
m_group = group_iter->second.get<std::string>();
|
||||
}
|
||||
|
||||
if (auto action_iter = obj.find("action"); action_iter != obj.end())
|
||||
{
|
||||
if (!action_iter->second.is<std::string>())
|
||||
{
|
||||
ERROR_LOG_FMT(
|
||||
VIDEO,
|
||||
"Failed to load mod configuration file, specified feature's action is not a string");
|
||||
return false;
|
||||
}
|
||||
m_action = action_iter->second.get<std::string>();
|
||||
}
|
||||
|
||||
if (auto action_data_iter = obj.find("action_data"); action_data_iter != obj.end())
|
||||
{
|
||||
m_action_data = action_data_iter->second;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GraphicsModFeatureConfig::SerializeToProfile(picojson::object*) const
|
||||
{
|
||||
}
|
||||
|
||||
void GraphicsModFeatureConfig::DeserializeFromProfile(const picojson::object&)
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user