diff options
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llparcel.cpp | 2 | ||||
-rw-r--r-- | indra/llinventory/llsettingsbase.cpp | 12 | ||||
-rw-r--r-- | indra/llinventory/llsettingsbase.h | 2 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 2 | ||||
-rw-r--r-- | indra/llinventory/llsettingssky.cpp | 60 | ||||
-rw-r--r-- | indra/llinventory/llsettingswater.h | 14 | ||||
-rw-r--r-- | indra/llinventory/tests/inventorymisc_test.cpp | 6 |
7 files changed, 49 insertions, 49 deletions
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index ef6ddb3cab..71dc8cff34 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -1268,7 +1268,7 @@ void LLParcel::setExperienceKeyType( const LLUUID& experience_key, U32 type ) U32 LLParcel::countExperienceKeyType( U32 type ) { - return std::count_if( + return (U32)std::count_if( boost::begin(mExperienceKeys | boost::adaptors::map_values), boost::end(mExperienceKeys | boost::adaptors::map_values), [type](U32 key){ return (key == type); }); diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index c1893eff41..7b55fbc9e8 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -278,11 +278,11 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD { case LLSD::TypeInteger: // lerp between the two values rounding the result to the nearest integer. - new_value = LLSD::Integer(llroundf(lerp(value.asReal(), other_value.asReal(), mix))); + new_value = LLSD::Integer(llroundf(lerp((F32)value.asReal(), (F32)other_value.asReal(), (F32)mix))); break; case LLSD::TypeReal: // lerp between the two values. - new_value = LLSD::Real(lerp(value.asReal(), other_value.asReal(), mix)); + new_value = LLSD::Real(lerp((F32)value.asReal(), (F32)other_value.asReal(), (F32)mix)); break; case LLSD::TypeMap: // deep copy. @@ -297,7 +297,7 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD { LLQuaternion a(value); LLQuaternion b(other_value); - LLQuaternion q = slerp(mix, a, b); + LLQuaternion q = slerp((F32)mix, a, b); new_array = q.getValue(); } else @@ -308,7 +308,7 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD for (size_t i = 0; i < len; ++i) { - new_array[i] = lerp(value[i].asReal(), other_value[i].asReal(), mix); + new_array[i] = lerp((F32)value[i].asReal(), (F32)other_value[i].asReal(), (F32)mix); } } @@ -693,7 +693,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf) F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in) { - LLSettingsBase::TrackPosition blendf = blendf_in; + LLSettingsBase::TrackPosition blendf = (F32)blendf_in; llassert(!isnan(blendf)); if (blendf >= 1.0) { @@ -744,7 +744,7 @@ bool LLSettingsBlenderTimeDelta::applyTimeDelta(const LLSettingsBase::Seconds& t return false; } - LLSettingsBase::BlendFactor blendf = calculateBlend(mTimeSpent, mBlendSpan); + LLSettingsBase::BlendFactor blendf = calculateBlend((F32)mTimeSpent.value(), mBlendSpan); if (fabs(mLastBlendF - blendf) < mBlendFMinDelta) { diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index a5499c4eb6..9d8d746b7e 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -475,7 +475,7 @@ public: LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target, const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& blend_span) : LLSettingsBlender(target, initsetting, endsetting), - mBlendSpan(blend_span), + mBlendSpan((F32)blend_span.value()), mLastUpdate(0.0f), mTimeSpent(0.0f), mBlendFMinDelta(MIN_BLEND_DELTA), diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 99f917d94b..1e7de94414 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -499,7 +499,7 @@ namespace continue; } - LLSettingsBase::TrackPosition frame = elem[LLSettingsDay::SETTING_KEYKFRAME].asReal(); + LLSettingsBase::TrackPosition frame = (F32)elem[LLSettingsDay::SETTING_KEYKFRAME].asReal(); if ((frame < 0.0) || (frame > 1.0)) { frame = llclamp(frame, 0.0f, 1.0f); diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index e14b2f25ed..cbec2f4906 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -480,19 +480,19 @@ void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf) // If there is no cloud texture in destination, reduce coverage to imitate disappearance // See LLDrawPoolWLSky::renderSkyClouds... we don't blend present texture with null // Note: Probably can be done by shader - cloud_shadow = lerp(mSettings[SETTING_CLOUD_SHADOW].asReal(), (F64)0.f, blendf); + cloud_shadow = lerp((F32)mSettings[SETTING_CLOUD_SHADOW].asReal(), 0.f, (F32)blendf); cloud_noise_id_next = cloud_noise_id; } else if (cloud_noise_id.isNull() && !cloud_noise_id_next.isNull()) { // Source has no cloud texture, reduce initial coverage to imitate appearance // use same texture as destination - cloud_shadow = lerp((F64)0.f, other->mSettings[SETTING_CLOUD_SHADOW].asReal(), blendf); + cloud_shadow = lerp(0.f, (F32)other->mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)blendf); setCloudNoiseTextureId(cloud_noise_id_next); } else { - cloud_shadow = lerp(mSettings[SETTING_CLOUD_SHADOW].asReal(), other->mSettings[SETTING_CLOUD_SHADOW].asReal(), blendf); + cloud_shadow = lerp((F32)mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)other->mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)blendf); } LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, other->getParameterMap(), blendf); @@ -923,8 +923,8 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy) if (legacy.has(SETTING_LEGACY_EAST_ANGLE) && legacy.has(SETTING_LEGACY_SUN_ANGLE)) { // get counter-clockwise radian angle from clockwise legacy WL east angle... - F32 azimuth = -legacy[SETTING_LEGACY_EAST_ANGLE].asReal(); - F32 altitude = legacy[SETTING_LEGACY_SUN_ANGLE].asReal(); + F32 azimuth = -(F32)legacy[SETTING_LEGACY_EAST_ANGLE].asReal(); + F32 altitude = (F32)legacy[SETTING_LEGACY_SUN_ANGLE].asReal(); LLQuaternion sunquat = convert_azimuth_and_altitude_to_quat(azimuth, altitude); // original WL moon dir was diametrically opposed to the sun dir @@ -958,7 +958,7 @@ void LLSettingsSky::updateSettings() F32 LLSettingsSky::getSunMoonGlowFactor() const { return getIsSunUp() ? 1.0f : - getIsMoonUp() ? getMoonBrightness() * 0.25 : 0.0f; + getIsMoonUp() ? getMoonBrightness() * 0.25f : 0.0f; } bool LLSettingsSky::getIsSunUp() const @@ -1043,11 +1043,11 @@ F32 LLSettingsSky::getFloat(const std::string& key, F32 default_value) const LL_PROFILE_ZONE_SCOPED_CATEGORY_ENVIRONMENT; if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(key)) { - return mSettings[SETTING_LEGACY_HAZE][key].asReal(); + return (F32)mSettings[SETTING_LEGACY_HAZE][key].asReal(); } if (mSettings.has(key)) { - return mSettings[key].asReal(); + return (F32)mSettings[key].asReal(); } return default_value; } @@ -1307,7 +1307,7 @@ void LLSettingsSky::clampColor(LLColor3& color, F32 gamma, F32 scale) const color *= scale/max_color; } LLColor3 linear(color); - linear *= 1.0 / scale; + linear *= 1.0f / scale; linear = smear(1.0f) - linear; linear = componentPow(linear, gamma); linear *= scale; @@ -1353,7 +1353,7 @@ void LLSettingsSky::calculateLightSettings() const F32 haze_horizon = getHazeHorizon(); - sunlight *= 1.0 - cloud_shadow; + sunlight *= 1.0f - cloud_shadow; sunlight += tmpAmbient; mHazeColor = getBlueHorizon() * getBlueDensity() * sunlight; @@ -1415,22 +1415,22 @@ LLUUID LLSettingsSky::GetDefaultHaloTextureId() F32 LLSettingsSky::getPlanetRadius() const { - return mSettings[SETTING_PLANET_RADIUS].asReal(); + return (F32)mSettings[SETTING_PLANET_RADIUS].asReal(); } F32 LLSettingsSky::getSkyMoistureLevel() const { - return mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal(); + return (F32)mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal(); } F32 LLSettingsSky::getSkyDropletRadius() const { - return mSettings[SETTING_SKY_DROPLET_RADIUS].asReal(); + return (F32)mSettings[SETTING_SKY_DROPLET_RADIUS].asReal(); } F32 LLSettingsSky::getSkyIceLevel() const { - return mSettings[SETTING_SKY_ICE_LEVEL].asReal(); + return (F32)mSettings[SETTING_SKY_ICE_LEVEL].asReal(); } F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const @@ -1440,27 +1440,27 @@ F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const return sAutoAdjustProbeAmbiance; } - return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal(); + return (F32)mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal(); } F32 LLSettingsSky::getSkyBottomRadius() const { - return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal(); + return (F32)mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal(); } F32 LLSettingsSky::getSkyTopRadius() const { - return mSettings[SETTING_SKY_TOP_RADIUS].asReal(); + return (F32)mSettings[SETTING_SKY_TOP_RADIUS].asReal(); } F32 LLSettingsSky::getSunArcRadians() const { - return mSettings[SETTING_SUN_ARC_RADIANS].asReal(); + return (F32)mSettings[SETTING_SUN_ARC_RADIANS].asReal(); } F32 LLSettingsSky::getMieAnisotropy() const { - return getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR].asReal(); + return (F32)getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR].asReal(); } LLSD LLSettingsSky::getRayleighConfig() const @@ -1569,7 +1569,7 @@ void LLSettingsSky::setCloudPosDensity2(const LLColor3 &val) F32 LLSettingsSky::getCloudScale() const { - return mSettings[SETTING_CLOUD_SCALE].asReal(); + return (F32)mSettings[SETTING_CLOUD_SCALE].asReal(); } void LLSettingsSky::setCloudScale(F32 val) @@ -1601,7 +1601,7 @@ void LLSettingsSky::setCloudScrollRateY(F32 val) F32 LLSettingsSky::getCloudShadow() const { - return mSettings[SETTING_CLOUD_SHADOW].asReal(); + return (F32)mSettings[SETTING_CLOUD_SHADOW].asReal(); } void LLSettingsSky::setCloudShadow(F32 val) @@ -1611,7 +1611,7 @@ void LLSettingsSky::setCloudShadow(F32 val) F32 LLSettingsSky::getCloudVariance() const { - return mSettings[SETTING_CLOUD_VARIANCE].asReal(); + return (F32)mSettings[SETTING_CLOUD_VARIANCE].asReal(); } void LLSettingsSky::setCloudVariance(F32 val) @@ -1621,7 +1621,7 @@ void LLSettingsSky::setCloudVariance(F32 val) F32 LLSettingsSky::getDomeOffset() const { - //return mSettings[SETTING_DOME_OFFSET].asReal(); + //return (F32)mSettings[SETTING_DOME_OFFSET].asReal(); return DOME_OFFSET; } @@ -1633,7 +1633,7 @@ F32 LLSettingsSky::getDomeRadius() const F32 LLSettingsSky::getGamma() const { - return mSettings[SETTING_GAMMA].asReal(); + return (F32)mSettings[SETTING_GAMMA].asReal(); } void LLSettingsSky::setGamma(F32 val) @@ -1654,7 +1654,7 @@ void LLSettingsSky::setGlow(const LLColor3 &val) F32 LLSettingsSky::getMaxY() const { - return mSettings[SETTING_MAX_Y].asReal(); + return (F32)mSettings[SETTING_MAX_Y].asReal(); } void LLSettingsSky::setMaxY(F32 val) @@ -1674,7 +1674,7 @@ void LLSettingsSky::setMoonRotation(const LLQuaternion &val) F32 LLSettingsSky::getMoonScale() const { - return mSettings[SETTING_MOON_SCALE].asReal(); + return (F32)mSettings[SETTING_MOON_SCALE].asReal(); } void LLSettingsSky::setMoonScale(F32 val) @@ -1692,9 +1692,9 @@ void LLSettingsSky::setMoonTextureId(LLUUID id) setValue(SETTING_MOON_TEXTUREID, id); } -F32 LLSettingsSky::getMoonBrightness() const +F32 LLSettingsSky::getMoonBrightness() const { - return mSettings[SETTING_MOON_BRIGHTNESS].asReal(); + return (F32)mSettings[SETTING_MOON_BRIGHTNESS].asReal(); } void LLSettingsSky::setMoonBrightness(F32 brightness_factor) @@ -1704,7 +1704,7 @@ void LLSettingsSky::setMoonBrightness(F32 brightness_factor) F32 LLSettingsSky::getStarBrightness() const { - return mSettings[SETTING_STAR_BRIGHTNESS].asReal(); + return (F32)mSettings[SETTING_STAR_BRIGHTNESS].asReal(); } void LLSettingsSky::setStarBrightness(F32 val) @@ -1749,7 +1749,7 @@ void LLSettingsSky::setSunRotation(const LLQuaternion &val) F32 LLSettingsSky::getSunScale() const { - return mSettings[SETTING_SUN_SCALE].asReal(); + return (F32)mSettings[SETTING_SUN_SCALE].asReal(); } void LLSettingsSky::setSunScale(F32 val) diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h index 0b29d8ca19..9e7ff61272 100644 --- a/indra/llinventory/llsettingswater.h +++ b/indra/llinventory/llsettingswater.h @@ -72,7 +72,7 @@ public: //--------------------------------------------------------------------- F32 getBlurMultiplier() const { - return mSettings[SETTING_BLUR_MULTIPLIER].asReal(); + return (F32)mSettings[SETTING_BLUR_MULTIPLIER].asReal(); } void setBlurMultiplier(F32 val) @@ -92,7 +92,7 @@ public: F32 getWaterFogDensity() const { - return mSettings[SETTING_FOG_DENSITY].asReal(); + return (F32)mSettings[SETTING_FOG_DENSITY].asReal(); } F32 getModifiedWaterFogDensity(bool underwater) const; @@ -104,7 +104,7 @@ public: F32 getFogMod() const { - return mSettings[SETTING_FOG_MOD].asReal(); + return (F32)mSettings[SETTING_FOG_MOD].asReal(); } void setFogMod(F32 val) @@ -114,7 +114,7 @@ public: F32 getFresnelOffset() const { - return mSettings[SETTING_FRESNEL_OFFSET].asReal(); + return (F32)mSettings[SETTING_FRESNEL_OFFSET].asReal(); } void setFresnelOffset(F32 val) @@ -124,7 +124,7 @@ public: F32 getFresnelScale() const { - return mSettings[SETTING_FRESNEL_SCALE].asReal(); + return (F32)mSettings[SETTING_FRESNEL_SCALE].asReal(); } void setFresnelScale(F32 val) @@ -164,7 +164,7 @@ public: F32 getScaleAbove() const { - return mSettings[SETTING_SCALE_ABOVE].asReal(); + return (F32)mSettings[SETTING_SCALE_ABOVE].asReal(); } void setScaleAbove(F32 val) @@ -174,7 +174,7 @@ public: F32 getScaleBelow() const { - return mSettings[SETTING_SCALE_BELOW].asReal(); + return (F32)mSettings[SETTING_SCALE_BELOW].asReal(); } void setScaleBelow(F32 val) diff --git a/indra/llinventory/tests/inventorymisc_test.cpp b/indra/llinventory/tests/inventorymisc_test.cpp index bcf6131bd8..9779cb8fbc 100644 --- a/indra/llinventory/tests/inventorymisc_test.cpp +++ b/indra/llinventory/tests/inventorymisc_test.cpp @@ -61,7 +61,7 @@ LLPointer<LLInventoryItem> create_random_inventory_item() S32 price = rand(); LLSaleInfo sale_info(LLSaleInfo::FS_COPY, price); U32 flags = rand(); - S32 creation = time(NULL); + S32 creation = (S32)time(NULL); LLPointer<LLInventoryItem> item = new LLInventoryItem( item_id, @@ -195,7 +195,7 @@ namespace tut src->setSaleInfo(new_sale_info); U32 new_flags = rand(); - S32 new_creation = time(NULL); + S32 new_creation = (S32)time(NULL); LLPermissions new_perm; @@ -266,7 +266,7 @@ namespace tut src->setSaleInfo(new_sale_info); U32 new_flags = rand(); - S32 new_creation = time(NULL); + S32 new_creation = (S32)time(NULL); LLPermissions new_perm; |