Changes after merge
parent
611680a72e
commit
f1d1cdceee
|
@ -14,13 +14,13 @@
|
|||
// * You should have received a copy of the GNU General Public License
|
||||
// * along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
// plugin.cpp
|
||||
// pluginloader.cpp
|
||||
|
||||
|
||||
#include "plugin.h"
|
||||
#include "pluginloader.h"
|
||||
|
||||
|
||||
CPlugin::CPlugin(std::string filename)
|
||||
CPluginLoader::CPluginLoader(std::string filename)
|
||||
{
|
||||
mInterface = nullptr;
|
||||
mFilename = filename;
|
||||
|
@ -28,7 +28,7 @@ CPlugin::CPlugin(std::string filename)
|
|||
}
|
||||
|
||||
|
||||
char* CPlugin::GetName()
|
||||
char* CPluginLoader::GetName()
|
||||
{
|
||||
if (mLoaded)
|
||||
return mInterface->PluginName();
|
||||
|
@ -36,7 +36,7 @@ char* CPlugin::GetName()
|
|||
}
|
||||
|
||||
|
||||
int CPlugin::GetVersion()
|
||||
int CPluginLoader::GetVersion()
|
||||
{
|
||||
if (mLoaded)
|
||||
return mInterface->PluginVersion();
|
||||
|
@ -44,13 +44,13 @@ int CPlugin::GetVersion()
|
|||
}
|
||||
|
||||
|
||||
bool CPlugin::IsLoaded()
|
||||
bool CPluginLoader::IsLoaded()
|
||||
{
|
||||
return mLoaded;
|
||||
}
|
||||
|
||||
|
||||
bool CPlugin::UnloadPlugin()
|
||||
bool CPluginLoader::UnloadPlugin()
|
||||
{
|
||||
if (!mLoaded) {
|
||||
GetLogger()->Warn("Plugin %s is not loaded.\n");
|
||||
|
@ -69,7 +69,7 @@ bool CPlugin::UnloadPlugin()
|
|||
}
|
||||
|
||||
|
||||
bool CPlugin::LoadPlugin()
|
||||
bool CPluginLoader::LoadPlugin()
|
||||
{
|
||||
mHandle = lt_dlopenext(mFilename.c_str());
|
||||
if (!mHandle) {
|
|
@ -14,7 +14,7 @@
|
|||
// * You should have received a copy of the GNU General Public License
|
||||
// * along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
// plugin.h
|
||||
// pluginloader.h
|
||||
|
||||
|
||||
#pragma once
|
||||
|
@ -27,9 +27,9 @@
|
|||
#include "plugininterface.h"
|
||||
|
||||
|
||||
class CPlugin {
|
||||
class CPluginLoader {
|
||||
public:
|
||||
CPlugin(std::string filename);
|
||||
CPluginLoader(std::string filename);
|
||||
|
||||
char* GetName();
|
||||
int GetVersion();
|
|
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
|
|||
set(CMAKE_BUILD_TYPE debug)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -O0 -std=c++11 -rdynamic")
|
||||
|
||||
add_executable(plugin_test plugin_test.cpp ../../common/iman.cpp ../../common/logger.cpp ../plugin.cpp)
|
||||
add_executable(plugin_test plugin_test.cpp ../../common/iman.cpp ../../common/logger.cpp ../pluginloader.cpp)
|
||||
|
||||
# Change to DirectX SDK directory
|
||||
include_directories("../../")
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <common/logger.h>
|
||||
#include <common/iman.h>
|
||||
#include <sound/sound.h>
|
||||
#include <plugins/plugin.h>
|
||||
#include <plugins/pluginloader.h>
|
||||
|
||||
|
||||
int main() {
|
||||
|
@ -14,7 +14,7 @@ int main() {
|
|||
|
||||
lt_dlinit();
|
||||
|
||||
CPlugin *plugin = new CPlugin("libopenalsound");
|
||||
CPluginLoader *plugin = new CPluginLoader("libopenalsound");
|
||||
if (plugin->LoadPlugin()) {
|
||||
CSoundInterface *sound = static_cast<CSoundInterface*>(CInstanceManager::GetInstancePointer()->SearchInstance(CLASS_SOUND));
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <math/vector.h>
|
||||
|
||||
#include <plugins/plugin.h>
|
||||
#include <plugins/plugininterface.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -148,7 +148,7 @@ enum SoundNext
|
|||
* @brief Sound plugin interface
|
||||
*
|
||||
*/
|
||||
class CSoundInterface : public CPlugin
|
||||
class CSoundInterface : public CPluginInterface
|
||||
{
|
||||
public:
|
||||
CSoundInterface() {
|
||||
|
|
Loading…
Reference in New Issue