Skip to content

Commit

Permalink
ENGINES: Rewrite switch in SatelliteCamera::handleCameraInput()
Browse files Browse the repository at this point in the history
gcc 8.1's -Wimplicit-fallthrough seemed to be confused about that
switch, thinking it might fall through to the default case.

Rewriting the switch slightly so it's more obvious.
  • Loading branch information
DrMcCoy committed May 19, 2018
1 parent de5e634 commit e4a99b3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/engines/aurora/satellitecamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,22 @@ bool SatelliteCamera::handleCameraInput(const Events::Event &e) {
switch (e.key.keysym.scancode) {
case SDL_SCANCODE_A:
_leftBtnPressed = e.type == Events::kEventKeyDown;
break;
return true;

case SDL_SCANCODE_D:
_rightBtnPressed = e.type == Events::kEventKeyDown;
break;
return true;

default:
return false;
break;
}
break;

default:
return false;
break;
}
return true;

return false;
}

void SatelliteCamera::update(float dt) {
Expand Down

0 comments on commit e4a99b3

Please sign in to comment.