projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09fee14
)
fixed playing non-native sounds at wrap-around BD cave positions
author
Holger Schemel
<holger.schemel@virtion.de>
Sun, 1 Dec 2024 14:50:19 +0000
(15:50 +0100)
committer
Holger Schemel
<holger.schemel@virtion.de>
Sun, 1 Dec 2024 14:50:22 +0000
(15:50 +0100)
src/game_bd/bd_sound.c
patch
|
blob
|
history
diff --git
a/src/game_bd/bd_sound.c
b/src/game_bd/bd_sound.c
index 5468cb72d9a704b1f5f96ba69a838be65fcb5edc..b139025e1cc03c96bb98c3dca6a7e8e5b4f00d71 100644
(file)
--- a/
src/game_bd/bd_sound.c
+++ b/
src/game_bd/bd_sound.c
@@
-494,6
+494,10
@@
void gd_sound_play(GdCave *cave, GdSound sound, GdElement element, int x, int y)
if (!game.use_native_bd_sound_engine)
{
+ // fix wrap-around cave positions for non-native sound engine
+ x = (x + cave->w) % cave->w;
+ y = (y + cave->h) % cave->h;
+
// when not using native sound engine, just play the sound
PlayLevelSound_BD(x, y, element, sound);