diff options
author | Dave Parks <davep@lindenlab.com> | 2011-06-20 18:55:30 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-06-20 18:55:30 -0500 |
commit | ce02ed3118a8a84df9bcbf39b4a5531e5c698561 (patch) | |
tree | 548b4b6f0cfc2495c1d82612ae348187f426a95f /indra/llprimitive | |
parent | 27fb647fd1f1ad3280a0c848e2fcb3963a9e40ca (diff) |
SH-1880 partial fix for crashing on daes without UVs.
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 859dcbd489..8f2f24b747 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1414,13 +1414,19 @@ LLSD LLModel::writeModel( U32 tc_idx = 0; LLVector2* ftc = (LLVector2*) face.mTexCoords; - LLVector2 min_tc = ftc[0]; - LLVector2 max_tc = min_tc; - - //get texture coordinate domain - for (U32 j = 0; j < face.mNumVertices; ++j) + LLVector2 min_tc; + LLVector2 max_tc; + + if (ftc) { - update_min_max(min_tc, max_tc, ftc[j]); + min_tc = ftc[0]; + max_tc = min_tc; + + //get texture coordinate domain + for (U32 j = 0; j < face.mNumVertices; ++j) + { + update_min_max(min_tc, max_tc, ftc[j]); + } } LLVector2 tc_range = max_tc - min_tc; @@ -1457,8 +1463,7 @@ LLSD LLModel::writeModel( normals[norm_idx++] = buff[1]; } } - - + F32* src_tc = (F32*) face.mTexCoords[j].mV; //texcoord |