[Project64] Clean up code related to plugins
This commit is contained in:
parent
df04d377e0
commit
821922f133
|
@ -14,7 +14,7 @@
|
|||
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
|
||||
#include <Project64-core/N64System/Mips/RegisterClass.h>
|
||||
#include <Project64-core/N64System/N64Class.h>
|
||||
#include "AudioPlugin.h"
|
||||
#include <Project64-core/Plugins/AudioPlugin.h>
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
@ -64,8 +64,8 @@ bool CAudioPlugin::Initiate(CN64System * System, RenderWindow * Window)
|
|||
{
|
||||
struct AUDIO_INFO
|
||||
{
|
||||
HWND hwnd;
|
||||
HINSTANCE hinst;
|
||||
void * hwnd;
|
||||
void * hinst;
|
||||
|
||||
int32_t MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
||||
|
||||
|
@ -97,9 +97,9 @@ bool CAudioPlugin::Initiate(CN64System * System, RenderWindow * Window)
|
|||
|
||||
AUDIO_INFO Info = { 0 };
|
||||
|
||||
Info.hwnd = (HWND)Window->GetWindowHandle();
|
||||
Info.hinst = GetModuleHandle(NULL);
|
||||
Info.MemoryBswaped = TRUE;
|
||||
Info.hwnd = Window ? Window->GetWindowHandle() : NULL;
|
||||
Info.hinst = Window ? Window->GetModuleInstance() : NULL;;
|
||||
Info.MemoryBswaped = true;
|
||||
Info.CheckInterrupts = DummyCheckInterrupts;
|
||||
|
||||
// We are initializing the plugin before any rom is loaded so we do not have any correct
|
||||
|
@ -167,13 +167,15 @@ bool CAudioPlugin::Initiate(CN64System * System, RenderWindow * Window)
|
|||
|
||||
void CAudioPlugin::UnloadPluginDetails(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (m_hAudioThread)
|
||||
{
|
||||
WriteTrace(TraceAudioPlugin, TraceDebug, "Terminate Audio Thread");
|
||||
TerminateThread(m_hAudioThread, 0);
|
||||
m_hAudioThread = NULL;
|
||||
}
|
||||
AiDacrateChanged = NULL;
|
||||
#endif
|
||||
AiDacrateChanged = NULL;
|
||||
AiLenChanged = NULL;
|
||||
AiReadLength = NULL;
|
||||
AiUpdate = NULL;
|
||||
|
@ -190,6 +192,7 @@ void CAudioPlugin::DacrateChanged(SYSTEM_TYPE Type)
|
|||
AiDacrateChanged(Type);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void CAudioPlugin::AudioThread(CAudioPlugin * _this)
|
||||
{
|
||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
|
||||
|
@ -201,4 +204,5 @@ void CAudioPlugin::AudioThread(CAudioPlugin * _this)
|
|||
{
|
||||
_this->AiUpdate(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* *
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
#include "PluginBase.h"
|
||||
#include <Project64-core/Plugins/PluginBase.h>
|
||||
|
||||
class CAudioPlugin : public CPlugin
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* *
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
#include "PluginBase.h"
|
||||
#include <Project64-core/Plugins/PluginBase.h>
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4201) // warning C4201: nonstandard extension used : nameless struct/union
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* *
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
#include "PluginBase.h"
|
||||
#include <Project64-core/Plugins/PluginBase.h>
|
||||
|
||||
class CGfxPlugin : public CPlugin
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* *
|
||||
****************************************************************************/
|
||||
#include "stdafx.h"
|
||||
#include "PluginBase.h"
|
||||
#include <Project64-core/Plugins/PluginBase.h>
|
||||
|
||||
CPlugin::CPlugin() :
|
||||
DllAbout(NULL),
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <Project64-core/N64System/Mips/RegisterClass.h>
|
||||
#include "RSPPlugin.h"
|
||||
#include "GFXPlugin.h"
|
||||
#include "AudioPlugin.h"
|
||||
#include <Project64-core/Plugins/AudioPlugin.h>
|
||||
|
||||
void DummyFunc1(int a) { a += 1; }
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* *
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
#include "PluginBase.h"
|
||||
#include <Project64-core/Plugins/PluginBase.h>
|
||||
|
||||
class CRSP_Plugin : public CPlugin
|
||||
{
|
||||
|
|
|
@ -85,8 +85,8 @@ void CPluginList::AddPluginFromDir(CPath Dir)
|
|||
continue;
|
||||
}
|
||||
|
||||
void(__cdecl *GetDllInfo) (PLUGIN_INFO * PluginInfo);
|
||||
GetDllInfo = (void(__cdecl *)(PLUGIN_INFO *))GetProcAddress(hLib, "GetDllInfo");
|
||||
void(CALL *GetDllInfo) (PLUGIN_INFO * PluginInfo);
|
||||
GetDllInfo = (void(CALL *)(PLUGIN_INFO *))GetProcAddress(hLib, "GetDllInfo");
|
||||
if (GetDllInfo == NULL)
|
||||
{
|
||||
continue;
|
||||
|
|
|
@ -126,8 +126,8 @@ void CGamePluginPage::ShowAboutButton(int id)
|
|||
}
|
||||
|
||||
//Get DLL about
|
||||
void(__cdecl *DllAbout) (HWND hWnd);
|
||||
DllAbout = (void(__cdecl *)(HWND))GetProcAddress(hLib, "DllAbout");
|
||||
void(CALL *DllAbout) (HWND hWnd);
|
||||
DllAbout = (void(CALL *)(HWND))GetProcAddress(hLib, "DllAbout");
|
||||
|
||||
//call the function from the dll
|
||||
DllAbout(m_hWnd);
|
||||
|
|
|
@ -118,8 +118,8 @@ void COptionPluginPage::ShowAboutButton(int id)
|
|||
}
|
||||
|
||||
//Get DLL about
|
||||
void(__cdecl *DllAbout) (HWND hWnd);
|
||||
DllAbout = (void(__cdecl *)(HWND))GetProcAddress(hLib, "DllAbout");
|
||||
void(CALL *DllAbout) (HWND hWnd);
|
||||
DllAbout = (void(CALL *)(HWND))GetProcAddress(hLib, "DllAbout");
|
||||
|
||||
//call the function from the dll
|
||||
DllAbout(m_hWnd);
|
||||
|
|
Loading…
Reference in New Issue