mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-01-25 03:01:05 +02:00
InputManager: reduce namespace pollution.
Moved dependency on SDL to implementation file. Don't import std namespace in header. If we need std::string, import <string>, not something else.
This commit is contained in:
parent
ba6003606e
commit
c6db9ff21b
@ -23,9 +23,13 @@
|
||||
#include "utilities.h"
|
||||
#include "powersaver.h"
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
static SDL_Joystick *joystick;
|
||||
|
||||
void InputManager::init(const string &conffile) {
|
||||
|
@ -21,10 +21,7 @@
|
||||
#ifndef INPUTMANAGER_H
|
||||
#define INPUTMANAGER_H
|
||||
|
||||
#include <SDL.h>
|
||||
#include <sstream>
|
||||
|
||||
using namespace std;
|
||||
#include <string>
|
||||
|
||||
typedef enum buttontype_e {
|
||||
UP, DOWN, LEFT, RIGHT,
|
||||
@ -42,7 +39,7 @@ enum state_e {PRESSED, RELEASED};
|
||||
|
||||
typedef struct {
|
||||
source_type_e source;
|
||||
Uint32 code;
|
||||
unsigned int code;
|
||||
} input_t;
|
||||
|
||||
typedef struct {
|
||||
@ -56,7 +53,7 @@ public:
|
||||
InputManager();
|
||||
~InputManager();
|
||||
|
||||
void init(const string &conffile);
|
||||
void init(const std::string &conffile);
|
||||
void waitForEvent(bevent_t *event);
|
||||
buttontype_t waitForPressedButton();
|
||||
buttontype_t waitForReleasedButton();
|
||||
@ -65,7 +62,7 @@ public:
|
||||
private:
|
||||
input_t ButtonMap[BUTTONTYPE_T_SIZE];
|
||||
|
||||
bool readConfFile(const string &conffile);
|
||||
bool readConfFile(const std::string &conffile);
|
||||
void initJoystick();
|
||||
bool getEvent(bevent_t *bevent, bool wait);
|
||||
buttontype_t waitForButton(enum state_e state);
|
||||
|
Loading…
x
Reference in New Issue
Block a user