Changes per code review.

This commit is contained in:
Nissim Hadar 2018-01-08 15:37:06 -08:00
parent 452c16e706
commit b2b1807490
7 changed files with 7 additions and 15 deletions

View file

@ -414,7 +414,6 @@ void ZoneEntityRenderer::setAmbientURL(const QString& ambientUrl) {
_ambientTextureURL = ambientUrl;
if (_ambientTextureURL.isEmpty()) {
_validAmbientTexture = false;
_pendingAmbientTexture = false;
_ambientTexture.clear();
@ -442,7 +441,6 @@ void ZoneEntityRenderer::updateAmbientMap() {
_ambientLight->setAmbientSpherePreset(gpu::SphericalHarmonics::BREEZEWAY);
}
editAmbientLight()->setAmbientMap(texture);
_validAmbientTexture = true;
} else {
qCDebug(entitiesrenderer) << "Failed to load ambient texture:" << _ambientTexture->getURL();
}
@ -458,7 +456,6 @@ void ZoneEntityRenderer::setSkyboxURL(const QString& skyboxUrl) {
_skyboxTextureURL = skyboxUrl;
if (_skyboxTextureURL.isEmpty()) {
_validSkyboxTexture = false;
_pendingSkyboxTexture = false;
_skyboxTexture.clear();
@ -478,7 +475,6 @@ void ZoneEntityRenderer::updateSkyboxMap() {
auto texture = _skyboxTexture->getGPUTexture();
if (texture) {
editSkybox()->setCubemap(texture);
_validSkyboxTexture = true;
} else {
qCDebug(entitiesrenderer) << "Failed to load Skybox texture:" << _skyboxTexture->getURL();
}

View file

@ -119,12 +119,10 @@ private:
QString _ambientTextureURL;
NetworkTexturePointer _ambientTexture;
bool _pendingAmbientTexture{ false };
bool _validAmbientTexture{ false };
QString _skyboxTextureURL;
NetworkTexturePointer _skyboxTexture;
bool _pendingSkyboxTexture{ false };
bool _validSkyboxTexture{ false };
QString _proceduralUserData;
Transform _renderTransform;

View file

@ -2291,7 +2291,7 @@ bool EntityTree::readFromMap(QVariantMap& map) {
if (entityMap.contains("backgroundMode") && (entityMap["backgroundMode"].toString() == "nothing")) {
properties.setSkyboxMode(COMPONENT_MODE_INHERIT);
} else {
// either the background mode field is missing (shouldn't happen) or the background mode is "skybox"
// either the background mode field is missing (shouldn't happen) or the background mode is "skybox"
properties.setSkyboxMode(COMPONENT_MODE_ENABLED);
}
}

View file

@ -82,7 +82,7 @@ bool KeyLightPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
return true;
}
bool KeyLightPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt,
bool KeyLightPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt,
int& processedBytes) {
int bytesRead = 0;
@ -92,7 +92,6 @@ bool KeyLightPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyFl
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, xColor, setColor);
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, float, setIntensity);
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, glm::vec3, setDirection);
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_COLOR, Color);
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_INTENSITY, Intensity);

View file

@ -362,7 +362,7 @@ void ZoneEntityItem::resetRenderingPropertiesChanged() {
}
void ZoneEntityItem::setHazeMode(const uint32_t value) {
if (value < COMPONENT_MODE_ITEM_COUNT) {
if (value < COMPONENT_MODE_ITEM_COUNT && value != _hazeMode) {
_hazeMode = value;
_hazePropertiesChanged = true;
}
@ -373,7 +373,7 @@ uint32_t ZoneEntityItem::getHazeMode() const {
}
void ZoneEntityItem::setKeyLightMode(const uint32_t value) {
if (value < COMPONENT_MODE_ITEM_COUNT) {
if (value < COMPONENT_MODE_ITEM_COUNT && value != _keyLightMode) {
_keyLightMode = value;
_keyLightPropertiesChanged = true;
}
@ -384,7 +384,7 @@ uint32_t ZoneEntityItem::getKeyLightMode() const {
}
void ZoneEntityItem::setAmbientLightMode(const uint32_t value) {
if (value < COMPONENT_MODE_ITEM_COUNT) {
if (value < COMPONENT_MODE_ITEM_COUNT && value != _ambientLightMode) {
_ambientLightMode = value;
_ambientLightPropertiesChanged = true;
}
@ -395,7 +395,7 @@ uint32_t ZoneEntityItem::getAmbientLightMode() const {
}
void ZoneEntityItem::setSkyboxMode(const uint32_t value) {
if (value < COMPONENT_MODE_ITEM_COUNT) {
if (value < COMPONENT_MODE_ITEM_COUNT && value != _skyboxMode) {
_skyboxMode = value;
_skyboxPropertiesChanged = true;
}

View file

@ -202,7 +202,7 @@ enum class EntityVersion : PacketVersion {
HazeEffect,
StaticCertJsonVersionOne,
OwnershipChallengeFix,
ZoneLightInheritModes
ZoneLightInheritModes
};
enum class EntityScriptCallMethodVersion : PacketVersion {

View file

@ -67,7 +67,6 @@ public:
NetworkTexturePointer _ambientTexture;
QString _ambientTextureURL;
bool _pendingAmbientTexture { false };
bool _validAmbientTextureURL { false };
protected:
model::LightPointer _light;