diff options
| author | Steve Bennetts <steve@lindenlab.com> | 2009-10-19 10:49:48 -0700 |
|---|---|---|
| committer | Steve Bennetts <steve@lindenlab.com> | 2009-10-19 10:49:48 -0700 |
| commit | 65bf35cfed4b67d5f27628144f7519c81bd97dac (patch) | |
| tree | 8ca423d53d3105133e40e7bd7d3aaea3f0528023 /indra/llprimitive/llprimtexturelist.cpp | |
| parent | 6c1706da69193de3ddbaf69a40e5ba0cad13283e (diff) | |
| parent | fce70328535ec04aba64972f47cface0b2fd3046 (diff) | |
merge
Diffstat (limited to 'indra/llprimitive/llprimtexturelist.cpp')
| -rw-r--r-- | indra/llprimitive/llprimtexturelist.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index d03150fc78..1c7de95975 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -135,13 +135,12 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) { if (S32(index) >= mEntryList.size()) { - // TODO -- assert here S32 current_size = mEntryList.size(); - llerrs << "index = " << S32(index) << " current_size = " << current_size << llendl; + llwarns << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << llendl; return TEM_CHANGE_NONE; } - // we're changing an existing entry + // we're changing an existing entry llassert(mEntryList[index]); delete (mEntryList[index]); if (&te) @@ -387,8 +386,18 @@ void LLPrimTextureList::setSize(S32 new_size) mEntryList.resize(new_size); for (S32 index = current_size; index < new_size; ++index) { - LLTextureEntry* new_entry = LLPrimTextureList::newTextureEntry(); - mEntryList[index] = new_entry; + if (current_size > 0 + && mEntryList[current_size - 1]) + { + // copy the last valid entry for the new one + mEntryList[index] = mEntryList[current_size - 1]->newCopy(); + } + else + { + // no valid enries to copy, so we new one up + LLTextureEntry* new_entry = LLPrimTextureList::newTextureEntry(); + mEntryList[index] = new_entry; + } } } else if (new_size < current_size) |
