Merge pull request #9 from jangler/jshat-fix

Fix SDL handling of joystick hats
This commit is contained in:
sinamas 2019-02-24 19:29:29 +01:00 committed by GitHub
commit d7494e0f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,10 +369,10 @@ void InputOption::exec(char const *const *argv, int index) {
break;
case 'h':
switch (dir) {
case 'u': id.jdata.dir = JoyData::dir_up;
case 'd': id.jdata.dir = JoyData::dir_down;
case 'l': id.jdata.dir = JoyData::dir_left;
case 'r': id.jdata.dir = JoyData::dir_right;
case 'u': id.jdata.dir = JoyData::dir_up; break;
case 'd': id.jdata.dir = JoyData::dir_down; break;
case 'l': id.jdata.dir = JoyData::dir_left; break;
case 'r': id.jdata.dir = JoyData::dir_right; break;
default: continue;
}
@ -723,7 +723,7 @@ bool GambatteSdl::handleEvents(BlitterWrapper &blitter) {
jd.num = e.jhat.hat;
for (std::pair<jmap_t::iterator, jmap_t::iterator> range =
jaMap.equal_range(jd); range.first != range.second; ++range.first) {
jhMap.equal_range(jd); range.first != range.second; ++range.first) {
if (e.jhat.value & range.first->first.dir)
inputGetter.is |= range.first->second;
else