diff options
| author | Steve Bennetts <steve@lindenlab.com> | 2009-10-19 17:31:05 -0700 |
|---|---|---|
| committer | Steve Bennetts <steve@lindenlab.com> | 2009-10-19 17:31:05 -0700 |
| commit | 1d5be6eca1969da3e6b923cbf5326d3bdc8b066f (patch) | |
| tree | a03a2e782f5022ebbbe1ef933e3a11c1b9de00a6 /indra/llprimitive/llprimtexturelist.cpp | |
| parent | 97d2b740d3e700d86665183d5fc5cfcb3efe72d6 (diff) | |
| parent | d78520f6b7fd4a20bbb1d1291a34761efc1fd740 (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) |
