InputCommon: Split Device stuff out

The ExpressionParser needs this to be out of here to prevent issues
with cyclic references.
This commit is contained in:
Jasper St. Pierre
2013-06-16 20:07:10 -04:00
parent 143d2eccb4
commit 877106b027
30 changed files with 448 additions and 451 deletions

View File

@ -1,10 +1,11 @@
#include "../ControllerInterface.h"
#ifdef CIFACE_USE_SDL
#include "SDL.h"
#include <StringUtil.h>
#include <map>
#include <sstream>
#include <algorithm>
#ifdef _WIN32
#if SDL_VERSION_ATLEAST(1, 3, 0)
#pragma comment(lib, "SDL.1.3.lib")
@ -27,7 +28,7 @@ std::string GetJoystickName(int index)
#endif
}
void Init( std::vector<ControllerInterface::Device*>& devices )
void Init( std::vector<Core::Device*>& devices )
{
// this is used to number the joysticks
// multiple joysticks with the same name shall get unique ids starting at 0
@ -399,5 +400,3 @@ ControlState Joystick::Hat::GetState() const
}
}
#endif

View File

@ -1,7 +1,7 @@
#ifndef _CIFACE_SDL_H_
#define _CIFACE_SDL_H_
#include "../ControllerInterface.h"
#include "../Device.h"
#include <list>
@ -23,9 +23,9 @@ namespace ciface
namespace SDL
{
void Init( std::vector<ControllerInterface::Device*>& devices );
void Init( std::vector<Core::Device*>& devices );
class Joystick : public ControllerInterface::Device
class Joystick : public Core::Device
{
private:
@ -40,7 +40,7 @@ private:
};
#endif
class Button : public Input
class Button : public Core::Device::Input
{
public:
std::string GetName() const;
@ -51,7 +51,7 @@ private:
const u8 m_index;
};
class Axis : public Input
class Axis : public Core::Device::Input
{
public:
std::string GetName() const;