Fix assertion failure when joysticks with more than one hat are attached

This commit is contained in:
Glenn Maynard
2003-10-08 20:40:41 +00:00
parent 8ff43a4bb8
commit 075c34e8cc
@@ -307,19 +307,18 @@ void InputHandler_DInput::UpdatePolled(DIDevice &device, const RageTimer &tm)
} }
case in.HAT: case in.HAT:
if( in.num == 0 )
{ {
ASSERT( in.num == 0 ); // XXX
const int pos = TranslatePOV(state.rgdwPOV[in.ofs - DIJOFS_POV(0)]); const int pos = TranslatePOV(state.rgdwPOV[in.ofs - DIJOFS_POV(0)]);
ButtonPressed(DeviceInput(dev, JOY_HAT_UP, tm), !!(pos & SDL_HAT_UP)); ButtonPressed(DeviceInput(dev, JOY_HAT_UP, tm), !!(pos & SDL_HAT_UP));
ButtonPressed(DeviceInput(dev, JOY_HAT_DOWN, tm), !!(pos & SDL_HAT_DOWN)); ButtonPressed(DeviceInput(dev, JOY_HAT_DOWN, tm), !!(pos & SDL_HAT_DOWN));
ButtonPressed(DeviceInput(dev, JOY_HAT_LEFT, tm), !!(pos & SDL_HAT_LEFT)); ButtonPressed(DeviceInput(dev, JOY_HAT_LEFT, tm), !!(pos & SDL_HAT_LEFT));
ButtonPressed(DeviceInput(dev, JOY_HAT_RIGHT, tm), !!(pos & SDL_HAT_RIGHT)); ButtonPressed(DeviceInput(dev, JOY_HAT_RIGHT, tm), !!(pos & SDL_HAT_RIGHT));
}
break; break;
} }
} }
}
} }
void InputHandler_DInput::UpdateBuffered(DIDevice &device, const RageTimer &tm) void InputHandler_DInput::UpdateBuffered(DIDevice &device, const RageTimer &tm)