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

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

@ -73,7 +73,7 @@ void SandboxState::enter()
toolIndex = 0;
game->selectTool(toolIndex);
//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;
noPick = false;

Loading…
Cancel
Save