From 13490b1ac3ee1a98a4e968555df53a4699f23f27 Mon Sep 17 00:00:00 2001 From: Andrew Wiggin Date: Fri, 14 Oct 2011 05:07:53 +0000 Subject: Fix MSVC build ( .0f/.0f fires a compiler error ) --- source/blender/blenkernel/BKE_sound.h | 1 + source/blender/blenkernel/intern/sound.c | 4 ++-- source/blender/editors/screen/screen_ops.c | 2 +- source/blender/windowmanager/intern/wm_event_system.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 3728dd41089..081fb8dc132 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -35,6 +35,7 @@ * \author nzc */ +#define SOUND_ERR_FLT FLT_MIN #define SOUND_WAVE_SAMPLES_PER_SECOND 250 struct PackedFile; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 649b4f0b724..b9a02df423e 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -630,7 +630,7 @@ float sound_sync_scene(struct Scene *scene) else return AUD_getPosition(scene->sound_scene_handle); } - return .0f/.0f; + return SOUND_ERR_FLT; } int sound_scene_playing(struct Scene *scene) @@ -787,7 +787,7 @@ static void sound_start_play_scene(struct Scene *UNUSED(scene)) {} void sound_play_scene(struct Scene *UNUSED(scene)) {} void sound_stop_scene(struct Scene *UNUSED(scene)) {} void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {} -float sound_sync_scene(struct Scene *UNUSED(scene)) { return .0f/.0f; } +float sound_sync_scene(struct Scene *UNUSED(scene)) { return SOUND_ERR_FLT; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; } void sound_read_waveform(struct bSound* sound) { (void)sound; } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index a2be1e8fa6f..8d9190ac80c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2814,7 +2814,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e else if (sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0; else sync= (scene->flag & SCE_FRAME_DROP); - if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene))) + if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && ((time = sound_sync_scene(scene)) != SOUND_ERR_FLT)) scene->r.cfra = (double)time * FPS + 0.5; else { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 074151c9abe..4055b6c7d9e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -33,7 +33,6 @@ #include #include -#include #include "DNA_listBase.h" #include "DNA_screen_types.h" @@ -47,6 +46,7 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLI_math.h" #include "BKE_blender.h" #include "BKE_context.h" @@ -1791,7 +1791,7 @@ void wm_event_do_handlers(bContext *C) if(playing == 0) { float time = sound_sync_scene(scene); - if(finite(time)) { + if(time != SOUND_ERR_FLT) { int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f; if(ncfra != scene->r.cfra) { scene->r.cfra = ncfra; -- cgit v1.2.3