Esempio n. 1
0
void LLEnvManagerNew::onRegionChange()
{
    // Avoid duplicating region setting requests
    // by checking whether the region is actually changing.
    LLViewerRegion* regionp = gAgent.getRegion();
    LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null;
    if (region_uuid != mCurRegionUUID)
    {
        // Clear locally modified region settings.
        mNewRegionPrefs.clear();

        // *TODO: clear environment settings of the previous region?

        // Request environment settings of the new region.
        mCurRegionUUID = region_uuid;
        // for region crossings, interpolate the change; for teleports, don't
        mInterpNextChangeMessage = (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE);
        LL_DEBUGS("Windlight") << (mInterpNextChangeMessage ? "Crossed" : "Teleported")
                               << " to new region: " << region_uuid
                               << LL_ENDL;
        requestRegionSettings();
    }
    else
    {
        LL_DEBUGS("Windlight") << "disregarding region change; interp: "
                               << (mInterpNextChangeMessage ? "true" : "false")
                               << " regionp: " << regionp
                               << " old: " << mCurRegionUUID
                               << " new: " << region_uuid
                               << LL_ENDL;
    }
}
Esempio n. 2
0
void LLEnvManagerNew::onRegionChange(bool interpolate)
{
	// Avoid duplicating region setting requests
	// by checking whether the region is actually changing.
	LLViewerRegion* regionp = gAgent.getRegion();
	LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null;
	if (region_uuid == mCurRegionUUID)
	{
		return;
	}

	// Clear locally modified region settings.
	mNewRegionPrefs.clear();

	// *TODO: clear environment settings of the previous region?

	// Request environment settings of the new region.
	LL_DEBUGS("Windlight") << "New viewer region: " << region_uuid << LL_ENDL;
	mCurRegionUUID = region_uuid;
	mInterpNextChangeMessage = interpolate;
	requestRegionSettings();

	// Let interested parties know agent region has been changed.
	mRegionChangeSignal();
}
Esempio n. 3
0
void LLEnvManagerNew::loadUserPrefs()
{
	// operate on members directly to avoid side effects
	mUserPrefs.mWaterPresetName	= gSavedSettings.getString("WaterPresetName");
	mUserPrefs.mSkyPresetName	= gSavedSettings.getString("SkyPresetName");
	mUserPrefs.mDayCycleName	= gSavedSettings.getString("DayCycleName");

	mUserPrefs.mUseRegionSettings	= gSavedSettings.getBOOL("UseEnvironmentFromRegion");
	mUserPrefs.mUseDayCycle			= gSavedSettings.getBOOL("UseDayCycle");

	if (mUserPrefs.mUseRegionSettings)
	{
		requestRegionSettings();
	}
}