use floor since round is missing on windows

This commit is contained in:
Stephen Birarda 2014-03-12 17:50:58 -07:00
parent bd6c42a685
commit 54d73d4a64
2 changed files with 2 additions and 8 deletions

View file

@ -40,7 +40,7 @@ Agent::~Agent() {
delete _avatarAudioStream; delete _avatarAudioStream;
} }
const int SCRIPT_AUDIO_BUFFER_SAMPLES = (SCRIPT_DATA_CALLBACK_USECS * SAMPLE_RATE) / (1000 * 1000); const int SCRIPT_AUDIO_BUFFER_SAMPLES = floor(((SCRIPT_DATA_CALLBACK_USECS * SAMPLE_RATE) / (1000 * 1000)) + 0.5);
void Agent::setSendAvatarAudioStream(bool sendAvatarAudioStream) { void Agent::setSendAvatarAudioStream(bool sendAvatarAudioStream) {
if (sendAvatarAudioStream) { if (sendAvatarAudioStream) {

View file

@ -28,13 +28,7 @@ class ParticlesScriptingInterface;
const QString NO_SCRIPT(""); const QString NO_SCRIPT("");
#ifdef Q_OS_WIN32 const unsigned int SCRIPT_DATA_CALLBACK_USECS = floor(((1.0 / 60.0f) * 1000 * 1000) + 0.5);
inline double roundf(double value) {
return (value > 0.0) ? floor(value + 0.5) : ceil(value - 0.5);
}
#endif
const unsigned int SCRIPT_DATA_CALLBACK_USECS = roundf((1.0 / 60.0) * 1000 * 1000);
class ScriptEngine : public QObject { class ScriptEngine : public QObject {
Q_OBJECT Q_OBJECT