Commit graph

26 commits

Author SHA1 Message Date
Kp 88832e3679 Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +00:00
Kp c7041a9b26 Use reinterpret_cast for digi magic value (void*)-1 2016-09-04 19:10:43 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp 232cc324f9 Use inline namespace dsx for similar/arch/sdl/ 2015-12-13 18:00:48 +00:00
Kp ed55763603 Remove unused symbols 2015-12-04 03:36:31 +00:00
Kp 7153ec69a9 Move SndNoSound to CGameArg 2015-11-24 04:05:36 +00:00
Kp 17b1943c5e Mark various per-file structures as static 2015-08-12 03:11:46 +00:00
Kp bc7c469ab2 Use array<> for more globals 2015-08-12 03:11:46 +00:00
Kp b4eaa591c8 Fix crash when all sound channels are in use
If digi_mixer_find_channel returns -1, do not use that result to index
channels[].
2015-03-22 22:48:47 +00:00
derhass b73407e791 Prevent digi_mixer_start_sound() from trying to play nonexisting sounds.
There is a an out-of-bounds access in digi_mixer_start_sound() when
soundnum is < 0. The bounds check I added here is already present in
digi_audio_start_sound().

This bug was triggered on the RPi d2x built when trying to show the
briefing screen because briefing_new_screen() tries to play
SOUND_BRIEFING_HUM, which digi_xlat_sound() translated to -1 in this
situation. The game finally crashed in mixdigi_convert_sound() because
GameSounds[-1] happened to contain some non-zero data (on my Linux desktop,
that memory seems to be always 0 by accident...). This was also the reason
why the pi version tried to allocate lots of memory before it crashed in
memcpy().
2015-03-21 23:45:42 +01:00
Kp 84e3a03451 Remove unused parameters 2015-01-18 01:58:33 +00:00
Kp 80aa48efb4 Pass digi_*_start_sound soundobj as sound_object* 2014-12-14 05:22:59 +00:00
Kp 307ad30433 Remove unused digi_*_is_sound_playing 2014-12-11 02:34:54 +00:00
Bradley Bell 3daa0f63b1 Add search SDL_mixer framework paths for headers instead of using <Framework/Header.h> notation 2014-12-03 15:14:18 -08:00
Kp 5ed9acb187 Propagate for variables in similar/arch/sdl/digi_mixer.cpp 2014-09-26 02:42:13 +00:00
Kp 94550355a8 Use make_unique instead of bare new 2014-08-24 18:28:09 +00:00
Kp cd9987968c Fix bogus memory leak warning in digi_mixer.cpp
u_mem runs too early.  Move the memory outside its view and rely on
Valgrind.
2014-08-20 01:28:12 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00:00
Kp 1ec8057d74 Fix at-exit memory leak in digi_mixer 2013-12-20 04:41:46 +00:00
Kp 75c229c6bf Normalize con_printf newline usage 2013-12-07 21:13:37 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 375fa1fa00 Rename digi_max_channels -> digi_mixer_max_channels
digi_audio.cpp has its own digi_max_channels
2013-10-26 03:50:28 +00:00
Kp c58c4e4d06 Move declarations to headers 2013-10-03 03:11:52 +00:00
Kp deb6fe9a91 Use MALLOC for mixdigi_convert_sound 2013-10-02 02:50:13 +00:00
Kp ace3238790 Move similar/arch/sdl/digi_mixer.c -> similar/arch/sdl/digi_mixer.cpp 2013-10-01 02:53:09 +00:00
Renamed from similar/arch/sdl/digi_mixer.c (Browse further)