When choosing a stamp that has both a sound effect and a description sound (e.g., in English, the 2nd frog in the animals collection), the description sound should play automatically after the sound effect ends. This does not appear to be happening.
When a stamp contains both sounds, a callback to playstampdesc()
is set up via Mix_ChannelFinished()
. That function sets up an SDL_Event
of type SDL_USEREVENT
(with user.code
of USEREVENT_PLAYDESCSOUND
and user.data1
being the current stamp). I've confirmed that SDL_PushEvent()
is returning success (1), and that the main loop code that we're handling user events (e.g., USEREVENT_TEXT_UPDATE
to show a stamp description after temporarily showing a random string from great_strs[]
).
I did some tests and found an interesting thing:
There are frog, blackbird, crow and more that have descs
frog doesn't play, blackbird and crow plays.
If I rename amphibians to zamphibians,then frog goes to the end of the stamps and plays
but then blackbird doesn't play, crow still plays.
Looks that the problem is the first of the list?
I've put a lot of printfs here and there and found where the pushed event get trapped, but I don't understand why only the event corresponding to the frog is trapped there and not the ones of the other stamps?
The pushed event enters in this check and not arrives to the USEREVENT check:
else if ((event.type == SDL_MOUSEBUTTONDOWN ||
event.type == TP_SDL_MOUSEBUTTONSCROLL) && event.button.button <= 3)
I have something that works for me, by registering an own event for playing descs.
Please review it.
Thanks
Pere
Thanks Pere! It seems to help, so I've committed it.