From 2e9837e564c40c805669716705bc4f05dffbdb0d Mon Sep 17 00:00:00 2001 From: bushing Date: Sat, 10 Jan 2009 10:17:02 +0000 Subject: [PATCH] move video plugin init from EmuThread to the GUI thread, since it does GUI stuff lol? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1843 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 43 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 6ab826d4a5..54cc2be1a3 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -96,6 +96,7 @@ void Callback_WiimoteInput(u16 _channelID, const void* _pData, u32 _Size); void Callback_KeyPress(int key, bool shift, bool control); TPeekMessages Callback_PeekMessages = NULL; TUpdateFPSDisplay g_pUpdateFPSDisplay = NULL; +SVideoInitialize VideoInitialize; #ifdef _WIN32 DWORD WINAPI EmuThread(void *pArg); @@ -188,6 +189,27 @@ bool Init(const SCoreStartupParameter _CoreParameter) return false; } + // Load the VideoPlugin + VideoInitialize.pGetMemoryPointer = Memory::GetPointer; + VideoInitialize.pSetPEToken = PixelEngine::SetToken; + VideoInitialize.pSetPEFinish = PixelEngine::SetFinish; + // This is first the m_Panel handle, then it is updated to have the new window handle + VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow; + VideoInitialize.pLog = Callback_VideoLog; + VideoInitialize.pSysMessage = Host_SysMessage; + VideoInitialize.pRequestWindowSize = NULL; //Callback_VideoRequestWindowSize; + VideoInitialize.pCopiedToXFB = Callback_VideoCopiedToXFB; + VideoInitialize.pVIRegs = VideoInterface::m_UVIUnknownRegs; + VideoInitialize.pPeekMessages = NULL; + VideoInitialize.pUpdateFPSDisplay = NULL; + VideoInitialize.pCPFifo = (SCPFifoStruct*)&CommandProcessor::fifo; + VideoInitialize.pUpdateInterrupts = &(CommandProcessor::UpdateInterruptsFromVideoPlugin); + VideoInitialize.pMemoryBase = Memory::base; + VideoInitialize.pKeyPress = Callback_KeyPress; + VideoInitialize.bWii = _CoreParameter.bWii; + PluginVideo::Video_Initialize(&VideoInitialize); // Call the dll + + emuThreadGoing.Init(); // This will execute EmuThread() further down in this file @@ -310,27 +332,6 @@ THREAD_RETURN EmuThread(void *pArg) emuThreadGoing.Set(); - // Load the VideoPlugin - SVideoInitialize VideoInitialize; - VideoInitialize.pGetMemoryPointer = Memory::GetPointer; - VideoInitialize.pSetPEToken = PixelEngine::SetToken; - VideoInitialize.pSetPEFinish = PixelEngine::SetFinish; - // This is first the m_Panel handle, then it is updated to have the new window handle - VideoInitialize.pWindowHandle = _CoreParameter.hMainWindow; - VideoInitialize.pLog = Callback_VideoLog; - VideoInitialize.pSysMessage = Host_SysMessage; - VideoInitialize.pRequestWindowSize = NULL; //Callback_VideoRequestWindowSize; - VideoInitialize.pCopiedToXFB = Callback_VideoCopiedToXFB; - VideoInitialize.pVIRegs = VideoInterface::m_UVIUnknownRegs; - VideoInitialize.pPeekMessages = NULL; - VideoInitialize.pUpdateFPSDisplay = NULL; - VideoInitialize.pCPFifo = (SCPFifoStruct*)&CommandProcessor::fifo; - VideoInitialize.pUpdateInterrupts = &(CommandProcessor::UpdateInterruptsFromVideoPlugin); - VideoInitialize.pMemoryBase = Memory::base; - VideoInitialize.pKeyPress = Callback_KeyPress; - VideoInitialize.bWii = _CoreParameter.bWii; - PluginVideo::Video_Initialize(&VideoInitialize); // Call the dll - // Under linux, this is an X11 Display, not an HWND! g_pWindowHandle = (HWND)VideoInitialize.pWindowHandle; Callback_PeekMessages = VideoInitialize.pPeekMessages;