2019-08-17 19:40:58 +00:00
|
|
|
// Copyright 2019 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "Common/IniFile.h"
|
|
|
|
#include "InputCommon/ImageOperations.h"
|
|
|
|
|
2021-02-15 02:47:00 +00:00
|
|
|
namespace InputCommon::DynamicInputTextures
|
2019-08-17 19:40:58 +00:00
|
|
|
{
|
2021-02-15 02:47:00 +00:00
|
|
|
class Configuration
|
2019-08-17 19:40:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-02-15 02:47:00 +00:00
|
|
|
explicit Configuration(const std::string& json_file);
|
|
|
|
~Configuration();
|
2021-02-03 05:04:33 +00:00
|
|
|
bool GenerateTextures(const IniFile::Section* sec, const std::string& controller_name) const;
|
2019-08-17 19:40:58 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct DynamicInputTextureData
|
|
|
|
{
|
|
|
|
std::string m_image_name;
|
|
|
|
std::string m_hires_texture_name;
|
|
|
|
std::string m_generated_folder_name;
|
|
|
|
|
|
|
|
using EmulatedKeyToRegionsMap = std::unordered_map<std::string, std::vector<Rect>>;
|
|
|
|
std::unordered_map<std::string, EmulatedKeyToRegionsMap> m_emulated_controllers;
|
|
|
|
|
|
|
|
using HostKeyToImagePath = std::unordered_map<std::string, std::string>;
|
|
|
|
std::unordered_map<std::string, HostKeyToImagePath> m_host_devices;
|
|
|
|
bool m_preserve_aspect_ratio = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool GenerateTexture(const IniFile::Section* sec, const std::string& controller_name,
|
|
|
|
const DynamicInputTextureData& texture_data) const;
|
|
|
|
|
|
|
|
std::vector<DynamicInputTextureData> m_dynamic_input_textures;
|
|
|
|
std::string m_base_path;
|
|
|
|
bool m_valid = true;
|
|
|
|
};
|
2021-02-15 02:47:00 +00:00
|
|
|
} // namespace InputCommon::DynamicInputTextures
|