moving around some event handler code

creating inputcommon


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1766 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-01-04 19:54:56 +00:00
parent b7f1e937bb
commit 90560511c9
11 changed files with 33 additions and 23 deletions

View File

@ -51,6 +51,7 @@ include_paths = [
'../../../../Externals/LZO', '../../../../Externals/LZO',
'../../../../Externals/WiiUseSrc/Src', '../../../../Externals/WiiUseSrc/Src',
'../../../Core/VideoCommon/Src', '../../../Core/VideoCommon/Src',
'../../../Core/InputCommon/Src',
] ]
dirs = [ dirs = [
@ -61,6 +62,7 @@ dirs = [
'Source/Core/Core/Src', 'Source/Core/Core/Src',
'Source/Core/DiscIO/Src', 'Source/Core/DiscIO/Src',
'Source/Core/VideoCommon/Src', 'Source/Core/VideoCommon/Src',
'Source/Core/InputCommon/Src',
'Source/Plugins/Plugin_VideoOGL/Src', 'Source/Plugins/Plugin_VideoOGL/Src',
'Source/Plugins/Plugin_DSP_HLE/Src', 'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src', 'Source/Plugins/Plugin_DSP_LLE/Src',
@ -311,9 +313,9 @@ env['libs_dir'] = env['prefix'] + 'Libs/'
#TODO where should this go? #TODO where should this go?
env['data_dir'] = env['prefix'] 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'], rev = utils.GenerateRevFile(env['flavor'],

View File

@ -56,7 +56,7 @@
#include "MemTools.h" #include "MemTools.h"
#include "Host.h" #include "Host.h"
#include "LogManager.h" #include "LogManager.h"
#include "EventHandler.h" #include "InputCommon.h"
#include "State.h" #include "State.h"
@ -68,7 +68,6 @@
// glXMakeCurrent/ wglMakeCurrent takes a context and makes it current on the current thread. // 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. // 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 namespace Core
{ {
@ -124,10 +123,7 @@ bool Init(const SCoreStartupParameter _CoreParameter)
g_CoreStartupParameter = _CoreParameter; g_CoreStartupParameter = _CoreParameter;
#if defined GLTEST && GLTEST InputCommon::Init();
// init the event handler
eventHandler = new EventHandler();
#endif
// start the thread again // start the thread again
_dbg_assert_(HLE, g_pThread == NULL); _dbg_assert_(HLE, g_pThread == NULL);
@ -401,9 +397,7 @@ THREAD_RETURN EmuThread(void *pArg)
PluginVideo::Video_Shutdown(); PluginVideo::Video_Shutdown();
PluginVideo::UnloadPlugin(); PluginVideo::UnloadPlugin();
if (eventHandler) InputCommon::Shutdown();
delete eventHandler;
HW::Shutdown(); HW::Shutdown();
LOG(MASTER_LOG, "EmuThread exited"); LOG(MASTER_LOG, "EmuThread exited");

View File

@ -15,7 +15,6 @@ files = ["Console.cpp",
"State.cpp", "State.cpp",
"Tracer.cpp", "Tracer.cpp",
"VolumeHandler.cpp", "VolumeHandler.cpp",
"EventHandler.cpp",
"Boot/Boot.cpp", "Boot/Boot.cpp",
"Boot/Boot_BIOSEmu.cpp", "Boot/Boot_BIOSEmu.cpp",
"Boot/Boot_DOL.cpp", "Boot/Boot_DOL.cpp",
@ -120,9 +119,10 @@ else:
] ]
libs = [ libs = [
'bdisasm' 'bdisasm',
'inputcommon',
] ]
env_core = env.Clone(); env_core = env.Clone();
env_core.Append(CXXFLAGS = [ '-fPIC' ]) env_core.Append(CXXFLAGS = [ '-fPIC' ])
env_core.StaticLibrary("core", files, LIBS=libs) env_core.StaticLibrary('core', files, LIBS=libs)

View File

@ -12,7 +12,8 @@ files = [
] ]
libs = [ libs = [
'core', 'minilzo', 'discio', 'bdisasm', 'videocommon', 'common', 'z' 'core', 'minilzo', 'discio', 'bdisasm', 'videocommon', 'inputcommon',
'common', 'z'
] ]
if wxenv['HAVE_WX']: if wxenv['HAVE_WX']:

View File

@ -46,6 +46,4 @@ public:
static void SFKeyToString(sf::Key::Code keycode, char *keyStr); static void SFKeyToString(sf::Key::Code keycode, char *keyStr);
}; };
extern EventHandler *eventHandler;
#endif #endif

View File

@ -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)

View File

@ -82,6 +82,9 @@ const SPADStatus& PlayRecord()
return(recordBuffer[count++]); 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) { bool registerKey(int nPad, int id, sf::Key::Code code, int mods) {

View File

@ -18,7 +18,7 @@
#ifndef __PADSIMPLE_H__ #ifndef __PADSIMPLE_H__
#define __PADSIMPLE_H__ #define __PADSIMPLE_H__
#include "EventHandler.h" #include "InputCommon.h"
#define EPAD_CONFIG_FILE "epad.ini" #define EPAD_CONFIG_FILE "epad.ini"
// Controls // Controls
enum enum

View File

@ -19,6 +19,6 @@ if padeenv['HAVE_WX']:
"GUI/ConfigDlg.cpp", "GUI/ConfigDlg.cpp",
] ]
padeenv.Append(LIBS = [ 'core', 'common' ]) padeenv.Append(LIBS = [ 'inputcommon', 'common' ])
padeenv.SharedLibrary(env['plugin_dir']+name, files) padeenv.SharedLibrary(env['plugin_dir']+name, files)