This commit is contained in:
wheremyfoodat 2023-07-18 22:45:55 +03:00
parent 31d1c6ff3f
commit c339c7d1c5
3 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,6 @@
#pragma once
#include <array>
#include <span>
#include <string>
#include <optional>
#include "PICA/pica_vertex.hpp"
@ -38,7 +37,7 @@ class Renderer {
static constexpr u32 vertexBufferSize = 0x10000;
static std::optional<RendererType> typeFromString(std::string inString);
static std::string typeToString(RendererType rendererType);
static const char* typeToString(RendererType rendererType);
virtual void reset() = 0;
virtual void display() = 0; // Display the 3DS screen contents to the window

View file

@ -1,6 +1,7 @@
#include "config.hpp"
#include <fstream>
#include <string>
#include "helpers.hpp"
#include "toml.hpp"
@ -68,7 +69,7 @@ void EmulatorConfig::save(const std::filesystem::path& path) {
}
data["GPU"]["EnableShaderJIT"] = shaderJitEnabled;
data["GPU"]["Renderer"] = Renderer::typeToString(rendererType);
data["GPU"]["Renderer"] = std::string(Renderer::typeToString(rendererType));
std::ofstream file(path, std::ios::out);
file << data;

View file

@ -25,11 +25,11 @@ std::optional<RendererType> Renderer::typeFromString(std::string inString) {
return std::nullopt;
}
std::string Renderer::typeToString(RendererType rendererType) {
const char* Renderer::typeToString(RendererType rendererType) {
switch (rendererType) {
case RendererType::Null: return "null";
case RendererType::OpenGL: return "opengl";
case RendererType::Vulkan: return "vk";
case RendererType::Vulkan: return "vulkan";
default: return "Invalid";
}
}