From b0d9994220a0960889e871bd7f3513f075ff2007 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Sep 2008 13:24:22 +0000 Subject: [PATCH] made max sounds playable at once 32 rather then 16. (demo release background music would turn off otherwise) made selecting sound samples keep the relative path setting. --- intern/SoundSystem/SoundDefines.h | 2 +- source/blender/src/buttons_scene.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/intern/SoundSystem/SoundDefines.h b/intern/SoundSystem/SoundDefines.h index 5d425a8dc94..9758fdaadea 100644 --- a/intern/SoundSystem/SoundDefines.h +++ b/intern/SoundSystem/SoundDefines.h @@ -44,7 +44,7 @@ enum /* general stuff */ #define NUM_BUFFERS 128 -#define NUM_SOURCES 16 +#define NUM_SOURCES 32 /* openal related stuff */ #define AL_LOOPING 0x1007 diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 5205be3e1b0..f2e20356f21 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -211,9 +211,15 @@ void do_soundbuts(unsigned short event) case B_SOUND_MENU_SAMPLE: if (G.buts->menunr > 0) { sample = BLI_findlink(samples, G.buts->menunr - 1); - if (sample && sound) { + if (sample && sound && sound->sample != sample) { + int wasrelative = (strncmp(sound->name, "//", 2)==0); + BLI_strncpy(sound->name, sample->name, sizeof(sound->name)); sound_set_sample(sound, sample); + + if (wasrelative) + BLI_makestringcode(G.sce, sound->name); + do_soundbuts(B_SOUND_REDRAW); } }