Fixed compilation errors

This commit is contained in:
DH 2015-10-13 21:09:42 +03:00
parent 07b3897499
commit 9136cbfcf2
5 changed files with 128 additions and 107 deletions

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "config_context.h"
#include "convert.h"
#include "StrFmt.h"
#include <iostream>
#include <sstream>

View file

@ -1,6 +1,7 @@
#pragma once
#include <unordered_map>
#include <string>
#include "convert.h"
class config_context_t
{

View file

@ -139,6 +139,7 @@ file(
GLOB_RECURSE
RPCS3_SRC
"${RPCS3_SRC_DIR}/rpcs3.cpp"
"${RPCS3_SRC_DIR}/config.cpp"
"${RPCS3_SRC_DIR}/Ini.cpp"
"${RPCS3_SRC_DIR}/../Utilities/GNU.cpp"
"${RPCS3_SRC_DIR}/Emu/*"

View file

@ -32,13 +32,21 @@ namespace rpcs3
void config_t::load()
{
if (!m_path.empty())
deserialize(std::ifstream{ m_path });
{
std::ifstream stream{ m_path };
if (stream)
deserialize(stream);
}
}
void config_t::save() const
{
if (!m_path.empty())
serialize(std::ofstream{ m_path });
{
std::ofstream stream{ m_path };
if (stream)
serialize(stream);
}
}
config_t config{ "rpcs3.new.ini" };

View file

@ -9,8 +9,10 @@ enum class audio_output_type
XAudio2
};
namespace convert
{
template<>
struct convert::to_impl_t<std::string, audio_output_type>
struct to_impl_t<std::string, audio_output_type>
{
static std::string func(audio_output_type value)
{
@ -26,7 +28,7 @@ struct convert::to_impl_t<std::string, audio_output_type>
};
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)
{
@ -42,6 +44,7 @@ struct convert::to_impl_t<audio_output_type, std::string>
return audio_output_type::Null;
}
};
}
enum class rsx_renderer_type
{
@ -50,8 +53,10 @@ enum class rsx_renderer_type
DX12
};
namespace convert
{
template<>
struct convert::to_impl_t<std::string, rsx_renderer_type>
struct to_impl_t<std::string, rsx_renderer_type>
{
static std::string func(rsx_renderer_type value)
{
@ -67,7 +72,7 @@ struct convert::to_impl_t<std::string, rsx_renderer_type>
};
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)
{
@ -83,6 +88,7 @@ struct convert::to_impl_t<rsx_renderer_type, std::string>
return rsx_renderer_type::Null;
}
};
}
enum class ppu_decoder_type
{
@ -91,8 +97,10 @@ enum class ppu_decoder_type
recompiler_llvm
};
namespace convert
{
template<>
struct convert::to_impl_t<std::string, ppu_decoder_type>
struct to_impl_t<std::string, ppu_decoder_type>
{
static std::string func(ppu_decoder_type value)
{
@ -108,7 +116,7 @@ struct convert::to_impl_t<std::string, ppu_decoder_type>
};
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)
{
@ -124,6 +132,7 @@ struct convert::to_impl_t<ppu_decoder_type, std::string>
return ppu_decoder_type::interpreter;
}
};
}
enum class spu_decoder_type
@ -133,8 +142,10 @@ enum class spu_decoder_type
recompiler_asmjit
};
namespace convert
{
template<>
struct convert::to_impl_t<std::string, spu_decoder_type>
struct to_impl_t<std::string, spu_decoder_type>
{
static std::string func(spu_decoder_type value)
{
@ -150,7 +161,7 @@ struct convert::to_impl_t<std::string, spu_decoder_type>
};
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)
{
@ -166,6 +177,7 @@ struct convert::to_impl_t<spu_decoder_type, std::string>
return spu_decoder_type::interpreter_precise;
}
};
}
namespace rpcs3
{