summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWmain.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2016-01-13 21:14:20 +0100
committerdegasus <wickmarkus@web.de>2016-06-26 12:34:59 +0200
commit7833ff25df5cb3bf10b363d30d7af8007094454a (patch)
tree0ee31e872c3b5ac1951e72bb54266e3e5e672306 /Source/Core/VideoBackends/Software/SWmain.cpp
parentb16333a25cc0d8396f71fa1e410484026adea964 (diff)
VideoBackends: Merge Initialize and Shutdown functions.
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWmain.cpp73
1 files changed, 21 insertions, 52 deletions
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index 083e9766e7..f37bc4aa14 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -134,6 +134,11 @@ std::string VideoSoftware::GetDisplayName() const
return "Software Renderer";
}
+std::string VideoSoftware::GetConfigName() const
+{
+ return "gfx_software";
+}
+
static void InitBackendInfo()
{
g_Config.backend_info.APIType = API_NONE;
@@ -151,19 +156,13 @@ void VideoSoftware::ShowConfig(void* hParent)
{
if (!m_initialized)
InitBackendInfo();
- Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_software");
+ Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName());
}
bool VideoSoftware::Initialize(void* window_handle)
{
- InitializeShared();
InitBackendInfo();
-
- g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str());
- g_Config.GameIniLoad();
- g_Config.UpdateProjectionHack();
- g_Config.VerifyValidity();
- UpdateActiveConfig();
+ InitializeShared();
SWOGLWindow::Init(window_handle);
@@ -173,71 +172,41 @@ bool VideoSoftware::Initialize(void* window_handle)
SWRenderer::Init();
DebugUtil::Init();
- // Do our OSD callbacks
- OSD::DoCallbacks(OSD::CallbackType::Initialization);
-
- m_initialized = true;
-
return true;
}
void VideoSoftware::Shutdown()
{
- m_initialized = false;
-
- // Do our OSD callbacks
- OSD::DoCallbacks(OSD::CallbackType::Shutdown);
-
SWOGLWindow::Shutdown();
+
+ ShutdownShared();
}
void VideoSoftware::Video_Cleanup()
{
- if (g_renderer)
- {
- Fifo::Shutdown();
- SWRenderer::Shutdown();
- DebugUtil::Shutdown();
- // The following calls are NOT Thread Safe
- // And need to be called from the video thread
- SWRenderer::Shutdown();
- VertexLoaderManager::Shutdown();
- g_framebuffer_manager.reset();
- g_texture_cache.reset();
- VertexShaderManager::Shutdown();
- PixelShaderManager::Shutdown();
- g_perf_query.reset();
- g_vertex_manager.reset();
- OpcodeDecoder::Shutdown();
- g_renderer.reset();
- }
+ CleanupShared();
+
+ SWRenderer::Shutdown();
+ DebugUtil::Shutdown();
+ // The following calls are NOT Thread Safe
+ // And need to be called from the video thread
+ SWRenderer::Shutdown();
+ g_framebuffer_manager.reset();
+ g_texture_cache.reset();
+ g_perf_query.reset();
+ g_vertex_manager.reset();
+ g_renderer.reset();
}
// This is called after Video_Initialize() from the Core
void VideoSoftware::Video_Prepare()
{
g_renderer = std::make_unique<SWRenderer>();
-
- CommandProcessor::Init();
- PixelEngine::Init();
-
- BPInit();
g_vertex_manager = std::make_unique<SWVertexLoader>();
g_perf_query = std::make_unique<PerfQuery>();
- Fifo::Init(); // must be done before OpcodeDecoder::Init()
- OpcodeDecoder::Init();
- IndexGenerator::Init();
- VertexShaderManager::Init();
- PixelShaderManager::Init();
g_texture_cache = std::make_unique<TextureCache>();
SWRenderer::Init();
- VertexLoaderManager::Init();
g_framebuffer_manager = std::make_unique<FramebufferManager>();
-
- // Notify the core that the video backend is ready
- Host_Message(WM_USER_CREATE);
-
- INFO_LOG(VIDEO, "Video backend initialized.");
}
unsigned int VideoSoftware::PeekMessages()