forked from bartvdbraak/blender
Fix MSVC build ( .0f/.0f fires a compiler error )
This commit is contained in:
parent
0c0259d931
commit
13490b1ac3
@ -35,6 +35,7 @@
|
|||||||
* \author nzc
|
* \author nzc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define SOUND_ERR_FLT FLT_MIN
|
||||||
#define SOUND_WAVE_SAMPLES_PER_SECOND 250
|
#define SOUND_WAVE_SAMPLES_PER_SECOND 250
|
||||||
|
|
||||||
struct PackedFile;
|
struct PackedFile;
|
||||||
|
@ -630,7 +630,7 @@ float sound_sync_scene(struct Scene *scene)
|
|||||||
else
|
else
|
||||||
return AUD_getPosition(scene->sound_scene_handle);
|
return AUD_getPosition(scene->sound_scene_handle);
|
||||||
}
|
}
|
||||||
return .0f/.0f;
|
return SOUND_ERR_FLT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sound_scene_playing(struct Scene *scene)
|
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_play_scene(struct Scene *UNUSED(scene)) {}
|
||||||
void sound_stop_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)) {}
|
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_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; }
|
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; }
|
void sound_read_waveform(struct bSound* sound) { (void)sound; }
|
||||||
|
@ -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 if (sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0;
|
||||||
else sync= (scene->flag & SCE_FRAME_DROP);
|
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;
|
scene->r.cfra = (double)time * FPS + 0.5;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "DNA_listBase.h"
|
#include "DNA_listBase.h"
|
||||||
#include "DNA_screen_types.h"
|
#include "DNA_screen_types.h"
|
||||||
@ -47,6 +46,7 @@
|
|||||||
|
|
||||||
#include "BLI_blenlib.h"
|
#include "BLI_blenlib.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
#include "BLI_math.h"
|
||||||
|
|
||||||
#include "BKE_blender.h"
|
#include "BKE_blender.h"
|
||||||
#include "BKE_context.h"
|
#include "BKE_context.h"
|
||||||
@ -1791,7 +1791,7 @@ void wm_event_do_handlers(bContext *C)
|
|||||||
|
|
||||||
if(playing == 0) {
|
if(playing == 0) {
|
||||||
float time = sound_sync_scene(scene);
|
float time = sound_sync_scene(scene);
|
||||||
if(finite(time)) {
|
if(time != SOUND_ERR_FLT) {
|
||||||
int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
|
int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
|
||||||
if(ncfra != scene->r.cfra) {
|
if(ncfra != scene->r.cfra) {
|
||||||
scene->r.cfra = ncfra;
|
scene->r.cfra = ncfra;
|
||||||
|
Loading…
Reference in New Issue
Block a user