summaryrefslogtreecommitdiff
path: root/indra/newview/llvowater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvowater.cpp')
-rw-r--r--indra/newview/llvowater.cpp52
1 files changed, 22 insertions, 30 deletions
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 901dc6de21..598938b710 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -2,30 +2,25 @@
* @file llvowater.cpp
* @brief LLVOWater class implementation
*
- * $LicenseInfo:firstyear=2005&license=viewergpl$
- *
- * Copyright (c) 2005-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -36,7 +31,6 @@
#include "imageids.h"
#include "llviewercontrol.h"
-#include "llagent.h"
#include "lldrawable.h"
#include "lldrawpoolwater.h"
#include "llface.h"
@@ -44,7 +38,7 @@
#include "llsurface.h"
#include "llvosky.h"
#include "llviewercamera.h"
-#include "llviewerimagelist.h"
+#include "llviewertexturelist.h"
#include "llviewerregion.h"
#include "llworld.h"
#include "pipeline.h"
@@ -55,8 +49,6 @@ const BOOL gUseRoam = FALSE;
///////////////////////////////////
-#include "randgauss.h"
-
template<class T> inline T LERP(T a, T b, F32 factor)
{
return a + (b - a) * factor;
@@ -67,7 +59,6 @@ const U32 N_RES_HALF = (N_RES >> 1);
const U32 WIDTH = (N_RES * WAVE_STEP); //128.f //64 // width of wave tile, in meters
const F32 WAVE_STEP_INV = (1. / WAVE_STEP);
-const F32 g = 9.81f; // gravitational constant (m/s^2)
LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
: LLStaticViewerObject(id, LL_VO_WATER, regionp)
@@ -101,7 +92,7 @@ void LLVOWater::setPixelAreaAndAngle(LLAgent &agent)
// virtual
-void LLVOWater::updateTextures(LLAgent &agent)
+void LLVOWater::updateTextures()
{
}
@@ -133,15 +124,17 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline)
}
else
{
- mDrawable->setNumFaces(1, pool, gWorldp->getDefaultWaterTexture());
+ mDrawable->setNumFaces(1, pool, LLWorld::getInstance()->getDefaultWaterTexture());
}
return mDrawable;
}
+static LLFastTimer::DeclareTimer FTM_UPDATE_WATER("Update Water");
+
BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WATER);
+ LLFastTimer ftm(FTM_UPDATE_WATER);
LLFace *face;
if (drawable->getNumFaces() < 1)
@@ -276,9 +269,8 @@ U32 LLVOWater::getPartitionType() const
}
LLWaterPartition::LLWaterPartition()
-: LLSpatialPartition(0)
+: LLSpatialPartition(0, FALSE, 0)
{
- mRenderByGroup = FALSE;
mInfiniteFarClip = TRUE;
mDrawableType = LLPipeline::RENDER_TYPE_WATER;
mPartitionType = LLViewerRegion::PARTITION_WATER;