[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22170] branches/soundsystem/source/ blender: Sound settings from pre 2. 5 files are now loaded into SoundActuators.

Jörg Müller nexyon at gmail.com
Mon Aug 3 10:16:40 CEST 2009


Revision: 22170
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22170
Author:   nexyon
Date:     2009-08-03 10:16:36 +0200 (Mon, 03 Aug 2009)

Log Message:
-----------
Sound settings from pre 2.5 files are now loaded into SoundActuators.

Modified Paths:
--------------
    branches/soundsystem/source/blender/blenloader/intern/readfile.c
    branches/soundsystem/source/blender/editors/space_logic/logic_window.c

Modified: branches/soundsystem/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soundsystem/source/blender/blenloader/intern/readfile.c	2009-08-03 05:21:13 UTC (rev 22169)
+++ branches/soundsystem/source/blender/blenloader/intern/readfile.c	2009-08-03 08:16:36 UTC (rev 22170)
@@ -9195,21 +9195,20 @@
 			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 @@
 	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 */

Modified: branches/soundsystem/source/blender/editors/space_logic/logic_window.c
===================================================================
--- branches/soundsystem/source/blender/editors/space_logic/logic_window.c	2009-08-03 05:21:13 UTC (rev 22169)
+++ branches/soundsystem/source/blender/editors/space_logic/logic_window.c	2009-08-03 08:16:36 UTC (rev 22170)
@@ -2010,7 +2010,10 @@
 					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);
 			} 





More information about the Bf-blender-cvs mailing list