mirror of
https://github.com/libretro/parallel-gx1.git
synced 2026-11-10 11:21:34 -10:00
Every JSON reader (Triforce card decks, dynamic input textures, graphics mods and their per-game profiles) now pulls its file through rjson from a VFS filestream and fills its structures as it parses, with no document tree in between. JsonUtil and the vendored picojson go away, as does the graphics mod serialization nothing called. Move and scale actions take their X, Y and Z straight from the parsed feature instead of re-reading a kept JSON value. rjson.c and rjson.h are imported unchanged from libretro-common.
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
// Copyright 2022 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModAsset.h"
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModFeature.h"
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsTargetGroup.h"
|
|
|
|
struct GraphicsModConfig
|
|
{
|
|
std::string m_title;
|
|
std::string m_author;
|
|
std::string m_description;
|
|
bool m_enabled = false;
|
|
u16 m_weight = 0;
|
|
std::string m_relative_path;
|
|
|
|
enum class Source
|
|
{
|
|
User,
|
|
System
|
|
};
|
|
Source m_source = Source::User;
|
|
|
|
std::vector<GraphicsTargetGroupConfig> m_groups;
|
|
std::vector<GraphicsModFeatureConfig> m_features;
|
|
std::vector<GraphicsModAssetConfig> m_assets;
|
|
|
|
static std::optional<GraphicsModConfig> Create(const std::string& file, Source source);
|
|
|
|
std::string GetAbsolutePath() const;
|
|
};
|
|
|
|
/* The mods a game's profile lists, with its enabled and weight applied; nullopt where
|
|
* the profile cannot be read. */
|
|
std::optional<std::vector<GraphicsModConfig>> LoadGraphicsModProfile(const std::string& file);
|