Browse Source

Add input events for when gamepads are connected or disconnected

master
C. J. Howard 5 years ago
parent
commit
79f9a119c9
Signed by: cjhoward GPG Key ID: 03E1FABA9C3EC195
3 changed files with 1045 additions and 848 deletions
  1. +1036
    -846
      src/game.cpp
  2. +8
    -1
      src/game.hpp
  3. +1
    -1
      src/states/sandbox-state.cpp

+ 1036
- 846
src/game.cpp
File diff suppressed because it is too large
View File


+ 8
- 1
src/game.hpp View File

@ -131,19 +131,23 @@ private:
virtual void render(); virtual void render();
virtual void exit(); virtual void exit();
virtual void handleEvent(const WindowResizedEvent& event); virtual void handleEvent(const WindowResizedEvent& event);
virtual void handleEvent(const GamepadConnectedEvent& event);
virtual void handleEvent(const GamepadDisconnectedEvent& event);
void setupDebugging();
void setupLocalization(); void setupLocalization();
void setupWindow(); void setupWindow();
void setupGraphics(); void setupGraphics();
void setupUI(); void setupUI();
void setupControls(); void setupControls();
void setupGameplay(); void setupGameplay();
void setupDebugging();
void resetSettings(); void resetSettings();
void loadSettings(); void loadSettings();
void saveSettings(); void saveSettings();
void loadStrings(); void loadStrings();
void loadControlProfile();
void saveControlProfile();
void resizeUI(int w, int h); void resizeUI(int w, int h);
void restringUI(); void restringUI();
@ -245,6 +249,9 @@ public:
ControlSet debugControls; ControlSet debugControls;
Control toggleWireframeControl; Control toggleWireframeControl;
// Map of control names
std::map<std::string, Control*> controlNameMap;
// Logic // Logic
float time; float time;
float timestep; float timestep;

+ 1
- 1
src/states/sandbox-state.cpp View File

@ -73,7 +73,7 @@ void SandboxState::enter()
toolIndex = 0; toolIndex = 0;
game->selectTool(toolIndex); game->selectTool(toolIndex);
//game->currentTool->setActive(false); //game->currentTool->setActive(false);
game->mouse->warp(game->window, game->w / 2, game->h / 2);
//game->mouse->warp(game->window, game->w / 2, game->h / 2);
zoom = 0.5f; zoom = 0.5f;
noPick = false; noPick = false;

Loading…
Cancel
Save