diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-10-22 13:10:59 -0700 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-10-22 13:10:59 -0700 |
commit | b8ce05ed08a7db0825c04c217888814ef523027a (patch) | |
tree | cae04332048f649e1280d3bdc3d20f46df773e67 /indra/llprimitive/llprimtexturelist.cpp | |
parent | e5484e56b3c13e65bd31d7bf21c1cd3a2d9333f2 (diff) | |
parent | a464d469705aeae57fcdbfafa45e2bf592a182c5 (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) |