diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index 594805c7c2..39dcf4b29c 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +54,10 @@ AssignmentClient::AssignmentClient(int ppid, Assignment::Type requestAssignmentT // create a NodeList as an unassigned client DependencyManager::registerInheritance(); auto addressManager = DependencyManager::set(); - auto nodeList = DependencyManager::set(NodeType::Unassigned); + auto nodeList = DependencyManager::set(NodeType::Unassigned); // Order is important + + auto animationCache = DependencyManager::set(); + auto avatarHashMap = DependencyManager::set(); auto entityScriptingInterface = DependencyManager::set(); // make up a uuid for this child so the parent can tell us apart. This id will be changed diff --git a/examples/acScripts/bot_procedural.js b/examples/acScripts/bot_procedural.js index 518ef8cc22..8386662dba 100644 --- a/examples/acScripts/bot_procedural.js +++ b/examples/acScripts/bot_procedural.js @@ -12,7 +12,7 @@ //For procedural walk animation HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/"; -Script.include("proceduralAnimationAPI.js"); +Script.include(HIFI_PUBLIC_BUCKET + "scripts/acScripts/proceduralAnimationAPI.js"); var procAnimAPI = new ProcAnimAPI(); diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c6d8fe7c9b..a63e2f2005 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -994,11 +994,12 @@ bool Application::importSVOFromURL(const QString& urlString) { } bool Application::event(QEvent* event) { - switch (event->type()) { - case Lambda: - ((LambdaEvent*)event)->call(); - return true; + if ((int)event->type() == (int)Lambda) { + ((LambdaEvent*)event)->call(); + return true; + } + switch (event->type()) { case QEvent::MouseMove: mouseMoveEvent((QMouseEvent*)event); return true; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 90a9d3b22c..8070bd5555 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -439,7 +439,7 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(leapOptionsMenu, MenuOption::LeapMotionOnHMD, 0, false); #ifdef HAVE_RSSDK - QMenu* realSenseOptionsMenu = handOptionsMenu->addMenu("RealSense"); + MenuWrapper* realSenseOptionsMenu = handOptionsMenu->addMenu("RealSense"); addActionToQMenuAndActionHash(realSenseOptionsMenu, MenuOption::LoadRSSDKFile, 0, RealSense::getInstance(), SLOT(loadRSSDKFile())); #endif diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 05f834255c..8083e153fe 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -723,9 +723,6 @@ void Avatar::renderDisplayName() { .arg(getReceiveRate()); } - QByteArray ba = _displayName.toLocal8Bit(); - const char* text = ba.data(); - glDisable(GL_POLYGON_OFFSET_FILL); textRenderer(DISPLAYNAME)->draw(text_x, text_y, renderedDisplayName, color); diff --git a/interface/src/devices/DdeFaceTracker.cpp b/interface/src/devices/DdeFaceTracker.cpp index b6525ffb52..1ba623ca20 100644 --- a/interface/src/devices/DdeFaceTracker.cpp +++ b/interface/src/devices/DdeFaceTracker.cpp @@ -136,9 +136,6 @@ struct Packet { const float STARTING_DDE_MESSAGE_TIME = 0.033f; -const int FPS_TIMER_DELAY = 2000; // ms -const int FPS_TIMER_DURATION = 2000; // ms - #ifdef WIN32 // warning C4351: new behavior: elements of array 'DdeFaceTracker::_lastEyeBlinks' will be default initialized // warning C4351: new behavior: elements of array 'DdeFaceTracker::_filteredEyeBlinks' will be default initialized diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index 7d719873f4..5405c76b65 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -461,7 +461,7 @@ void OculusManager::display(const glm::quat &bodyOrientation, const glm::vec3 &p #ifdef DEBUG // Ensure the frame counter always increments by exactly 1 static int oldFrameIndex = -1; - assert(oldFrameIndex == -1 || oldFrameIndex == _frameIndex - 1); + assert(oldFrameIndex == -1 || (unsigned int)oldFrameIndex == _frameIndex - 1); oldFrameIndex = _frameIndex; #endif diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 331e62ec70..36308f6576 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -981,7 +981,7 @@ void AudioClient::selectAudioSourceSine440() { _noiseSourceEnabled = false; } -bool AudioClient::outputLocalInjector(bool isStereo, qreal volume, AudioInjector* injector) { +bool AudioClient::outputLocalInjector(bool isStereo, AudioInjector* injector) { if (injector->getLocalBuffer()) { QAudioFormat localFormat = _desiredOutputFormat; localFormat.setChannelCount(isStereo ? 2 : 1); @@ -990,8 +990,6 @@ bool AudioClient::outputLocalInjector(bool isStereo, qreal volume, AudioInjector localFormat, injector->getLocalBuffer()); - localOutput->setVolume(volume); - // move the localOutput to the same thread as the local injector buffer localOutput->moveToThread(injector->getLocalBuffer()->thread()); diff --git a/libraries/audio-client/src/AudioClient.h b/libraries/audio-client/src/AudioClient.h index 9d10184d13..f9392c6a10 100644 --- a/libraries/audio-client/src/AudioClient.h +++ b/libraries/audio-client/src/AudioClient.h @@ -157,7 +157,7 @@ public slots: void setOutputBufferSize(int numFrames); - virtual bool outputLocalInjector(bool isStereo, qreal volume, AudioInjector* injector); + virtual bool outputLocalInjector(bool isStereo, AudioInjector* injector); bool switchInputToAudioDevice(const QString& inputDeviceName); bool switchOutputToAudioDevice(const QString& outputDeviceName); diff --git a/libraries/audio/src/AbstractAudioInterface.h b/libraries/audio/src/AbstractAudioInterface.h index a5855d75d1..4961e9b58c 100644 --- a/libraries/audio/src/AbstractAudioInterface.h +++ b/libraries/audio/src/AbstractAudioInterface.h @@ -26,7 +26,7 @@ public: AbstractAudioInterface(QObject* parent = 0) : QObject(parent) {}; public slots: - virtual bool outputLocalInjector(bool isStereo, qreal volume, AudioInjector* injector) = 0; + virtual bool outputLocalInjector(bool isStereo, AudioInjector* injector) = 0; virtual void enableAudioSourceInject(bool enable) = 0; virtual void selectAudioSourcePinkNoise() = 0; diff --git a/libraries/audio/src/AudioInjector.cpp b/libraries/audio/src/AudioInjector.cpp index 95db7e6d0b..26140b82c8 100644 --- a/libraries/audio/src/AudioInjector.cpp +++ b/libraries/audio/src/AudioInjector.cpp @@ -105,11 +105,12 @@ void AudioInjector::injectLocally() { _localBuffer->open(QIODevice::ReadOnly); _localBuffer->setShouldLoop(_options.loop); + _localBuffer->setVolume(_options.volume); // give our current send position to the local buffer _localBuffer->setCurrentOffset(_currentSendPosition); - success = _localAudioInterface->outputLocalInjector(_options.stereo, _options.volume, this); + success = _localAudioInterface->outputLocalInjector(_options.stereo, this); // if we're not looping and the buffer tells us it is empty then emit finished connect(_localBuffer, &AudioInjectorLocalBuffer::bufferEmpty, this, &AudioInjector::stop); diff --git a/libraries/audio/src/AudioInjectorLocalBuffer.cpp b/libraries/audio/src/AudioInjectorLocalBuffer.cpp index 1b2d44fe24..f40e613437 100644 --- a/libraries/audio/src/AudioInjectorLocalBuffer.cpp +++ b/libraries/audio/src/AudioInjectorLocalBuffer.cpp @@ -16,7 +16,8 @@ AudioInjectorLocalBuffer::AudioInjectorLocalBuffer(const QByteArray& rawAudioArr _rawAudioArray(rawAudioArray), _shouldLoop(false), _isStopped(false), - _currentOffset(0) + _currentOffset(0), + _volume(1.0f) { } @@ -35,6 +36,18 @@ bool AudioInjectorLocalBuffer::seek(qint64 pos) { } } +void copy(char* to, char* from, int size, qreal factor) { + int16_t* toArray = (int16_t*) to; + int16_t* fromArray = (int16_t*) from; + int sampleSize = size / sizeof(int16_t); + + for (int i = 0; i < sampleSize; i++) { + *toArray = factor * (*fromArray); + toArray++; + fromArray++; + } +} + qint64 AudioInjectorLocalBuffer::readData(char* data, qint64 maxSize) { if (!_isStopped) { @@ -47,7 +60,7 @@ qint64 AudioInjectorLocalBuffer::readData(char* data, qint64 maxSize) { bytesRead = bytesToEnd; } - memcpy(data, _rawAudioArray.data() + _currentOffset, bytesRead); + copy(data, _rawAudioArray.data() + _currentOffset, bytesRead, _volume); // now check if we are supposed to loop and if we can copy more from the beginning if (_shouldLoop && maxSize != bytesRead) { @@ -78,7 +91,7 @@ qint64 AudioInjectorLocalBuffer::recursiveReadFromFront(char* data, qint64 maxSi } // copy that amount - memcpy(data, _rawAudioArray.data(), bytesRead); + copy(data, _rawAudioArray.data(), bytesRead, _volume); // check if we need to call ourselves again and pull from the front again if (bytesRead < maxSize) { diff --git a/libraries/audio/src/AudioInjectorLocalBuffer.h b/libraries/audio/src/AudioInjectorLocalBuffer.h index ce41052730..9753cbbd83 100644 --- a/libraries/audio/src/AudioInjectorLocalBuffer.h +++ b/libraries/audio/src/AudioInjectorLocalBuffer.h @@ -14,6 +14,8 @@ #include +#include + class AudioInjectorLocalBuffer : public QIODevice { Q_OBJECT public: @@ -27,12 +29,13 @@ public: qint64 writeData(const char* data, qint64 maxSize) { return 0; } void setShouldLoop(bool shouldLoop) { _shouldLoop = shouldLoop; } - void setCurrentOffset(int currentOffset) { _currentOffset = currentOffset; } + void setVolume(float volume) { _volume = glm::clamp(volume, 0.0f, 1.0f); } + signals: void bufferEmpty(); -private: +private: qint64 recursiveReadFromFront(char* data, qint64 maxSize); QByteArray _rawAudioArray; @@ -40,6 +43,7 @@ private: bool _isStopped; int _currentOffset; + float _volume; }; #endif // hifi_AudioInjectorLocalBuffer_h \ No newline at end of file diff --git a/libraries/gpu/src/gpu/GLBackendOutput.cpp b/libraries/gpu/src/gpu/GLBackendOutput.cpp index 7b2deb64d2..b0dee550d9 100755 --- a/libraries/gpu/src/gpu/GLBackendOutput.cpp +++ b/libraries/gpu/src/gpu/GLBackendOutput.cpp @@ -83,7 +83,7 @@ GLBackend::GLFramebuffer* GLBackend::syncGPUObject(const Framebuffer& framebuffe glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, framebuffer.getWidth(), framebuffer.getHeight()); glBindRenderbuffer(GL_RENDERBUFFER, 0); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderBuffer); - CHECK_GL_ERROR(); + (void) CHECK_GL_ERROR(); } #endif diff --git a/libraries/octree/src/OctreeHeadlessViewer.h b/libraries/octree/src/OctreeHeadlessViewer.h index 9a6a5c7102..2adb33d3bf 100644 --- a/libraries/octree/src/OctreeHeadlessViewer.h +++ b/libraries/octree/src/OctreeHeadlessViewer.h @@ -34,7 +34,8 @@ public: virtual void init(); virtual void render(RenderArgs::RenderMode renderMode = RenderArgs::DEFAULT_RENDER_MODE, - RenderArgs::RenderSide renderSide = RenderArgs::MONO) { /* swallow these */ } + RenderArgs::RenderSide renderSide = RenderArgs::MONO, + RenderArgs::DebugFlags renderDebugFlags = RenderArgs::RENDER_DEBUG_NONE) { /* swallow these */ } void setJurisdictionListener(JurisdictionListener* jurisdictionListener) { _jurisdictionListener = jurisdictionListener; } diff --git a/libraries/physics/src/ObjectMotionState.cpp b/libraries/physics/src/ObjectMotionState.cpp index d8eb86f0b4..350556b3a8 100644 --- a/libraries/physics/src/ObjectMotionState.cpp +++ b/libraries/physics/src/ObjectMotionState.cpp @@ -17,11 +17,6 @@ #include "PhysicsHelpers.h" #include "PhysicsLogging.h" -const float DEFAULT_FRICTION = 0.5f; -const float MAX_FRICTION = 10.0f; - -const float DEFAULT_RESTITUTION = 0.5f; - // origin of physics simulation in world-frame glm::vec3 _worldOffset(0.0f); diff --git a/libraries/render-utils/src/FboCache.cpp b/libraries/render-utils/src/FboCache.cpp index 2ca3d47bdf..de2b483573 100644 --- a/libraries/render-utils/src/FboCache.cpp +++ b/libraries/render-utils/src/FboCache.cpp @@ -24,7 +24,7 @@ void FboCache::lockTexture(int texture) { withLock(_lock, [&] { Q_ASSERT(_fboMap.count(texture)); if (!_fboLocks.count(texture)) { - Q_ASSERT(_readyFboQueue.front()->texture() == texture); + Q_ASSERT(_readyFboQueue.front()->texture() == (GLuint)texture); _readyFboQueue.pop_front(); _fboLocks[texture] = 1; } else { diff --git a/libraries/ui/src/VrMenu.cpp b/libraries/ui/src/VrMenu.cpp index 5c0f8fb732..b6cb0b136b 100644 --- a/libraries/ui/src/VrMenu.cpp +++ b/libraries/ui/src/VrMenu.cpp @@ -102,9 +102,12 @@ class QQuickMenuItem; QObject* addItem(QObject* parent, const QString& text) { // FIXME add more checking here to ensure no name conflicts QQuickMenuItem* returnedValue{ nullptr }; - bool invokeResult = QMetaObject::invokeMethod(parent, "addItem", Qt::DirectConnection, - Q_RETURN_ARG(QQuickMenuItem*, returnedValue), - Q_ARG(QString, text)); + #ifndef QT_NO_DEBUG + bool invokeResult = + #endif + QMetaObject::invokeMethod(parent, "addItem", Qt::DirectConnection, Q_RETURN_ARG(QQuickMenuItem*, returnedValue), + Q_ARG(QString, text)); + Q_ASSERT(invokeResult); QObject* result = reinterpret_cast(returnedValue); return result; @@ -203,9 +206,11 @@ void VrMenu::insertAction(QAction* before, QAction* action) { result = ::addItem(menu, action->text()); } else { QQuickMenuItem* returnedValue{ nullptr }; - bool invokeResult = QMetaObject::invokeMethod(menu, "insertItem", Qt::DirectConnection, - Q_RETURN_ARG(QQuickMenuItem*, returnedValue), - Q_ARG(int, index), Q_ARG(QString, action->text())); + #ifndef QT_NO_DEBUG + bool invokeResult = + #endif + QMetaObject::invokeMethod(menu, "insertItem", Qt::DirectConnection, Q_RETURN_ARG(QQuickMenuItem*, returnedValue), + Q_ARG(int, index), Q_ARG(QString, action->text())); Q_ASSERT(invokeResult); result = reinterpret_cast(returnedValue); } diff --git a/tools/vhacd-util/src/VHACDUtilApp.cpp b/tools/vhacd-util/src/VHACDUtilApp.cpp index 242e69c363..46e1898979 100644 --- a/tools/vhacd-util/src/VHACDUtilApp.cpp +++ b/tools/vhacd-util/src/VHACDUtilApp.cpp @@ -315,7 +315,7 @@ VHACDUtilApp::VHACDUtilApp(int argc, char* argv[]) : if (splitModel) { QVector infileExtensions = {"fbx", "obj"}; - QString baseFileName = fileNameWithoutExtension(inputFilename, infileExtensions); + QString baseFileName = fileNameWithoutExtension(outputFilename, infileExtensions); int count = 0; foreach (const FBXMesh& mesh, fbx.meshes) { foreach (const FBXMeshPart &meshPart, mesh.parts) {