Fixed compilation errors
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "config_context.h"
|
#include "config_context.h"
|
||||||
#include "convert.h"
|
|
||||||
#include "StrFmt.h"
|
#include "StrFmt.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "convert.h"
|
||||||
|
|
||||||
class config_context_t
|
class config_context_t
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ file(
|
|||||||
GLOB_RECURSE
|
GLOB_RECURSE
|
||||||
RPCS3_SRC
|
RPCS3_SRC
|
||||||
"${RPCS3_SRC_DIR}/rpcs3.cpp"
|
"${RPCS3_SRC_DIR}/rpcs3.cpp"
|
||||||
|
"${RPCS3_SRC_DIR}/config.cpp"
|
||||||
"${RPCS3_SRC_DIR}/Ini.cpp"
|
"${RPCS3_SRC_DIR}/Ini.cpp"
|
||||||
"${RPCS3_SRC_DIR}/../Utilities/GNU.cpp"
|
"${RPCS3_SRC_DIR}/../Utilities/GNU.cpp"
|
||||||
"${RPCS3_SRC_DIR}/Emu/*"
|
"${RPCS3_SRC_DIR}/Emu/*"
|
||||||
|
|||||||
+10
-2
@@ -32,13 +32,21 @@ namespace rpcs3
|
|||||||
void config_t::load()
|
void config_t::load()
|
||||||
{
|
{
|
||||||
if (!m_path.empty())
|
if (!m_path.empty())
|
||||||
deserialize(std::ifstream{ m_path });
|
{
|
||||||
|
std::ifstream stream{ m_path };
|
||||||
|
if (stream)
|
||||||
|
deserialize(stream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void config_t::save() const
|
void config_t::save() const
|
||||||
{
|
{
|
||||||
if (!m_path.empty())
|
if (!m_path.empty())
|
||||||
serialize(std::ofstream{ m_path });
|
{
|
||||||
|
std::ofstream stream{ m_path };
|
||||||
|
if (stream)
|
||||||
|
serialize(stream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
config_t config{ "rpcs3.new.ini" };
|
config_t config{ "rpcs3.new.ini" };
|
||||||
|
|||||||
+40
-28
@@ -9,9 +9,11 @@ enum class audio_output_type
|
|||||||
XAudio2
|
XAudio2
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
namespace convert
|
||||||
struct convert::to_impl_t<std::string, audio_output_type>
|
|
||||||
{
|
{
|
||||||
|
template<>
|
||||||
|
struct to_impl_t<std::string, audio_output_type>
|
||||||
|
{
|
||||||
static std::string func(audio_output_type value)
|
static std::string func(audio_output_type value)
|
||||||
{
|
{
|
||||||
switch (value)
|
switch (value)
|
||||||
@@ -23,11 +25,11 @@ struct convert::to_impl_t<std::string, audio_output_type>
|
|||||||
|
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct convert::to_impl_t<audio_output_type, std::string>
|
struct to_impl_t<audio_output_type, std::string>
|
||||||
{
|
{
|
||||||
static audio_output_type func(const std::string &value)
|
static audio_output_type func(const std::string &value)
|
||||||
{
|
{
|
||||||
if (value == "Null")
|
if (value == "Null")
|
||||||
@@ -41,7 +43,8 @@ struct convert::to_impl_t<audio_output_type, std::string>
|
|||||||
|
|
||||||
return audio_output_type::Null;
|
return audio_output_type::Null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
enum class rsx_renderer_type
|
enum class rsx_renderer_type
|
||||||
{
|
{
|
||||||
@@ -50,9 +53,11 @@ enum class rsx_renderer_type
|
|||||||
DX12
|
DX12
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
namespace convert
|
||||||
struct convert::to_impl_t<std::string, rsx_renderer_type>
|
|
||||||
{
|
{
|
||||||
|
template<>
|
||||||
|
struct to_impl_t<std::string, rsx_renderer_type>
|
||||||
|
{
|
||||||
static std::string func(rsx_renderer_type value)
|
static std::string func(rsx_renderer_type value)
|
||||||
{
|
{
|
||||||
switch (value)
|
switch (value)
|
||||||
@@ -64,11 +69,11 @@ struct convert::to_impl_t<std::string, rsx_renderer_type>
|
|||||||
|
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct convert::to_impl_t<rsx_renderer_type, std::string>
|
struct to_impl_t<rsx_renderer_type, std::string>
|
||||||
{
|
{
|
||||||
static rsx_renderer_type func(const std::string &value)
|
static rsx_renderer_type func(const std::string &value)
|
||||||
{
|
{
|
||||||
if (value == "Null")
|
if (value == "Null")
|
||||||
@@ -82,7 +87,8 @@ struct convert::to_impl_t<rsx_renderer_type, std::string>
|
|||||||
|
|
||||||
return rsx_renderer_type::Null;
|
return rsx_renderer_type::Null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
enum class ppu_decoder_type
|
enum class ppu_decoder_type
|
||||||
{
|
{
|
||||||
@@ -91,9 +97,11 @@ enum class ppu_decoder_type
|
|||||||
recompiler_llvm
|
recompiler_llvm
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
namespace convert
|
||||||
struct convert::to_impl_t<std::string, ppu_decoder_type>
|
|
||||||
{
|
{
|
||||||
|
template<>
|
||||||
|
struct to_impl_t<std::string, ppu_decoder_type>
|
||||||
|
{
|
||||||
static std::string func(ppu_decoder_type value)
|
static std::string func(ppu_decoder_type value)
|
||||||
{
|
{
|
||||||
switch (value)
|
switch (value)
|
||||||
@@ -105,11 +113,11 @@ struct convert::to_impl_t<std::string, ppu_decoder_type>
|
|||||||
|
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct convert::to_impl_t<ppu_decoder_type, std::string>
|
struct to_impl_t<ppu_decoder_type, std::string>
|
||||||
{
|
{
|
||||||
static ppu_decoder_type func(const std::string &value)
|
static ppu_decoder_type func(const std::string &value)
|
||||||
{
|
{
|
||||||
if (value == "interpreter")
|
if (value == "interpreter")
|
||||||
@@ -123,7 +131,8 @@ struct convert::to_impl_t<ppu_decoder_type, std::string>
|
|||||||
|
|
||||||
return ppu_decoder_type::interpreter;
|
return ppu_decoder_type::interpreter;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
enum class spu_decoder_type
|
enum class spu_decoder_type
|
||||||
@@ -133,9 +142,11 @@ enum class spu_decoder_type
|
|||||||
recompiler_asmjit
|
recompiler_asmjit
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
namespace convert
|
||||||
struct convert::to_impl_t<std::string, spu_decoder_type>
|
|
||||||
{
|
{
|
||||||
|
template<>
|
||||||
|
struct to_impl_t<std::string, spu_decoder_type>
|
||||||
|
{
|
||||||
static std::string func(spu_decoder_type value)
|
static std::string func(spu_decoder_type value)
|
||||||
{
|
{
|
||||||
switch (value)
|
switch (value)
|
||||||
@@ -147,11 +158,11 @@ struct convert::to_impl_t<std::string, spu_decoder_type>
|
|||||||
|
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct convert::to_impl_t<spu_decoder_type, std::string>
|
struct to_impl_t<spu_decoder_type, std::string>
|
||||||
{
|
{
|
||||||
static spu_decoder_type func(const std::string &value)
|
static spu_decoder_type func(const std::string &value)
|
||||||
{
|
{
|
||||||
if (value == "interpreter_precise")
|
if (value == "interpreter_precise")
|
||||||
@@ -165,7 +176,8 @@ struct convert::to_impl_t<spu_decoder_type, std::string>
|
|||||||
|
|
||||||
return spu_decoder_type::interpreter_precise;
|
return spu_decoder_type::interpreter_precise;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
namespace rpcs3
|
namespace rpcs3
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user