diff options
author | Joerg Mueller <nexyon@gmail.com> | 2009-08-03 12:16:36 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2009-08-03 12:16:36 +0400 |
commit | a917e1d6de2cfaed592caec09befd0518329dd2d (patch) | |
tree | 26a640596426c6049152329c8587bfec4b50ac51 | |
parent | 04d5344cae61912cb8606c5c41acab6e099fb9cb (diff) |
Sound settings from pre 2.5 files are now loaded into SoundActuators.
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 29 | ||||
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 3 |
2 files changed, 22 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0fc8167f0b1..2ec65404697 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9195,21 +9195,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(act= ob->actuators.first; act; act= act->next) { if (act->type == ACT_SOUND) { bSoundActuator *sAct = (bSoundActuator*) act->data; -/* that would only work if do_versions was called after the linking if(sAct->sound) { - sAct->flag = sAct->sound->flags | SOUND_FLAGS_3D ? ACT_SND_3D_SOUND : 0; - sAct->pitch = sAct->sound->pitch; - sAct->volume = sAct->sound->volume; - sAct->sound3D.reference_distance = sAct->sound->distance; - sAct->sound3D.max_gain = sAct->sound->max_gain; - sAct->sound3D.min_gain = sAct->sound->min_gain; - sAct->sound3D.rolloff_factor = sAct->sound->attenuation; + sound = newlibadr(fd, lib, sAct->sound); + sAct->flag = sound->flags | SOUND_FLAGS_3D ? ACT_SND_3D_SOUND : 0; + sAct->pitch = sound->pitch; + sAct->volume = sound->volume; + sAct->sound3D.reference_distance = sound->distance; + sAct->sound3D.max_gain = sound->max_gain; + sAct->sound3D.min_gain = sound->min_gain; + sAct->sound3D.rolloff_factor = sound->attenuation; } - else*/ + else { sAct->sound3D.reference_distance = 1.0f; - sAct->flag = ACT_SND_3D_SOUND; sAct->volume = 1.0f; sAct->sound3D.max_gain = 1.0f; sAct->sound3D.rolloff_factor = 1.0f; @@ -9567,6 +9566,16 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) bfd->user->uifonts.first= bfd->user->uifonts.last= NULL; bfd->user->uistyles.first= bfd->user->uistyles.last= NULL; + // AUD_XXX + if(bfd->user->audiochannels == 0) + bfd->user->audiochannels = 2; + if(bfd->user->audiodevice == 0) + bfd->user->audiodevice = 1; + if(bfd->user->audioformat == 0) + bfd->user->audioformat = 0x12; + if(bfd->user->audiorate == 0) + bfd->user->audiorate = 44100; + bhead = blo_nextbhead(fd, bhead); /* read all attached data */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index a5b9cb59784..96f491c9a8a 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -2010,7 +2010,10 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound"); uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space."); if(sa->flag & ACT_SND_3D_SOUND) + { uiDefButF(block, NUM, 0, "Rolloff: ", xco+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance."); + uiDefButF(block, NUM, 0, "Reference distance: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.reference_distance, 0.0, 1000.0, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0."); + } } MEM_freeN(str); } |