summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerpartsim.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerpartsim.h')
-rw-r--r--indra/newview/llviewerpartsim.h71
1 files changed, 37 insertions, 34 deletions
diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h
index 343425f3d4..3e20f999c0 100644
--- a/indra/newview/llviewerpartsim.h
+++ b/indra/newview/llviewerpartsim.h
@@ -2,30 +2,25 @@
* @file llviewerpartsim.h
* @brief LLViewerPart class header file
*
- * $LicenseInfo:firstyear=2003&license=viewergpl$
- *
- * Copyright (c) 2003-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2003&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$
*/
@@ -34,15 +29,14 @@
#include "lldarrayptr.h"
#include "llframetimer.h"
-#include "llmemory.h"
-
+#include "llpointer.h"
#include "llpartdata.h"
+#include "llviewerpartsource.h"
-class LLViewerImage;
+class LLViewerTexture;
class LLViewerPart;
-class LLViewerPartSource;
class LLViewerRegion;
-class LLViewerImage;
+class LLViewerTexture;
class LLVOPartGroup;
typedef void (*LLVPCallback)(LLViewerPart &part, const F32 dt);
@@ -53,14 +47,14 @@ typedef void (*LLVPCallback)(LLViewerPart &part, const F32 dt);
//
-class LLViewerPart : public LLPartData, public LLRefCount
+class LLViewerPart : public LLPartData
{
-protected:
+public:
~LLViewerPart();
public:
LLViewerPart();
- void init(LLPointer<LLViewerPartSource> sourcep, LLViewerImage *imagep, LLVPCallback cb);
+ void init(LLPointer<LLViewerPartSource> sourcep, LLViewerTexture *imagep, LLVPCallback cb);
U32 mPartID; // Particle ID used primarily for moving between groups
@@ -72,7 +66,7 @@ public:
// Current particle state (possibly used for rendering)
- LLPointer<LLViewerImage> mImagep;
+ LLPointer<LLViewerTexture> mImagep;
LLVector3 mPosAgent;
LLVector3 mVelocity;
LLVector3 mAccel;
@@ -88,7 +82,8 @@ class LLViewerPartGroup
{
public:
LLViewerPartGroup(const LLVector3 &center,
- const F32 box_radius);
+ const F32 box_radius,
+ bool hud);
virtual ~LLViewerPartGroup();
void cleanup();
@@ -101,7 +96,7 @@ public:
void shift(const LLVector3 &offset);
- typedef std::vector<LLPointer<LLViewerPart> > part_list_t;
+ typedef std::vector<LLViewerPart*> part_list_t;
part_list_t mParticles;
const LLVector3 &getCenterAgent() const { return mCenterAgent; }
@@ -116,6 +111,7 @@ public:
U32 mID;
F32 mSkippedTime;
+ bool mHud;
protected:
LLVector3 mCenterAgent;
@@ -126,11 +122,12 @@ protected:
LLViewerRegion *mRegionp;
};
-class LLViewerPartSim
+class LLViewerPartSim : public LLSingleton<LLViewerPartSim>
{
public:
LLViewerPartSim();
- virtual ~LLViewerPartSim();
+ virtual ~LLViewerPartSim(){}
+ void destroyClass();
typedef std::vector<LLViewerPartGroup *> group_list_t;
typedef std::vector<LLPointer<LLViewerPartSource> > source_list_t;
@@ -178,7 +175,7 @@ public:
U32 mID;
protected:
- LLViewerPartGroup *createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size);
+ LLViewerPartGroup *createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size, bool hud);
LLViewerPartGroup *put(LLViewerPart* part);
group_list_t mViewerPartGroups;
@@ -195,6 +192,12 @@ protected:
static const F32 PART_THROTTLE_RESCALE;
static const F32 PART_ADAPT_RATE_MULT;
static const F32 PART_ADAPT_RATE_MULT_RECIP;
+
+//debug use only
+public:
+ static S32 sParticleCount2;
+
+ static void checkParticleCount(U32 size = 0) ;
};
#endif // LL_LLVIEWERPARTSIM_H