{Project64] Tabs to spaces in Plugin List.cpp

This commit is contained in:
zilmar 2015-11-12 19:43:32 +11:00
parent 5888b1d3f6
commit efa3c87de7
2 changed files with 136 additions and 125 deletions

View File

@ -12,7 +12,7 @@
#include <io.h>
CPluginList::CPluginList(bool bAutoFill /* = true */) :
m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin),"")
m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "")
{
if (bAutoFill)
{
@ -29,26 +29,25 @@ int CPluginList::GetPluginCount() const
return m_PluginList.size();
}
const CPluginList::PLUGIN * CPluginList::GetPluginInfo ( int indx ) const
const CPluginList::PLUGIN * CPluginList::GetPluginInfo(int indx) const
{
if (indx < 0 || indx >= (int)m_PluginList.size())
{
return NULL;
}
return &m_PluginList[indx];
}
bool CPluginList::LoadList()
{
WriteTrace(TraceDebug,__FUNCTION__ ": Start");
WriteTrace(TraceDebug, __FUNCTION__ ": Start");
m_PluginList.clear();
AddPluginFromDir(m_PluginDir);
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
WriteTrace(TraceDebug, __FUNCTION__ ": Done");
return true;
}
void CPluginList::AddPluginFromDir ( CPath Dir)
void CPluginList::AddPluginFromDir(CPath Dir)
{
Dir.SetNameExtension("*.*");
if (Dir.FindFirst(_A_SUBDIR))
@ -71,7 +70,7 @@ void CPluginList::AddPluginFromDir ( CPath Dir)
}
//UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS );
WriteTraceF(TraceDebug,__FUNCTION__ ": loading %s",(LPCSTR)Dir);
WriteTraceF(TraceDebug, __FUNCTION__ ": loading %s", (LPCSTR)Dir);
hLib = LoadLibrary(Dir);
//SetErrorMode(LastErrorMode);
@ -82,8 +81,8 @@ void CPluginList::AddPluginFromDir ( CPath Dir)
continue;
}
void (__cdecl *GetDllInfo) ( PLUGIN_INFO * PluginInfo );
GetDllInfo = (void (__cdecl *)(PLUGIN_INFO *))GetProcAddress( hLib, "GetDllInfo" );
void(__cdecl *GetDllInfo) (PLUGIN_INFO * PluginInfo);
GetDllInfo = (void(__cdecl *)(PLUGIN_INFO *))GetProcAddress(hLib, "GetDllInfo");
if (GetDllInfo == NULL)
{
continue;
@ -102,7 +101,7 @@ void CPluginList::AddPluginFromDir ( CPath Dir)
std::string& pluginPath = m_PluginDir;
Plugin.FileName = fullPath.substr(pluginPath.length());
if (GetProcAddress(hLib,"DllAbout") != NULL)
if (GetProcAddress(hLib, "DllAbout") != NULL)
{
Plugin.AboutFunction = true;
}
@ -117,7 +116,7 @@ void CPluginList::AddPluginFromDir ( CPath Dir)
}
}
bool CPluginList::ValidPluginVersion ( PLUGIN_INFO & PluginInfo ) {
bool CPluginList::ValidPluginVersion(PLUGIN_INFO & PluginInfo) {
switch (PluginInfo.Type)
{
case PLUGIN_TYPE_RSP:

View File

@ -1,4 +1,16 @@
#include "..\\Settings.h"
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
#include <Project64/Settings/Settings.h>
class CPluginList
{
@ -15,10 +27,10 @@ public:
CPluginList(bool bAutoFill = true);
~CPluginList();
bool LoadList ( void );
int GetPluginCount ( void ) const;
const PLUGIN * GetPluginInfo ( int indx ) const;
static bool ValidPluginVersion ( PLUGIN_INFO & PluginInfo );
bool LoadList(void);
int GetPluginCount(void) const;
const PLUGIN * GetPluginInfo(int indx) const;
static bool ValidPluginVersion(PLUGIN_INFO & PluginInfo);
private:
typedef std::vector<PLUGIN> PluginList;