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.
This commit is contained in:
Campbell Barton 2008-09-12 13:24:22 +00:00
parent 0795d01df4
commit b0d9994220
2 changed files with 8 additions and 2 deletions

@ -44,7 +44,7 @@ enum
/* general stuff */ /* general stuff */
#define NUM_BUFFERS 128 #define NUM_BUFFERS 128
#define NUM_SOURCES 16 #define NUM_SOURCES 32
/* openal related stuff */ /* openal related stuff */
#define AL_LOOPING 0x1007 #define AL_LOOPING 0x1007

@ -211,9 +211,15 @@ void do_soundbuts(unsigned short event)
case B_SOUND_MENU_SAMPLE: case B_SOUND_MENU_SAMPLE:
if (G.buts->menunr > 0) { if (G.buts->menunr > 0) {
sample = BLI_findlink(samples, G.buts->menunr - 1); 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)); BLI_strncpy(sound->name, sample->name, sizeof(sound->name));
sound_set_sample(sound, sample); sound_set_sample(sound, sample);
if (wasrelative)
BLI_makestringcode(G.sce, sound->name);
do_soundbuts(B_SOUND_REDRAW); do_soundbuts(B_SOUND_REDRAW);
} }
} }