summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-05-02 15:45:38 -0500
committerDave Parks <davep@lindenlab.com>2012-05-02 15:45:38 -0500
commit423659c68076f99a73985b9bd1befa5c0f5d3457 (patch)
treef4f4b78e2d208ca8d1d03de113d7b32de513e26c /indra/llcommon
parentcabc36e993e8876a99c019e19fdf7e2ff0737af8 (diff)
MAINT-775 Particle vertex buffer management optimizations
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llstrider.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llcommon/llstrider.h b/indra/llcommon/llstrider.h
index f4c43bac61..ed9284d2c5 100644
--- a/indra/llcommon/llstrider.h
+++ b/indra/llcommon/llstrider.h
@@ -44,6 +44,15 @@ public:
const LLStrider<Object>& operator = (Object *first) { mObjectp = first; return *this;}
void setStride (S32 skipBytes) { mSkip = (skipBytes ? skipBytes : sizeof(Object));}
+ LLStrider<Object> operator+(const S32& index)
+ {
+ LLStrider<Object> ret;
+ ret.mBytep = mBytep + mSkip*index;
+ ret.mSkip = mSkip;
+
+ return ret;
+ }
+
void skip(const U32 index) { mBytep += mSkip*index;}
U32 getSkip() const { return mSkip; }
Object* get() { return mObjectp; }
@@ -51,6 +60,7 @@ public:
Object& operator *() { return *mObjectp; }
Object* operator ++(int) { Object* old = mObjectp; mBytep += mSkip; return old; }
Object* operator +=(int i) { mBytep += mSkip*i; return mObjectp; }
+
Object& operator[](U32 index) { return *(Object*)(mBytep + (mSkip * index)); }
};