From 5b5e600db6f529ad7e1af9d4bb3a193be2265342 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 30 Aug 2011 07:57:55 +0000 Subject: Last bunch of minor fixes before merge. * Use NULL in AUD_Reference.h * Use SETLOOPER in sound.c * Move flags to the end of Speaker struct. --- source/blender/blenkernel/intern/sound.c | 4 +++- source/blender/editors/sound/sound_ops.c | 7 +++++++ source/blender/makesdna/DNA_speaker_types.h | 7 ++++--- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index abead8d43dd..985fef974d3 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -37,6 +37,7 @@ #include "BKE_packedFile.h" #include "BKE_animsys.h" #include "BKE_sequencer.h" +#include "BKE_scene.h" // evil global ;-) static int sound_cfra; @@ -656,12 +657,13 @@ void sound_update_scene(struct Scene* scene) NlaTrack* track; NlaStrip* strip; Speaker* speaker; + Scene* sce_it; void* new_set = AUD_createSet(); void* handle; float quat[4]; - for(base = FIRSTBASE; base; base=base->next) + for(SETLOOPER(scene, sce_it, base)) { ob = base->object; if(ob->type == OB_SPEAKER) diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index fb4355d0df7..e66abffbfd1 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -648,6 +648,13 @@ static int update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)) void SOUND_OT_update_animation_flags(wmOperatorType *ot) { + /* + This operator is needed to set a correct state of the sound animation + System. Unfortunately there's no really correct place to call the exec + function, that's why I made it an operator that's only visible in the + search menu. Apart from that the bake animation operator calls it too. + */ + /* identifiers */ ot->name= "Update animation"; ot->description= "Update animation flags"; diff --git a/source/blender/makesdna/DNA_speaker_types.h b/source/blender/makesdna/DNA_speaker_types.h index 50cb62c79e5..fecc65885c5 100644 --- a/source/blender/makesdna/DNA_speaker_types.h +++ b/source/blender/makesdna/DNA_speaker_types.h @@ -39,9 +39,6 @@ typedef struct Speaker { struct bSound *sound; - short flag; - short pad1[3]; - // not animatable properties float volume_max; float volume_min; @@ -55,6 +52,10 @@ typedef struct Speaker { // animatable properties float volume; float pitch; + + // flag + short flag; + short pad1[3]; } Speaker; /* **************** SPEAKER ********************* */ -- cgit v1.2.3