From 7833ff25df5cb3bf10b363d30d7af8007094454a Mon Sep 17 00:00:00 2001 From: degasus Date: Wed, 13 Jan 2016 21:14:20 +0100 Subject: VideoBackends: Merge Initialize and Shutdown functions. --- Source/Core/VideoBackends/Software/SWmain.cpp | 73 ++++++++------------------- 1 file changed, 21 insertions(+), 52 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp') 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(); - - CommandProcessor::Init(); - PixelEngine::Init(); - - BPInit(); g_vertex_manager = std::make_unique(); g_perf_query = std::make_unique(); - Fifo::Init(); // must be done before OpcodeDecoder::Init() - OpcodeDecoder::Init(); - IndexGenerator::Init(); - VertexShaderManager::Init(); - PixelShaderManager::Init(); g_texture_cache = std::make_unique(); SWRenderer::Init(); - VertexLoaderManager::Init(); g_framebuffer_manager = std::make_unique(); - - // Notify the core that the video backend is ready - Host_Message(WM_USER_CREATE); - - INFO_LOG(VIDEO, "Video backend initialized."); } unsigned int VideoSoftware::PeekMessages() -- cgit v1.2.3 From 5f2f4620676198bb63eeb169358435037491d4ad Mon Sep 17 00:00:00 2001 From: degasus Date: Wed, 13 Jan 2016 21:38:11 +0100 Subject: VideoBackends: Merge ShowConfig functions. --- Source/Core/VideoBackends/Software/SWmain.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp') diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index f37bc4aa14..d5b9bed4ca 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -139,7 +139,7 @@ std::string VideoSoftware::GetConfigName() const return "gfx_software"; } -static void InitBackendInfo() +void VideoSoftware::InitBackendInfo() { g_Config.backend_info.APIType = API_NONE; g_Config.backend_info.bSupports3DVision = false; @@ -152,13 +152,6 @@ static void InitBackendInfo() g_Config.backend_info.AAModes = {1}; } -void VideoSoftware::ShowConfig(void* hParent) -{ - if (!m_initialized) - InitBackendInfo(); - Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName()); -} - bool VideoSoftware::Initialize(void* window_handle) { InitBackendInfo(); -- cgit v1.2.3 From d79aeaa1e9b224b3bb147c605fb8ffd6e2bfc890 Mon Sep 17 00:00:00 2001 From: degasus Date: Sun, 26 Jun 2016 08:06:23 +0200 Subject: VideoCommon: Drop GetConfigName. We're past 5.0 now, so there is no need to look for old inis. --- Source/Core/VideoBackends/Software/SWmain.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp') diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index d5b9bed4ca..d34395570d 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -134,11 +134,6 @@ std::string VideoSoftware::GetDisplayName() const return "Software Renderer"; } -std::string VideoSoftware::GetConfigName() const -{ - return "gfx_software"; -} - void VideoSoftware::InitBackendInfo() { g_Config.backend_info.APIType = API_NONE; -- cgit v1.2.3