@@ -385,6 +385,11 @@ S32 LLPrimitive::setTEBumpmap(const U8 index, const U8 bump)
385385 return mTextureList .setBumpMap (index, bump);
386386}
387387
388+ S32 LLPrimitive::setTEAlphaGamma (const U8 index, const U8 gamma)
389+ {
390+ return mTextureList .setAlphaGamma (index, gamma);
391+ }
392+
388393S32 LLPrimitive::setTEBumpShiny (const U8 index, const U8 bump_shiny)
389394{
390395 updateNumBumpmap (index, bump_shiny);
@@ -1213,6 +1218,7 @@ bool LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
12131218 S16 offset_t [MAX_TES];
12141219 S16 image_rot[MAX_TES];
12151220 U8 bump[MAX_TES];
1221+ U8 alpha_gamma[MAX_TES];
12161222 U8 media_flags[MAX_TES];
12171223 U8 glow[MAX_TES];
12181224 U8 material_data[MAX_TES*16 ];
@@ -1251,6 +1257,7 @@ bool LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
12511257 offset_t [face_index] = (S16) ll_round ((llclamp (te->mOffsetT ,-1 .0f ,1 .0f ) * (F32)0x7FFF )) ;
12521258 image_rot[face_index] = (S16) ll_round (((fmod (te->mRotation , F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
12531259 bump[face_index] = te->getBumpShinyFullbright ();
1260+ alpha_gamma[face_index] = te->getAlphaGamma ();
12541261 media_flags[face_index] = te->getMediaTexGen ();
12551262 glow[face_index] = (U8) ll_round ((llclamp (te->getGlow (), 0 .0f , 1 .0f ) * (F32)0xFF ));
12561263
@@ -1278,7 +1285,10 @@ bool LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
12781285 *cur_ptr++ = 0 ;
12791286 cur_ptr += packTEField (cur_ptr, (U8 *)glow, 1 ,last_face_index, MVT_U8);
12801287 *cur_ptr++ = 0 ;
1281- cur_ptr += packTEField (cur_ptr, (U8 *)material_data, 16 , last_face_index, MVT_LLUUID);
1288+ cur_ptr += packTEField (cur_ptr, (U8 *) material_data, 16 , last_face_index, MVT_LLUUID);
1289+ *cur_ptr++ = 0 ;
1290+ *cur_ptr++ = 0x01 ;
1291+ cur_ptr += packTEField (cur_ptr, (U8 *) alpha_gamma, 1 , last_face_index, MVT_U8);
12821292 }
12831293 mesgsys->addBinaryDataFast (_PREHASH_TextureEntry, packed_buffer, (S32)(cur_ptr - packed_buffer));
12841294
@@ -1298,6 +1308,7 @@ bool LLPrimitive::packTEMessage(LLDataPacker &dp) const
12981308 S16 offset_t [MAX_TES];
12991309 S16 image_rot[MAX_TES];
13001310 U8 bump[MAX_TES];
1311+ U8 alpha_gamma[MAX_TES];
13011312 U8 media_flags[MAX_TES];
13021313 U8 glow[MAX_TES];
13031314 U8 material_data[MAX_TES*16 ];
@@ -1336,6 +1347,7 @@ bool LLPrimitive::packTEMessage(LLDataPacker &dp) const
13361347 offset_t [face_index] = (S16) ll_round ((llclamp (te->mOffsetT ,-1 .0f ,1 .0f ) * (F32)0x7FFF )) ;
13371348 image_rot[face_index] = (S16) ll_round (((fmod (te->mRotation , F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
13381349 bump[face_index] = te->getBumpShinyFullbright ();
1350+ alpha_gamma[face_index] = te->getAlphaGamma ();
13391351 media_flags[face_index] = te->getMediaTexGen ();
13401352 glow[face_index] = (U8) ll_round ((llclamp (te->getGlow (), 0 .0f , 1 .0f ) * (F32)0xFF ));
13411353
@@ -1363,7 +1375,10 @@ bool LLPrimitive::packTEMessage(LLDataPacker &dp) const
13631375 *cur_ptr++ = 0 ;
13641376 cur_ptr += packTEField (cur_ptr, (U8 *)glow, 1 ,last_face_index, MVT_U8);
13651377 *cur_ptr++ = 0 ;
1366- cur_ptr += packTEField (cur_ptr, (U8 *)material_data, 16 , last_face_index, MVT_LLUUID);
1378+ cur_ptr += packTEField (cur_ptr, (U8 *) material_data, 16 , last_face_index, MVT_LLUUID);
1379+ *cur_ptr++ = 0 ;
1380+ *cur_ptr++ = 0x01 ;
1381+ cur_ptr += packTEField (cur_ptr, (U8 *) alpha_gamma, 1 , last_face_index, MVT_U8);
13671382 }
13681383
13691384 dp.packBinaryData (packed_buffer, (S32)(cur_ptr - packed_buffer), " TextureEntry" );
@@ -1420,7 +1435,8 @@ S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name
14201435 unpack_TEField<S16>(tec.image_rot , tec.face_count , cur_ptr, buffer_end, MVT_S16) &&
14211436 unpack_TEField<U8>(tec.bump , tec.face_count , cur_ptr, buffer_end, MVT_U8) &&
14221437 unpack_TEField<U8>(tec.media_flags , tec.face_count , cur_ptr, buffer_end, MVT_U8) &&
1423- unpack_TEField<U8>(tec.glow , tec.face_count , cur_ptr, buffer_end, MVT_U8)))
1438+ unpack_TEField<U8>(tec.glow , tec.face_count , cur_ptr, buffer_end, MVT_U8) &&
1439+ unpack_TEField<U8>(tec.alpha_gamma , tec.face_count , cur_ptr, buffer_end, MVT_U8)))
14241440 {
14251441 LL_WARNS (" TEXTUREENTRY" ) << " Failure parsing Texture Entry Message due to malformed TE Field! Dropping changes on the floor. " << LL_ENDL;
14261442 return 0 ;
@@ -1456,6 +1472,7 @@ S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec)
14561472 retval |= setTEMediaTexGen (i, tec.media_flags [i]);
14571473 retval |= setTEGlow (i, (F32)tec.glow [i] / (F32)0xFF );
14581474 retval |= setTEMaterialID (i, tec.material_ids [i]);
1475+ retval |= setTEAlphaGamma (i, tec.alpha_gamma [i]);
14591476
14601477 // Note: This is an optimization to send common colors (1.f, 1.f, 1.f, 1.f)
14611478 // as all zeros. However, the subtraction and addition must be done in unsigned
0 commit comments