diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index ec812db8e8..94349bd3bc 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -9,6 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include + #include #include #include @@ -101,13 +104,16 @@ bool OctreeSendThread::process() { int elapsed = (usecTimestampNow() - start); int usecToSleep = OCTREE_SEND_INTERVAL_USECS - elapsed; - if (usecToSleep > 0) { - PerformanceWarning warn(false,"OctreeSendThread... usleep()",false,&_usleepTime,&_usleepCalls); - usleep(usecToSleep); - } else { + if (usecToSleep <= 0) { const int MIN_USEC_TO_SLEEP = 1; - usleep(MIN_USEC_TO_SLEEP); + usecToSleep = MIN_USEC_TO_SLEEP; } + + { + PerformanceWarning warn(false,"OctreeSendThread... usleep()",false,&_usleepTime,&_usleepCalls); + std::this_thread::sleep_for(std::chrono::microseconds(usecToSleep)); + } + } return isStillRunning(); // keep running till they terminate us diff --git a/interface/resources/icons/statusIconAtlas.svg b/interface/resources/icons/statusIconAtlas.svg index 72f9bc4af7..027102cc69 100644 --- a/interface/resources/icons/statusIconAtlas.svg +++ b/interface/resources/icons/statusIconAtlas.svg @@ -1,31 +1,52 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp index 25f4052c75..d148145dde 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp @@ -85,10 +85,14 @@ void makeEntityItemStatusGetters(EntityItemPointer entity, render::Item::Status: auto nodeList = DependencyManager::get(); const QUuid& myNodeID = nodeList->getSessionUUID(); bool weOwnSimulation = entity->getSimulationOwner().matchesValidID(myNodeID); + bool otherOwnSimulation = !weOwnSimulation && !entity->getSimulationOwner().isNull(); if (weOwnSimulation) { return render::Item::Status::Value(1.0f, render::Item::Status::Value::BLUE, (unsigned char)RenderItemStatusIcon::SIMULATION_OWNER); + } else if (otherOwnSimulation) { + return render::Item::Status::Value(1.0f, render::Item::Status::Value::RED, + (unsigned char)RenderItemStatusIcon::OTHER_SIMULATION_OWNER); } return render::Item::Status::Value(0.0f, render::Item::Status::Value::BLUE, (unsigned char)RenderItemStatusIcon::SIMULATION_OWNER); diff --git a/libraries/entities-renderer/src/RenderableEntityItem.h b/libraries/entities-renderer/src/RenderableEntityItem.h index 92bb98ad32..09451e87d4 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.h +++ b/libraries/entities-renderer/src/RenderableEntityItem.h @@ -25,6 +25,7 @@ enum class RenderItemStatusIcon { PACKET_RECEIVED = 2, SIMULATION_OWNER = 3, HAS_ACTIONS = 4, + OTHER_SIMULATION_OWNER = 5, NONE = 255 }; diff --git a/libraries/model/src/model/TextureMap.cpp b/libraries/model/src/model/TextureMap.cpp index 349980b702..3e6016d7c0 100755 --- a/libraries/model/src/model/TextureMap.cpp +++ b/libraries/model/src/model/TextureMap.cpp @@ -105,19 +105,19 @@ const QImage& image, bool isLinear, bool doCompress) { gpu::Semantic gpuSemantic; gpu::Semantic mipSemantic; if (isLinear) { - mipSemantic = gpu::SBGRA; - if (doCompress) { - gpuSemantic = gpu::COMPRESSED_SRGBA; - } else { - gpuSemantic = gpu::SRGBA; - } - } else { mipSemantic = gpu::BGRA; if (doCompress) { gpuSemantic = gpu::COMPRESSED_RGBA; } else { gpuSemantic = gpu::RGBA; } + } else { + mipSemantic = gpu::SBGRA; + if (doCompress) { + gpuSemantic = gpu::COMPRESSED_SRGBA; + } else { + gpuSemantic = gpu::SRGBA; + } } formatGPU = gpu::Element(gpu::VEC4, gpu::NUINT8, gpuSemantic); formatMip = gpu::Element(gpu::VEC4, gpu::NUINT8, mipSemantic); @@ -125,19 +125,19 @@ const QImage& image, bool isLinear, bool doCompress) { gpu::Semantic gpuSemantic; gpu::Semantic mipSemantic; if (isLinear) { - mipSemantic = gpu::SRGB; - if (doCompress) { - gpuSemantic = gpu::COMPRESSED_SRGB; - } else { - gpuSemantic = gpu::SRGB; - } - } else { mipSemantic = gpu::RGB; if (doCompress) { gpuSemantic = gpu::COMPRESSED_RGB; } else { gpuSemantic = gpu::RGB; } + } else { + mipSemantic = gpu::SRGB; + if (doCompress) { + gpuSemantic = gpu::COMPRESSED_SRGB; + } else { + gpuSemantic = gpu::SRGB; + } } formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpuSemantic); formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, mipSemantic); @@ -171,14 +171,6 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag if (generateMips) { theTexture->autoGenerateMips(-1); - auto levels = theTexture->maxMip(); - uvec2 size(image.width(), image.height()); - for (uint8_t i = 1; i <= levels; ++i) { - size >>= 1; - size = glm::max(size, uvec2(1)); - image = image.scaled(size.x, size.y, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - theTexture->assignStoredMip(i, formatMip, image.byteCount(), image.constBits()); - } } } @@ -186,20 +178,20 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag } gpu::Texture* TextureUsage::create2DTextureFromImage(const QImage& srcImage, const std::string& srcImageName) { - return process2DTextureColorFromImage(srcImage, true, false, true); + return process2DTextureColorFromImage(srcImage, false, false, true); } gpu::Texture* TextureUsage::createAlbedoTextureFromImage(const QImage& srcImage, const std::string& srcImageName) { - return process2DTextureColorFromImage(srcImage, true, true, true); + return process2DTextureColorFromImage(srcImage, false, true, true); } gpu::Texture* TextureUsage::createEmissiveTextureFromImage(const QImage& srcImage, const std::string& srcImageName) { - return process2DTextureColorFromImage(srcImage, true, true, true); + return process2DTextureColorFromImage(srcImage, false, true, true); } gpu::Texture* TextureUsage::createLightmapTextureFromImage(const QImage& srcImage, const std::string& srcImageName) { - return process2DTextureColorFromImage(srcImage, true, true, true); + return process2DTextureColorFromImage(srcImage, false, true, true); } diff --git a/libraries/octree/src/OctreePersistThread.cpp b/libraries/octree/src/OctreePersistThread.cpp index 8169654b0c..d48c35d542 100644 --- a/libraries/octree/src/OctreePersistThread.cpp +++ b/libraries/octree/src/OctreePersistThread.cpp @@ -9,6 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include + #include #include #include @@ -201,7 +204,7 @@ bool OctreePersistThread::process() { if (isStillRunning()) { quint64 MSECS_TO_USECS = 1000; quint64 USECS_TO_SLEEP = 10 * MSECS_TO_USECS; // every 10ms - usleep(USECS_TO_SLEEP); + std::this_thread::sleep_for(std::chrono::microseconds(USECS_TO_SLEEP)); // do our updates then check to save... _tree->update();