From 8ee56b59c956085b6f8f88da3a80cc8c0afaed03 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 11 Sep 2015 22:33:14 +0200 Subject: [PATCH 1/6] Update AssetServer stats with units Also removed array for better layout --- assignment-client/src/assets/AssetServer.cpp | 64 ++++++----- assignment-client/src/octree/OctreeServer.cpp | 104 ++++++++---------- 2 files changed, 84 insertions(+), 84 deletions(-) diff --git a/assignment-client/src/assets/AssetServer.cpp b/assignment-client/src/assets/AssetServer.cpp index 138adb4716..a8497953b9 100644 --- a/assignment-client/src/assets/AssetServer.cpp +++ b/assignment-client/src/assets/AssetServer.cpp @@ -173,36 +173,46 @@ void AssetServer::sendStatsPacket() { auto endTimeMs = std::chrono::duration_cast(stat.second.endTime); QDateTime date = QDateTime::fromMSecsSinceEpoch(endTimeMs.count()); + constexpr static const float USEC_PER_SEC = 1000000.0f; + constexpr static const float MEGABITS_PER_BYTE = 8.0f / 1000000.0f; // Bytes => Mbits + float elapsed = (float)(stat.second.endTime - stat.second.startTime).count() / USEC_PER_SEC; // sec + float megabitsPerSecPerByte = MEGABITS_PER_BYTE / elapsed; // Bytes => Mb/s + QJsonObject connectionStats; - connectionStats["lastHeard"] = date.toString(); - connectionStats["estimatedBandwith"] = stat.second.estimatedBandwith; - connectionStats["rtt"] = stat.second.rtt; - connectionStats["congestionWindowSize"] = stat.second.congestionWindowSize; - connectionStats["packetSendPeriod"] = stat.second.packetSendPeriod; - nodeStats["connection"] = connectionStats; + connectionStats["1. Last Heard"] = date.toString(); + connectionStats["2. Est. Max (P/s)"] = stat.second.estimatedBandwith; + connectionStats["3. RTT (ms)"] = stat.second.rtt; + connectionStats["4. CW (P)"] = stat.second.congestionWindowSize; + connectionStats["5. Period (us)"] = stat.second.packetSendPeriod; + connectionStats["6. Up (Mb/s)"] = stat.second.sentBytes * megabitsPerSecPerByte; + connectionStats["7. Down (Mb/s)"] = stat.second.receivedBytes * megabitsPerSecPerByte; + nodeStats["Connection Stats"] = connectionStats; - QJsonObject sendingStats; - sendingStats["sendRate"] = stat.second.sendRate; - sendingStats["sentPackets"] = stat.second.sentPackets; - sendingStats["receivedACK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedACK]; - sendingStats["processedACK"] = stat.second.events[udt::ConnectionStats::Stats::ProcessedACK]; - sendingStats["receivedLightACK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedLightACK]; - sendingStats["receivedNAK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedNAK]; - sendingStats["receivedTimeoutNAK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedTimeoutNAK]; - sendingStats["sentACK2"] = stat.second.events[udt::ConnectionStats::Stats::SentACK2]; - sendingStats["retransmission"] = stat.second.events[udt::ConnectionStats::Stats::Retransmission]; - nodeStats["sending"] = sendingStats; + using Events = udt::ConnectionStats::Stats::Event; + const auto& events = stat.second.events; - QJsonObject receivingStats; - receivingStats["receiveRate"] = stat.second.receiveRate; - receivingStats["receivedPackets"] = stat.second.receivedPackets; - receivingStats["SentACK"] = stat.second.events[udt::ConnectionStats::Stats::SentACK]; - receivingStats["SentLightACK"] = stat.second.events[udt::ConnectionStats::Stats::SentLightACK]; - receivingStats["SentNAK"] = stat.second.events[udt::ConnectionStats::Stats::SentNAK]; - receivingStats["SentTimeoutNAK"] = stat.second.events[udt::ConnectionStats::Stats::SentTimeoutNAK]; - receivingStats["ReceivedACK2"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedACK2]; - receivingStats["Duplicate"] = stat.second.events[udt::ConnectionStats::Stats::Duplicate]; - nodeStats["receiving"] = receivingStats; + QJsonObject upstreamStats; + upstreamStats["1. Sent (P/s)"] = stat.second.sendRate; + upstreamStats["2. Sent Packets"] = stat.second.sentPackets; + upstreamStats["3. Recvd ACK"] = events[Events::ReceivedACK]; + upstreamStats["4. Procd ACK"] = events[Events::ProcessedACK]; + upstreamStats["5. Recvd LACK"] = events[Events::ReceivedLightACK]; + upstreamStats["6. Recvd NAK"] = events[Events::ReceivedNAK]; + upstreamStats["7. Recvd TNAK"] = events[Events::ReceivedTimeoutNAK]; + upstreamStats["8. Sent ACK2"] = events[Events::SentACK2]; + upstreamStats["9. Retransmitted"] = events[Events::Retransmission]; + nodeStats["Upstream Stats"] = upstreamStats; + + QJsonObject downstreamStats; + downstreamStats["1. Recvd (P/s)"] = stat.second.receiveRate; + downstreamStats["2. Recvd Packets"] = stat.second.receivedPackets; + downstreamStats["3. Sent ACK"] = events[Events::SentACK]; + downstreamStats["4. Sent LACK"] = events[Events::SentLightACK]; + downstreamStats["5. Sent NAK"] = events[Events::SentNAK]; + downstreamStats["6. Sent TNAK"] = events[Events::SentTimeoutNAK]; + downstreamStats["7. Recvd ACK2"] = events[Events::ReceivedACK2]; + downstreamStats["8. Duplicates"] = events[Events::Duplicate]; + nodeStats["Downstream Stats"] = downstreamStats; QString uuid; auto nodelist = DependencyManager::get(); diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index e0d0f9eeac..86f9d53aa8 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -9,11 +9,10 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include -#include +#include "OctreeServer.h" + #include #include -#include #include @@ -26,7 +25,6 @@ #include "../AssignmentClient.h" -#include "OctreeServer.h" #include "OctreeServerConsts.h" OctreeServer* OctreeServer::_instance = NULL; @@ -1294,80 +1292,72 @@ QString OctreeServer::getStatusLink() { void OctreeServer::sendStatsPacket() { // Stats Array 1 - QJsonArray threadsStats; + QJsonObject threadsStats; quint64 oneSecondAgo = usecTimestampNow() - USECS_PER_SECOND; - threadsStats.push_back(QJsonObject({{"processing", (double)howManyThreadsDidProcess(oneSecondAgo)}})); - threadsStats.push_back(QJsonObject({{"packetDistributor", (double)howManyThreadsDidPacketDistributor(oneSecondAgo)}})); - threadsStats.push_back(QJsonObject({{"handlePacektSend", (double)howManyThreadsDidHandlePacketSend(oneSecondAgo)}})); - threadsStats.push_back(QJsonObject({{"writeDatagram", (double)howManyThreadsDidCallWriteDatagram(oneSecondAgo)}})); + threadsStats["1. processing"] = (double)howManyThreadsDidProcess(oneSecondAgo); + threadsStats["2. packetDistributor"] = (double)howManyThreadsDidPacketDistributor(oneSecondAgo); + threadsStats["3. handlePacektSend"] = (double)howManyThreadsDidHandlePacketSend(oneSecondAgo); + threadsStats["4. writeDatagram"] = (double)howManyThreadsDidCallWriteDatagram(oneSecondAgo); - QJsonArray statsArray1; - statsArray1.push_back(QJsonObject({{"configuration", getConfiguration()}})); - statsArray1.push_back(QJsonObject({{"detailed_stats_url", getStatusLink()}})); - statsArray1.push_back(QJsonObject({{"uptime", getUptime()}})); - statsArray1.push_back(QJsonObject({{"persistFileLoadTime", getFileLoadTime()}})); - statsArray1.push_back(QJsonObject({{"clients", getCurrentClientCount()}})); - statsArray1.push_back(QJsonObject({{"threads", threadsStats}})); + QJsonObject statsArray1; + statsArray1["1. configuration"] = getConfiguration(); + statsArray1["2. detailed_stats_url"] = getStatusLink(); + statsArray1["3. uptime"] = getUptime(); + statsArray1["4. persistFileLoadTime"] = getFileLoadTime(); + statsArray1["5. clients"] = getCurrentClientCount(); + statsArray1["6. threads"] = threadsStats; // Octree Stats - QJsonArray octreeStats; - octreeStats.push_back(QJsonObject({{"elementCount", (double)OctreeElement::getNodeCount()}})); - octreeStats.push_back(QJsonObject({{"internalElementCount", (double)OctreeElement::getInternalNodeCount()}})); - octreeStats.push_back(QJsonObject({{"leafElementCount", (double)OctreeElement::getLeafNodeCount()}})); + QJsonObject octreeStats; + octreeStats["1. elementCount"] = (double)OctreeElement::getNodeCount(); + octreeStats["2. internalElementCount"] = (double)OctreeElement::getInternalNodeCount(); + octreeStats["3. leafElementCount"] = (double)OctreeElement::getLeafNodeCount(); // Stats Object 2 QJsonObject dataObject1; - dataObject1["totalPackets"] = (double)OctreeSendThread::_totalPackets; - dataObject1["totalBytes"] = (double)OctreeSendThread::_totalBytes; - dataObject1["totalBytesWasted"] = (double)OctreeSendThread::_totalWastedBytes; - dataObject1["totalBytesOctalCodes"] = (double)OctreePacketData::getTotalBytesOfOctalCodes(); - dataObject1["totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfBitMasks(); - dataObject1["totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfColor(); + dataObject1["1. totalPackets"] = (double)OctreeSendThread::_totalPackets; + dataObject1["2. totalBytes"] = (double)OctreeSendThread::_totalBytes; + dataObject1["3. totalBytesWasted"] = (double)OctreeSendThread::_totalWastedBytes; + dataObject1["4. totalBytesOctalCodes"] = (double)OctreePacketData::getTotalBytesOfOctalCodes(); + dataObject1["5. totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfBitMasks(); + dataObject1["6. totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfColor(); - QJsonArray timingArray1; - timingArray1.push_back(QJsonObject({{"avgLoopTime", getAverageLoopTime()}})); - timingArray1.push_back(QJsonObject({{"avgInsideTime", getAverageInsideTime()}})); - timingArray1.push_back(QJsonObject({{"avgTreeLockTime", getAverageTreeWaitTime()}})); - timingArray1.push_back(QJsonObject({{"avgEncodeTime", getAverageEncodeTime()}})); - timingArray1.push_back(QJsonObject({{"avgCompressAndWriteTime", getAverageCompressAndWriteTime()}})); - timingArray1.push_back(QJsonObject({{"avgSendTime", getAveragePacketSendingTime()}})); - timingArray1.push_back(QJsonObject({{"nodeWaitTime", getAverageNodeWaitTime()}})); + QJsonObject timingArray1; + timingArray1["1. avgLoopTime"] = getAverageLoopTime(); + timingArray1["2. avgInsideTime"] = getAverageInsideTime(); + timingArray1["3. avgTreeLockTime"] = getAverageTreeWaitTime(); + timingArray1["4. avgEncodeTime"] = getAverageEncodeTime(); + timingArray1["5. avgCompressAndWriteTime"] = getAverageCompressAndWriteTime(); + timingArray1["6. avgSendTime"] = getAveragePacketSendingTime(); + timingArray1["7. nodeWaitTime"] = getAverageNodeWaitTime(); QJsonObject statsObject2; statsObject2["data"] = dataObject1; statsObject2["timing"] = timingArray1; // Stats Object 3 - QJsonArray dataArray2; - dataArray2.push_back(QJsonObject({{"packetQueue", - (double)_octreeInboundPacketProcessor->packetsToProcessCount()}})); - dataArray2.push_back(QJsonObject({{"totalPackets", - (double)_octreeInboundPacketProcessor->getTotalPacketsProcessed()}})); - dataArray2.push_back(QJsonObject({{"totalElements", - (double)_octreeInboundPacketProcessor->getTotalElementsProcessed()}})); + QJsonObject dataArray2; + dataArray2["1. packetQueue"] = (double)_octreeInboundPacketProcessor->packetsToProcessCount(); + dataArray2["2. totalPackets"] = (double)_octreeInboundPacketProcessor->getTotalPacketsProcessed(); + dataArray2["3. totalElements"] = (double)_octreeInboundPacketProcessor->getTotalElementsProcessed(); - QJsonArray timingArray2; - timingArray2.push_back(QJsonObject({{"avgTransitTimePerPacket", - (double)_octreeInboundPacketProcessor->getAverageTransitTimePerPacket()}})); - timingArray2.push_back(QJsonObject({{"avgProcessTimePerPacket", - (double)_octreeInboundPacketProcessor->getAverageProcessTimePerPacket()}})); - timingArray2.push_back(QJsonObject({{"avgLockWaitTimePerPacket", - (double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerPacket()}})); - timingArray2.push_back(QJsonObject({{"avgProcessTimePerElement", - (double)_octreeInboundPacketProcessor->getAverageProcessTimePerElement()}})); - timingArray2.push_back(QJsonObject({{"avgLockWaitTimePerElement", - (double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerElement()}})); + QJsonObject timingArray2; + timingArray2["1. avgTransitTimePerPacket"] = (double)_octreeInboundPacketProcessor->getAverageTransitTimePerPacket(); + timingArray2["2. avgProcessTimePerPacket"] = (double)_octreeInboundPacketProcessor->getAverageProcessTimePerPacket(); + timingArray2["3. avgLockWaitTimePerPacket"] = (double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerPacket(); + timingArray2["4. avgProcessTimePerElement"] = (double)_octreeInboundPacketProcessor->getAverageProcessTimePerElement(); + timingArray2["5. avgLockWaitTimePerElement"] = (double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerElement(); QJsonObject statsObject3; statsObject3["data"] = dataArray2; statsObject3["timing"] = timingArray2; // Merge everything - QJsonArray jsonArray; - jsonArray.push_back(statsArray1); - jsonArray.push_back(QJsonObject({{"octree", octreeStats}})); - jsonArray.push_back(QJsonObject({{"outbound", statsObject2}})); - jsonArray.push_back(QJsonObject({{"inbound", statsObject3}})); + QJsonObject jsonArray; + jsonArray["1. misc"] = statsArray1; + jsonArray["2. octree"] = octreeStats; + jsonArray["3. outbound"] = statsObject2; + jsonArray["4. inbound"] = statsObject3; QJsonObject statsObject; statsObject[QString(getMyServerName()) + "Server"] = jsonArray; From 49ee25123860991baad68cf7ed694a76eefcf5ea Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Sat, 12 Sep 2015 09:59:25 -0700 Subject: [PATCH 2/6] quiet compiler --- interface/src/Application.cpp | 2 +- interface/src/FileLogger.cpp | 2 +- .../display-plugins/OpenGLDisplayPlugin.cpp | 1 - .../oculus/OculusDisplayPlugin.cpp | 12 +++++ .../oculus/OculusLegacyDisplayPlugin.cpp | 5 +- libraries/entities/src/EntityTreeElement.cpp | 2 +- .../entities/src/ParticleEffectEntityItem.cpp | 28 ---------- .../entities/src/ParticleEffectEntityItem.h | 54 +++++++++---------- libraries/fbx/src/FBXReader.cpp | 2 + libraries/networking/src/HifiSockAddr.cpp | 1 + libraries/render-utils/src/AnimDebugDraw.cpp | 4 +- .../render-utils/src/AntialiasingEffect.cpp | 22 ++++---- libraries/render-utils/src/GlWindow.cpp | 5 +- libraries/render-utils/src/Model.cpp | 2 + libraries/script-engine/src/ScriptEngine.cpp | 2 +- libraries/script-engine/src/ScriptEngine.h | 2 +- libraries/ui/src/VrMenu.cpp | 17 ++++-- tests/entities/src/main.cpp | 5 +- tests/gpu-test/src/main.cpp | 1 - tests/render-utils/src/main.cpp | 1 - 20 files changed, 86 insertions(+), 84 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 732dc78493..164f04f2eb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5070,7 +5070,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index) glm::vec3 direction = glm::inverse(_myAvatar->getOrientation()) * palm->getFingerDirection(); // Get the angles, scaled between (-0.5,0.5) - float xAngle = (atan2(direction.z, direction.x) + M_PI_2); + float xAngle = (atan2f(direction.z, direction.x) + (float)M_PI_2); float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)M_PI_2)); auto canvasSize = qApp->getCanvasSize(); // Get the pixel range over which the xAngle and yAngle are scaled diff --git a/interface/src/FileLogger.cpp b/interface/src/FileLogger.cpp index 0b2128cf17..013ea2d1be 100644 --- a/interface/src/FileLogger.cpp +++ b/interface/src/FileLogger.cpp @@ -53,7 +53,7 @@ public: protected: void rollFileIfNecessary(QFile& file) { uint64_t now = usecTimestampNow(); - if ((file.size() > MAX_LOG_SIZE) || (now - _lastRollTime) > MAX_LOG_AGE_USECS) { + if ((file.size() > (qint64)MAX_LOG_SIZE) || (now - _lastRollTime) > MAX_LOG_AGE_USECS) { QString newFileName = getLogRollerFilename(); if (file.copy(newFileName)) { _lastRollTime = now; diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp index cfe101e1ab..505dae824a 100644 --- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp @@ -6,7 +6,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "OpenGLDisplayPlugin.h" - #include #include diff --git a/libraries/display-plugins/src/display-plugins/oculus/OculusDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/oculus/OculusDisplayPlugin.cpp index c8d9993e5a..2f4a9c93cf 100644 --- a/libraries/display-plugins/src/display-plugins/oculus/OculusDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/oculus/OculusDisplayPlugin.cpp @@ -21,8 +21,20 @@ #include #include #include + + +#if defined(__GNUC__) && !defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdouble-promotion" +#endif + #include +#if defined(__GNUC__) && !defined(__clang__) + #pragma GCC diagnostic pop +#endif + + #include #include #include diff --git a/libraries/display-plugins/src/display-plugins/oculus/OculusLegacyDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/oculus/OculusLegacyDisplayPlugin.cpp index 05072e0210..ade34afcae 100644 --- a/libraries/display-plugins/src/display-plugins/oculus/OculusLegacyDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/oculus/OculusLegacyDisplayPlugin.cpp @@ -184,7 +184,10 @@ void OculusLegacyDisplayPlugin::activate() { } }); - ovrBool result = ovrHmd_ConfigureRendering(_hmd, &config.Config, distortionCaps, _eyeFovs, _eyeRenderDescs); + #ifndef QT_NO_DEBUG + ovrBool result = + #endif + ovrHmd_ConfigureRendering(_hmd, &config.Config, distortionCaps, _eyeFovs, _eyeRenderDescs); Q_ASSERT(result); #endif } diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 68754bbb30..ca24199497 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -18,7 +18,7 @@ #include "EntitiesLogging.h" #include "EntityTreeElement.h" -EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement(), _entityItems(NULL) { +EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement() { init(octalCode); }; diff --git a/libraries/entities/src/ParticleEffectEntityItem.cpp b/libraries/entities/src/ParticleEffectEntityItem.cpp index 3777dd14a9..b1229b8bb6 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.cpp +++ b/libraries/entities/src/ParticleEffectEntityItem.cpp @@ -73,34 +73,9 @@ EntityItemPointer ParticleEffectEntityItem::factory(const EntityItemID& entityID // our non-pure virtual subclass for now... ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : EntityItem(entityItemID), - _maxParticles(DEFAULT_MAX_PARTICLES), - _lifespan(DEFAULT_LIFESPAN), - _emitRate(DEFAULT_EMIT_RATE), - _emitVelocity(DEFAULT_EMIT_VELOCITY), - _velocitySpread(DEFAULT_VELOCITY_SPREAD), - _emitAcceleration(DEFAULT_EMIT_ACCELERATION), - _accelerationSpread(DEFAULT_ACCELERATION_SPREAD), - _particleRadius(DEFAULT_PARTICLE_RADIUS), - _radiusSpread(DEFAULT_RADIUS_SPREAD), - _radiusStart(DEFAULT_RADIUS_START), - _radiusFinish(DEFAULT_RADIUS_FINISH), _lastAnimated(usecTimestampNow()), _animationLoop(), _animationSettings(), - _textures(DEFAULT_TEXTURES), - _texturesChangedFlag(false), - _shapeType(SHAPE_TYPE_NONE), - _colorSpread(DEFAULT_COLOR_SPREAD), - _colorStart(DEFAULT_COLOR), - _colorFinish(DEFAULT_COLOR), - _isColorStartInitialized(false), - _isColorFinishInitialized(false), - _alpha(DEFAULT_ALPHA), - _alphaSpread(DEFAULT_ALPHA_SPREAD), - _alphaStart(DEFAULT_ALPHA_START), - _alphaFinish(DEFAULT_ALPHA_FINISH), - _isAlphaStartInitialized(false), - _isAlphaFinishInitialized(false), _particleLifetimes(DEFAULT_MAX_PARTICLES, 0.0f), _particlePositions(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)), _particleVelocities(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)), @@ -117,9 +92,6 @@ ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityIte _alphaStarts(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA), _alphaMiddles(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA), _alphaFinishes(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA), - _timeUntilNextEmit(0.0f), - _particleHeadIndex(0), - _particleTailIndex(0), _particleMaxBound(glm::vec3(1.0f, 1.0f, 1.0f)), _particleMinBound(glm::vec3(-1.0f, -1.0f, -1.0f)) { diff --git a/libraries/entities/src/ParticleEffectEntityItem.h b/libraries/entities/src/ParticleEffectEntityItem.h index 23e8b3bf8b..802ff25af3 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.h +++ b/libraries/entities/src/ParticleEffectEntityItem.h @@ -56,11 +56,11 @@ public: _color[BLUE_INDEX] = value.blue; } - bool _isColorStartInitialized; + bool _isColorStartInitialized = false; void setColorStart(const xColor& colorStart) { _colorStart = colorStart; _isColorStartInitialized = true; } xColor getColorStart() const { return _isColorStartInitialized ? _colorStart : getXColor(); } - bool _isColorFinishInitialized; + bool _isColorFinishInitialized = false; void setColorFinish(const xColor& colorFinish) { _colorFinish = colorFinish; _isColorFinishInitialized = true; } xColor getColorFinish() const { return _isColorFinishInitialized ? _colorFinish : getXColor(); } @@ -73,12 +73,12 @@ public: float getAlpha() const { return _alpha; } static const float DEFAULT_ALPHA_START; - bool _isAlphaStartInitialized; + bool _isAlphaStartInitialized = false; void setAlphaStart(float alphaStart) { _alphaStart = alphaStart; _isAlphaStartInitialized = true; } float getAlphaStart() const { return _isAlphaStartInitialized ? _alphaStart : _alpha; } static const float DEFAULT_ALPHA_FINISH; - bool _isAlphaFinishInitialized; + bool _isAlphaFinishInitialized = false; void setAlphaFinish(float alphaFinish) { _alphaFinish = alphaFinish; _isAlphaFinishInitialized = true; } float getAlphaFinish() const { return _isAlphaFinishInitialized ? _alphaFinish : _alpha; } @@ -192,29 +192,29 @@ protected: // the properties of this entity rgbColor _color; - xColor _colorStart; - xColor _colorFinish; - xColor _colorSpread; - float _alpha; - float _alphaStart; - float _alphaFinish; - float _alphaSpread; - quint32 _maxParticles; - float _lifespan; - float _emitRate; - glm::vec3 _emitVelocity; - glm::vec3 _velocitySpread; - glm::vec3 _emitAcceleration; - glm::vec3 _accelerationSpread; - float _particleRadius; - float _radiusStart; - float _radiusFinish; - float _radiusSpread; + xColor _colorStart = DEFAULT_COLOR; + xColor _colorFinish = DEFAULT_COLOR; + xColor _colorSpread = DEFAULT_COLOR_SPREAD; + float _alpha = DEFAULT_ALPHA; + float _alphaStart = DEFAULT_ALPHA_START; + float _alphaFinish = DEFAULT_ALPHA_FINISH; + float _alphaSpread = DEFAULT_ALPHA_SPREAD; + quint32 _maxParticles = DEFAULT_MAX_PARTICLES; + float _lifespan = DEFAULT_LIFESPAN; + float _emitRate = DEFAULT_EMIT_RATE; + glm::vec3 _emitVelocity = DEFAULT_EMIT_VELOCITY; + glm::vec3 _velocitySpread = DEFAULT_VELOCITY_SPREAD; + glm::vec3 _emitAcceleration = DEFAULT_EMIT_ACCELERATION; + glm::vec3 _accelerationSpread = DEFAULT_ACCELERATION_SPREAD; + float _particleRadius = DEFAULT_PARTICLE_RADIUS; + float _radiusStart = DEFAULT_RADIUS_START; + float _radiusFinish = DEFAULT_RADIUS_FINISH; + float _radiusSpread = DEFAULT_RADIUS_SPREAD; quint64 _lastAnimated; AnimationLoop _animationLoop; QString _animationSettings; - QString _textures; - bool _texturesChangedFlag; + QString _textures = DEFAULT_TEXTURES; + bool _texturesChangedFlag = false; ShapeType _shapeType = SHAPE_TYPE_NONE; // all the internals of running the particle sim @@ -235,12 +235,12 @@ protected: QVector _alphaMiddles; QVector _alphaFinishes; - float _timeUntilNextEmit; + float _timeUntilNextEmit = 0.0f; // particle arrays are a ring buffer, use these indices // to keep track of the living particles. - quint32 _particleHeadIndex; - quint32 _particleTailIndex; + quint32 _particleHeadIndex = 0; + quint32 _particleTailIndex = 0; // bounding volume glm::vec3 _particleMaxBound; diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 5410859340..6f69e8befc 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -1129,6 +1129,8 @@ ExtractedMesh extractMesh(const FBXNode& object, unsigned int& meshIndex) { if (isMaterialPerPolygon) { isMultiMaterial = true; } + // TODO: make excellent use of isMultiMaterial + Q_UNUSED(isMultiMaterial); // convert the polygons to quads and triangles int polygonIndex = 0; diff --git a/libraries/networking/src/HifiSockAddr.cpp b/libraries/networking/src/HifiSockAddr.cpp index 813d19d22c..7774cdd93c 100644 --- a/libraries/networking/src/HifiSockAddr.cpp +++ b/libraries/networking/src/HifiSockAddr.cpp @@ -33,6 +33,7 @@ HifiSockAddr::HifiSockAddr(const QHostAddress& address, quint16 port) : } HifiSockAddr::HifiSockAddr(const HifiSockAddr& otherSockAddr) : + QObject(), _address(otherSockAddr._address), _port(otherSockAddr._port) { diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp index d057bf067f..1e6428b50f 100644 --- a/libraries/render-utils/src/AnimDebugDraw.cpp +++ b/libraries/render-utils/src/AnimDebugDraw.cpp @@ -202,8 +202,8 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius glm::vec3 zRing[NUM_CIRCLE_SLICES + 1]; const float dTheta = (2.0f * (float)M_PI) / NUM_CIRCLE_SLICES; for (int i = 0; i < NUM_CIRCLE_SLICES + 1; i++) { - float rCosTheta = radius * cos(dTheta * i); - float rSinTheta = radius * sin(dTheta * i); + float rCosTheta = radius * cosf(dTheta * i); + float rSinTheta = radius * sinf(dTheta * i); xRing[i] = finalPose * glm::vec3(0.0f, rCosTheta, rSinTheta); yRing[i] = finalPose * glm::vec3(rCosTheta, 0.0f, rSinTheta); zRing[i] = finalPose * glm::vec3(rCosTheta, rSinTheta, 0.0f); diff --git a/libraries/render-utils/src/AntialiasingEffect.cpp b/libraries/render-utils/src/AntialiasingEffect.cpp index 0e362bfb49..f337f9b79b 100644 --- a/libraries/render-utils/src/AntialiasingEffect.cpp +++ b/libraries/render-utils/src/AntialiasingEffect.cpp @@ -110,10 +110,10 @@ void Antialiasing::run(const render::SceneContextPointer& sceneContext, const re QSize framebufferSize = framebufferCache->getFrameBufferSize(); float fbWidth = framebufferSize.width(); float fbHeight = framebufferSize.height(); - float sMin = args->_viewport.x / fbWidth; - float sWidth = args->_viewport.z / fbWidth; - float tMin = args->_viewport.y / fbHeight; - float tHeight = args->_viewport.w / fbHeight; + // float sMin = args->_viewport.x / fbWidth; + // float sWidth = args->_viewport.z / fbWidth; + // float tMin = args->_viewport.y / fbHeight; + // float tHeight = args->_viewport.w / fbHeight; glm::mat4 projMat; Transform viewMat; @@ -136,14 +136,14 @@ void Antialiasing::run(const render::SceneContextPointer& sceneContext, const re args->_viewFrustum->computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); - float depthScale = (farVal - nearVal) / farVal; - float nearScale = -1.0f / nearVal; - float depthTexCoordScaleS = (right - left) * nearScale / sWidth; - float depthTexCoordScaleT = (top - bottom) * nearScale / tHeight; - float depthTexCoordOffsetS = left * nearScale - sMin * depthTexCoordScaleS; - float depthTexCoordOffsetT = bottom * nearScale - tMin * depthTexCoordScaleT; + // float depthScale = (farVal - nearVal) / farVal; + // float nearScale = -1.0f / nearVal; + // float depthTexCoordScaleS = (right - left) * nearScale / sWidth; + // float depthTexCoordScaleT = (top - bottom) * nearScale / tHeight; + // float depthTexCoordOffsetS = left * nearScale - sMin * depthTexCoordScaleS; + // float depthTexCoordOffsetT = bottom * nearScale - tMin * depthTexCoordScaleT; - batch._glUniform2f(_texcoordOffsetLoc, 1.0 / fbWidth, 1.0 / fbHeight); + batch._glUniform2f(_texcoordOffsetLoc, 1.0f / fbWidth, 1.0f / fbHeight); glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f); glm::vec2 bottomLeft(-1.0f, -1.0f); diff --git a/libraries/render-utils/src/GlWindow.cpp b/libraries/render-utils/src/GlWindow.cpp index b71d0c9001..78ac046b59 100644 --- a/libraries/render-utils/src/GlWindow.cpp +++ b/libraries/render-utils/src/GlWindow.cpp @@ -43,7 +43,10 @@ bool GlWindow::makeCurrent() { qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER)); }); - QOpenGLContext * currentContext = QOpenGLContext::currentContext(); + #ifndef QT_NO_DEBUG + QOpenGLContext * currentContext = + #endif + QOpenGLContext::currentContext(); Q_ASSERT(_context == currentContext); return makeCurrentResult; } diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index fb26286f6a..4c9279c8fd 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1745,6 +1745,8 @@ void Model::segregateMeshGroups() { if (wireframe) { translucentMesh = hasTangents = hasSpecular = hasLightmap = isSkinned = false; } + // TODO: make excellent use of translucentMesh + Q_UNUSED(translucentMesh); // Create the render payloads int totalParts = mesh.parts.size(); diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index e401398d24..a9ada42543 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -94,8 +94,8 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam _isListeningToAudioStream(false), _avatarSound(NULL), _numAvatarSoundSentBytes(0), - _controllerScriptingInterface(controllerScriptingInterface), _wantSignals(wantSignals), + _controllerScriptingInterface(controllerScriptingInterface), _avatarData(NULL), _scriptName(), _fileNameString(fileNameString), diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index b9156c718e..4608732571 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -156,7 +156,7 @@ protected: bool _isAgent = false; QSet _includedURLs; bool _wantSignals = true; - + private: void stopAllTimers(); void sendAvatarIdentityPacket(); diff --git a/libraries/ui/src/VrMenu.cpp b/libraries/ui/src/VrMenu.cpp index 1ede74fc86..a2cc7f0214 100644 --- a/libraries/ui/src/VrMenu.cpp +++ b/libraries/ui/src/VrMenu.cpp @@ -108,7 +108,10 @@ void VrMenu::addMenu(QMenu* menu) { Q_ASSERT(false); } QVariant returnedValue; - bool invokeResult = QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection, + #ifndef QT_NO_DEBUG + bool invokeResult = + #endif + QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection, Q_RETURN_ARG(QVariant, returnedValue), Q_ARG(QVariant, QVariant::fromValue(qmlParent)), Q_ARG(QVariant, QVariant::fromValue(menu->title()))); @@ -146,8 +149,11 @@ void VrMenu::addAction(QMenu* menu, QAction* action) { MenuUserData* userData = MenuUserData::forObject(menu); QObject* menuQml = findMenuObject(userData->uuid.toString()); Q_ASSERT(menuQml); - QVariant returnedValue; - bool invokeResult = QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection, + QVariant returnedValue; + #ifndef QT_NO_DEBUG + bool invokeResult = + #endif + QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection, Q_RETURN_ARG(QVariant, returnedValue), Q_ARG(QVariant, QVariant::fromValue(menuQml)), Q_ARG(QVariant, QVariant::fromValue(action->text()))); @@ -167,7 +173,10 @@ void VrMenu::insertAction(QAction* before, QAction* action) { } QObject* menu = beforeQml->parent(); QVariant returnedValue; - bool invokeResult = QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection, + #ifndef QT_NO_DEBUG + bool invokeResult = + #endif + QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection, Q_RETURN_ARG(QVariant, returnedValue), Q_ARG(QVariant, QVariant::fromValue(menu)), Q_ARG(QVariant, QVariant::fromValue(beforeQml)), diff --git a/tests/entities/src/main.cpp b/tests/entities/src/main.cpp index 807a57cdb8..8eac7e931f 100644 --- a/tests/entities/src/main.cpp +++ b/tests/entities/src/main.cpp @@ -93,8 +93,9 @@ template void testByteCountCoded() { testByteCountCodedStable(0); testByteCountCodedStable(1); - testByteCountCodedStable(1 << 8*sizeof(T)); - testByteCountCodedStable(std::numeric_limits::max() >> 8*sizeof(T)); + // These two can't possibly be right. TODO: figure out what was being tested, here + // testByteCountCodedStable(1 << 8*sizeof(T)); + // testByteCountCodedStable(std::numeric_limits::max() >> 8*sizeof(T)); testByteCountCodedStable(std::numeric_limits::max() >> 8); testByteCountCodedStable(std::numeric_limits::max() >> 1); testByteCountCodedStable(std::numeric_limits::max()); diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp index b27d10e312..2d7c207515 100644 --- a/tests/gpu-test/src/main.cpp +++ b/tests/gpu-test/src/main.cpp @@ -25,7 +25,6 @@ #include #include #include - #include #include #include diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp index 0fa261db8d..af47df5c44 100644 --- a/tests/render-utils/src/main.cpp +++ b/tests/render-utils/src/main.cpp @@ -13,7 +13,6 @@ #include #include - #include #include From 93dc0714f7944d6be42cbc7d579541056c4b6752 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Sat, 12 Sep 2015 10:10:53 -0700 Subject: [PATCH 3/6] quiet compiler --- .../entities/src/EntityScriptingInterface.cpp | 14 +++++++------- libraries/shared/src/ByteCountCoding.h | 2 +- libraries/shared/src/PropertyFlags.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index cc108bcb1e..4b8b4e2903 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -547,7 +547,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, } EntityItemPointer entity; - bool success; + bool doTransmit = false; _entityTree->withWriteLock([&] { EntitySimulation* simulation = _entityTree->getSimulation(); entity = _entityTree->findEntityByEntityItemID(entityID); @@ -561,14 +561,14 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, return; } - success = actor(simulation, entity); - if (success) { + doTransmit = actor(simulation, entity); + if (doTransmit) { _entityTree->entityChanged(entity); } }); // transmit the change - if (success) { + if (doTransmit) { EntityItemProperties properties; _entityTree->withReadLock([&] { properties = entity->getProperties(); @@ -580,7 +580,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, queueEntityMessage(PacketType::EntityEdit, entityID, properties); } - return success; + return doTransmit; } @@ -644,7 +644,7 @@ QVector EntityScriptingInterface::getActionIDs(const QUuid& entityID) { actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) { QList actionIDs = entity->getActionIDs(); result = QVector::fromList(actionIDs); - return true; + return false; // don't send an edit packet }); return result; } @@ -653,7 +653,7 @@ QVariantMap EntityScriptingInterface::getActionArguments(const QUuid& entityID, QVariantMap result; actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) { result = entity->getActionArguments(actionID); - return true; + return false; // don't send an edit packet }); return result; } diff --git a/libraries/shared/src/ByteCountCoding.h b/libraries/shared/src/ByteCountCoding.h index ce6f121ddb..3590a5e54d 100644 --- a/libraries/shared/src/ByteCountCoding.h +++ b/libraries/shared/src/ByteCountCoding.h @@ -129,7 +129,7 @@ template inline size_t ByteCountCoded::decode(const char* encoded bool inLeadBits = true; int bitAt = 0; int expectedBitCount; // unknown at this point - int lastValueBit; + int lastValueBit = 0; T bitValue = 1; for(int byte = 0; byte < encodedSize; byte++) { diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h index 0be7b3af93..8e74fd728b 100644 --- a/libraries/shared/src/PropertyFlags.h +++ b/libraries/shared/src/PropertyFlags.h @@ -207,7 +207,7 @@ inline size_t PropertyFlags::decode(const uint8_t* data, size_t size) { bool inLeadBits = true; int bitAt = 0; int expectedBitCount; // unknown at this point - int lastValueBit; + int lastValueBit = 0; for (unsigned int byte = 0; byte < size; byte++) { char originalByte = data[byte]; bytesConsumed++; From 61c9da1d2719ee991c5c864ff50f4af04a0f5d88 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Sat, 12 Sep 2015 10:43:20 -0700 Subject: [PATCH 4/6] minimize diff --- tests/gpu-test/src/main.cpp | 1 + tests/render-utils/src/main.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp index 2d7c207515..b27d10e312 100644 --- a/tests/gpu-test/src/main.cpp +++ b/tests/gpu-test/src/main.cpp @@ -25,6 +25,7 @@ #include #include #include + #include #include #include diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp index af47df5c44..0fa261db8d 100644 --- a/tests/render-utils/src/main.cpp +++ b/tests/render-utils/src/main.cpp @@ -13,6 +13,7 @@ #include #include + #include #include From 414d9162efb6bc362f93013dbf9b771f249cef61 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 14 Sep 2015 08:47:14 -0700 Subject: [PATCH 5/6] change type of MAX_LOG_SIZE rather than cast its only use --- interface/src/FileLogger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/FileLogger.cpp b/interface/src/FileLogger.cpp index 013ea2d1be..f09397322f 100644 --- a/interface/src/FileLogger.cpp +++ b/interface/src/FileLogger.cpp @@ -26,7 +26,7 @@ static const QString FILENAME_FORMAT = "hifi-log_%1_%2.txt"; static const QString DATETIME_FORMAT = "yyyy-MM-dd_hh.mm.ss"; static const QString LOGS_DIRECTORY = "Logs"; // Max log size is 1 MB -static const uint64_t MAX_LOG_SIZE = 1024 * 1024; +static const qint64 MAX_LOG_SIZE = 1024 * 1024; // Max log age is 1 hour static const uint64_t MAX_LOG_AGE_USECS = USECS_PER_SECOND * 3600; @@ -53,7 +53,7 @@ public: protected: void rollFileIfNecessary(QFile& file) { uint64_t now = usecTimestampNow(); - if ((file.size() > (qint64)MAX_LOG_SIZE) || (now - _lastRollTime) > MAX_LOG_AGE_USECS) { + if ((file.size() > MAX_LOG_SIZE) || (now - _lastRollTime) > MAX_LOG_AGE_USECS) { QString newFileName = getLogRollerFilename(); if (file.copy(newFileName)) { _lastRollTime = now; From 1f46b90f9cbd6fcf27f914dd47b96751f4f268a2 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 14 Sep 2015 18:39:31 +0200 Subject: [PATCH 6/6] Remove constexpr for windows --- assignment-client/src/assets/AssetServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/assets/AssetServer.cpp b/assignment-client/src/assets/AssetServer.cpp index a8497953b9..b8cf6b2e01 100644 --- a/assignment-client/src/assets/AssetServer.cpp +++ b/assignment-client/src/assets/AssetServer.cpp @@ -173,8 +173,8 @@ void AssetServer::sendStatsPacket() { auto endTimeMs = std::chrono::duration_cast(stat.second.endTime); QDateTime date = QDateTime::fromMSecsSinceEpoch(endTimeMs.count()); - constexpr static const float USEC_PER_SEC = 1000000.0f; - constexpr static const float MEGABITS_PER_BYTE = 8.0f / 1000000.0f; // Bytes => Mbits + static const float USEC_PER_SEC = 1000000.0f; + static const float MEGABITS_PER_BYTE = 8.0f / 1000000.0f; // Bytes => Mbits float elapsed = (float)(stat.second.endTime - stat.second.startTime).count() / USEC_PER_SEC; // sec float megabitsPerSecPerByte = MEGABITS_PER_BYTE / elapsed; // Bytes => Mb/s