diff --git a/SConstruct b/SConstruct index e933b18317..07e4893811 100644 --- a/SConstruct +++ b/SConstruct @@ -51,6 +51,7 @@ include_paths = [ '../../../../Externals/LZO', '../../../../Externals/WiiUseSrc/Src', '../../../Core/VideoCommon/Src', + '../../../Core/InputCommon/Src', ] dirs = [ @@ -61,6 +62,7 @@ dirs = [ 'Source/Core/Core/Src', 'Source/Core/DiscIO/Src', 'Source/Core/VideoCommon/Src', + 'Source/Core/InputCommon/Src', 'Source/Plugins/Plugin_VideoOGL/Src', 'Source/Plugins/Plugin_DSP_HLE/Src', 'Source/Plugins/Plugin_DSP_LLE/Src', @@ -311,9 +313,9 @@ env['libs_dir'] = env['prefix'] + 'Libs/' #TODO where should this go? env['data_dir'] = env['prefix'] -env['RPATH'] += env['libs_dir'] +env['RPATH'].append(env['libs_dir']) -env['LIBPATH'] += [ env['libs_dir'] ] +env['LIBPATH'].append(env['libs_dir']) rev = utils.GenerateRevFile(env['flavor'], diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index d7c35ecfb8..83e2bb44f3 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -56,7 +56,7 @@ #include "MemTools.h" #include "Host.h" #include "LogManager.h" -#include "EventHandler.h" +#include "InputCommon.h" #include "State.h" @@ -68,7 +68,6 @@ // glXMakeCurrent/ wglMakeCurrent takes a context and makes it current on the current thread. // So it's fine to init ogl on one thread, and then make it current and start blasting on another. -EventHandler *eventHandler = NULL;; namespace Core { @@ -124,11 +123,8 @@ bool Init(const SCoreStartupParameter _CoreParameter) g_CoreStartupParameter = _CoreParameter; -#if defined GLTEST && GLTEST - // init the event handler - eventHandler = new EventHandler(); -#endif - + InputCommon::Init(); + // start the thread again _dbg_assert_(HLE, g_pThread == NULL); @@ -285,9 +281,9 @@ THREAD_RETURN EmuThread(void *pArg) PluginVideo::Video_Initialize(&VideoInitialize); // Under linux, this is an X11 Display, not an HWND! - g_pWindowHandle = (HWND)VideoInitialize.pWindowHandle; - Callback_PeekMessages = VideoInitialize.pPeekMessages; - g_pUpdateFPSDisplay = VideoInitialize.pUpdateFPSDisplay; + g_pWindowHandle = (HWND)VideoInitialize.pWindowHandle; + Callback_PeekMessages = VideoInitialize.pPeekMessages; + g_pUpdateFPSDisplay = VideoInitialize.pUpdateFPSDisplay; // Load and init DSPPlugin DSPInitialize dspInit; @@ -401,9 +397,7 @@ THREAD_RETURN EmuThread(void *pArg) PluginVideo::Video_Shutdown(); PluginVideo::UnloadPlugin(); - if (eventHandler) - delete eventHandler; - + InputCommon::Shutdown(); HW::Shutdown(); LOG(MASTER_LOG, "EmuThread exited"); diff --git a/Source/Core/Core/Src/SConscript b/Source/Core/Core/Src/SConscript index fa4c904e0e..caeabf4ae9 100644 --- a/Source/Core/Core/Src/SConscript +++ b/Source/Core/Core/Src/SConscript @@ -15,7 +15,6 @@ files = ["Console.cpp", "State.cpp", "Tracer.cpp", "VolumeHandler.cpp", - "EventHandler.cpp", "Boot/Boot.cpp", "Boot/Boot_BIOSEmu.cpp", "Boot/Boot_DOL.cpp", @@ -120,9 +119,10 @@ else: ] libs = [ - 'bdisasm' + 'bdisasm', + 'inputcommon', ] env_core = env.Clone(); env_core.Append(CXXFLAGS = [ '-fPIC' ]) -env_core.StaticLibrary("core", files, LIBS=libs) +env_core.StaticLibrary('core', files, LIBS=libs) diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index c3bb079efb..21b20e981a 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -12,7 +12,8 @@ files = [ ] libs = [ - 'core', 'minilzo', 'discio', 'bdisasm', 'videocommon', 'common', 'z' + 'core', 'minilzo', 'discio', 'bdisasm', 'videocommon', 'inputcommon', + 'common', 'z' ] if wxenv['HAVE_WX']: diff --git a/Source/Core/Core/Src/Event.hpp b/Source/Core/InputCommon/Src/Event.hpp similarity index 100% rename from Source/Core/Core/Src/Event.hpp rename to Source/Core/InputCommon/Src/Event.hpp diff --git a/Source/Core/Core/Src/EventHandler.cpp b/Source/Core/InputCommon/Src/EventHandler.cpp similarity index 100% rename from Source/Core/Core/Src/EventHandler.cpp rename to Source/Core/InputCommon/Src/EventHandler.cpp diff --git a/Source/Core/Core/Src/EventHandler.h b/Source/Core/InputCommon/Src/EventHandler.h similarity index 96% rename from Source/Core/Core/Src/EventHandler.h rename to Source/Core/InputCommon/Src/EventHandler.h index 88fa24b8f5..a1f2b2374d 100644 --- a/Source/Core/Core/Src/EventHandler.h +++ b/Source/Core/InputCommon/Src/EventHandler.h @@ -46,6 +46,4 @@ public: static void SFKeyToString(sf::Key::Code keycode, char *keyStr); }; -extern EventHandler *eventHandler; - #endif diff --git a/Source/Core/InputCommon/Src/SConscript b/Source/Core/InputCommon/Src/SConscript new file mode 100644 index 0000000000..0fa6c10cdc --- /dev/null +++ b/Source/Core/InputCommon/Src/SConscript @@ -0,0 +1,12 @@ +# -*- python -*- + +Import('env') + +files = [ + 'EventHandler.cpp', + 'InputCommon.cpp', + ] + +env_inputcommon = env.Clone() +env_inputcommon.Append(CXXFLAGS = [ '-fPIC' ]) +env_inputcommon.StaticLibrary("inputcommon", files) diff --git a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp index 4e9199809f..734e59e563 100644 --- a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp +++ b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp @@ -82,6 +82,9 @@ const SPADStatus& PlayRecord() return(recordBuffer[count++]); } +// TODO: fix this dirty hack to stop missing symbols +void __Log(int log, const char *format, ...) {} +void __Logv(int log, int v, const char *format, ...) {} bool registerKey(int nPad, int id, sf::Key::Code code, int mods) { diff --git a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.h b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.h index f3cf6fb62c..b65603d8d4 100644 --- a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.h +++ b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.h @@ -18,7 +18,7 @@ #ifndef __PADSIMPLE_H__ #define __PADSIMPLE_H__ -#include "EventHandler.h" +#include "InputCommon.h" #define EPAD_CONFIG_FILE "epad.ini" // Controls enum diff --git a/Source/Plugins/Plugin_PadSimpleEvnt/Src/SConscript b/Source/Plugins/Plugin_PadSimpleEvnt/Src/SConscript index 4fdaebe337..aa0b2be1cf 100644 --- a/Source/Plugins/Plugin_PadSimpleEvnt/Src/SConscript +++ b/Source/Plugins/Plugin_PadSimpleEvnt/Src/SConscript @@ -19,6 +19,6 @@ if padeenv['HAVE_WX']: "GUI/ConfigDlg.cpp", ] -padeenv.Append(LIBS = [ 'core', 'common' ]) +padeenv.Append(LIBS = [ 'inputcommon', 'common' ]) padeenv.SharedLibrary(env['plugin_dir']+name, files)