Skip to content

Commit

Permalink
Fix the rumble driver raising an exception when setting the rumble state
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed Oct 23, 2024
1 parent 709a482 commit b49cf56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **BREAKING:** Rename `DefaultRumbleDriver` to `DictRumbleDriver`.
- **BREAKING:** Rename `GeneratorInputDriver` to `IterableInputDriver`.

### Fixed

- Fix the rumble driver raising an exception when setting the rumble state.

## [0.3.1] - 2024-10-17

### Changed
Expand Down
5 changes: 3 additions & 2 deletions src/libretro/drivers/environment/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,15 @@ def _get_rumble_interface(self, rumble_ptr: POINTER(retro_rumble_interface)) ->
return False

if not self._rumble:
self._rumble = retro_rumble_interface(self.__set_rumble_state)
self._rumble = retro_rumble_interface(
retro_set_rumble_state_t(self.__set_rumble_state)
)
# So that even if the rumble/input drivers are swapped out,
# the core still has valid function pointers tied to non-GC'd callable objects

rumble_ptr[0] = self._rumble
return True

@retro_set_rumble_state_t
def __set_rumble_state(self, port: int, effect: int, strength: int) -> bool:
if not self._input.rumble:
return False
Expand Down

0 comments on commit b49cf56

Please sign in to comment.