diff options
Diffstat (limited to 'indra')
64 files changed, 1227 insertions, 716 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index d336eeaabc..2da9aabcd4 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -40,6 +40,548 @@ #include "llimagedxt.h" #include "llmemory.h" +#include <boost/static_assert.hpp> +#include <boost/preprocessor.hpp> + +//.................................................................................. +//.................................................................................. +// Helper macrose's for generate cycle unwrap templates +//.................................................................................. +#define _UNROL_GEN_TPL_arg_0(arg) +#define _UNROL_GEN_TPL_arg_1(arg) arg + +#define _UNROL_GEN_TPL_comma_0 +#define _UNROL_GEN_TPL_comma_1 BOOST_PP_COMMA() +//.................................................................................. +#define _UNROL_GEN_TPL_ARGS_macro(z,n,seq) \ + BOOST_PP_CAT(_UNROL_GEN_TPL_arg_, BOOST_PP_MOD(n, 2))(BOOST_PP_SEQ_ELEM(n, seq)) BOOST_PP_CAT(_UNROL_GEN_TPL_comma_, BOOST_PP_AND(BOOST_PP_MOD(n, 2), BOOST_PP_NOT_EQUAL(BOOST_PP_INC(n), BOOST_PP_SEQ_SIZE(seq)))) + +#define _UNROL_GEN_TPL_ARGS(seq) \ + BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(seq), _UNROL_GEN_TPL_ARGS_macro, seq) +//.................................................................................. + +#define _UNROL_GEN_TPL_TYPE_ARGS_macro(z,n,seq) \ + BOOST_PP_SEQ_ELEM(n, seq) BOOST_PP_CAT(_UNROL_GEN_TPL_comma_, BOOST_PP_AND(BOOST_PP_MOD(n, 2), BOOST_PP_NOT_EQUAL(BOOST_PP_INC(n), BOOST_PP_SEQ_SIZE(seq)))) + +#define _UNROL_GEN_TPL_TYPE_ARGS(seq) \ + BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(seq), _UNROL_GEN_TPL_TYPE_ARGS_macro, seq) +//.................................................................................. +#define _UNROLL_GEN_TPL_foreach_ee(z, n, seq) \ + executor<n>(_UNROL_GEN_TPL_ARGS(seq)); + +#define _UNROLL_GEN_TPL(name, args_seq, operation, spec) \ + template<> struct name<spec> { \ + private: \ + template<S32 _idx> inline void executor(_UNROL_GEN_TPL_TYPE_ARGS(args_seq)) { \ + BOOST_PP_SEQ_ENUM(operation) ; \ + } \ + public: \ + inline void operator()(_UNROL_GEN_TPL_TYPE_ARGS(args_seq)) { \ + BOOST_PP_REPEAT(spec, _UNROLL_GEN_TPL_foreach_ee, args_seq) \ + } \ +}; +//.................................................................................. +#define _UNROLL_GEN_TPL_foreach_seq_macro(r, data, elem) \ + _UNROLL_GEN_TPL(BOOST_PP_SEQ_ELEM(0, data), BOOST_PP_SEQ_ELEM(1, data), BOOST_PP_SEQ_ELEM(2, data), elem) + +#define UNROLL_GEN_TPL(name, args_seq, operation, spec_seq) \ + /*general specialization - should not be implemented!*/ \ + template<U8> struct name { inline void operator()(_UNROL_GEN_TPL_TYPE_ARGS(args_seq)) { boost::static_assert(!"Should not be instantiated."); } }; \ + BOOST_PP_SEQ_FOR_EACH(_UNROLL_GEN_TPL_foreach_seq_macro, (name)(args_seq)(operation), spec_seq) +//.................................................................................. +//.................................................................................. + + +//.................................................................................. +// Generated unrolling loop templates with specializations +//.................................................................................. +//example: for(c = 0; c < ch; ++c) comp[c] = cx[0] = 0; +UNROLL_GEN_TPL(uroll_zeroze_cx_comp, (S32 *)(cx)(S32 *)(comp), (cx[_idx] = comp[_idx] = 0), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] >>= 4; +UNROLL_GEN_TPL(uroll_comp_rshftasgn_constval, (S32 *)(comp)(const S32)(cval), (comp[_idx] >>= cval), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] = (cx[c] >> 5) * yap; +UNROLL_GEN_TPL(uroll_comp_asgn_cx_rshft_cval_all_mul_val, (S32 *)(comp)(S32 *)(cx)(const S32)(cval)(S32)(val), (comp[_idx] = (cx[_idx] >> cval) * val), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] += (cx[c] >> 5) * Cy; +UNROLL_GEN_TPL(uroll_comp_plusasgn_cx_rshft_cval_all_mul_val, (S32 *)(comp)(S32 *)(cx)(const S32)(cval)(S32)(val), (comp[_idx] += (cx[_idx] >> cval) * val), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] += pix[c] * info.xapoints[x]; +UNROLL_GEN_TPL(uroll_inp_plusasgn_pix_mul_val, (S32 *)(comp)(const U8 *)(pix)(S32)(val), (comp[_idx] += pix[_idx] * val), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) cx[c] = pix[c] * info.xapoints[x]; +UNROLL_GEN_TPL(uroll_inp_asgn_pix_mul_val, (S32 *)(comp)(const U8 *)(pix)(S32)(val), (comp[_idx] = pix[_idx] * val), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] = ((cx[c] * info.yapoints[y]) + (comp[c] * (256 - info.yapoints[y]))) >> 16; +UNROLL_GEN_TPL(uroll_comp_asgn_cx_mul_apoint_plus_comp_mul_inv_apoint_allshifted_16_r, (S32 *)(comp)(S32 *)(cx)(S32)(apoint), (comp[_idx] = ((cx[_idx] * apoint) + (comp[_idx] * (256 - apoint))) >> 16), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] = (comp[c] + pix[c] * info.yapoints[y]) >> 8; +UNROLL_GEN_TPL(uroll_comp_asgn_comp_plus_pix_mul_apoint_allshifted_8_r, (S32 *)(comp)(const U8 *)(pix)(S32)(apoint), (comp[_idx] = (comp[_idx] + pix[_idx] * apoint) >> 8), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) comp[c] = ((comp[c]*(256 - info.xapoints[x])) + ((cx[c] * info.xapoints[x]))) >> 12; +UNROLL_GEN_TPL(uroll_comp_asgn_comp_mul_inv_apoint_plus_cx_mul_apoint_allshifted_12_r, (S32 *)(comp)(S32)(apoint)(S32 *)(cx), (comp[_idx] = ((comp[_idx] * (256-apoint)) + (cx[_idx] * apoint)) >> 12), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) *dptr++ = comp[c]&0xff; +UNROLL_GEN_TPL(uroll_uref_dptr_inc_asgn_comp_and_ff, (U8 *&)(dptr)(S32 *)(comp), (*dptr++ = comp[_idx]&0xff), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) *dptr++ = (sptr[info.xpoints[x]*ch + c])&0xff; +UNROLL_GEN_TPL(uroll_uref_dptr_inc_asgn_sptr_apoint_plus_idx_alland_ff, (U8 *&)(dptr)(const U8 *)(sptr)(S32)(apoint), (*dptr++ = sptr[apoint + _idx]&0xff), (1)(3)(4)); +//example: for(c = 0; c < ch; ++c) *dptr++ = (comp[c]>>10)&0xff; +UNROLL_GEN_TPL(uroll_uref_dptr_inc_asgn_comp_rshft_cval_and_ff, (U8 *&)(dptr)(S32 *)(comp)(const S32)(cval), (*dptr++ = (comp[_idx]>>cval)&0xff), (1)(3)(4)); +//.................................................................................. + + +template<U8 ch> +struct scale_info +{ +public: + std::vector<S32> xpoints; + std::vector<const U8*> ystrides; + std::vector<S32> xapoints, yapoints; + S32 xup_yup; + +public: + //unrolling loop types declaration + typedef uroll_zeroze_cx_comp<ch> uroll_zeroze_cx_comp_t; + typedef uroll_comp_rshftasgn_constval<ch> uroll_comp_rshftasgn_constval_t; + typedef uroll_comp_asgn_cx_rshft_cval_all_mul_val<ch> uroll_comp_asgn_cx_rshft_cval_all_mul_val_t; + typedef uroll_comp_plusasgn_cx_rshft_cval_all_mul_val<ch> uroll_comp_plusasgn_cx_rshft_cval_all_mul_val_t; + typedef uroll_inp_plusasgn_pix_mul_val<ch> uroll_inp_plusasgn_pix_mul_val_t; + typedef uroll_inp_asgn_pix_mul_val<ch> uroll_inp_asgn_pix_mul_val_t; + typedef uroll_comp_asgn_cx_mul_apoint_plus_comp_mul_inv_apoint_allshifted_16_r<ch> uroll_comp_asgn_cx_mul_apoint_plus_comp_mul_inv_apoint_allshifted_16_r_t; + typedef uroll_comp_asgn_comp_plus_pix_mul_apoint_allshifted_8_r<ch> uroll_comp_asgn_comp_plus_pix_mul_apoint_allshifted_8_r_t; + typedef uroll_comp_asgn_comp_mul_inv_apoint_plus_cx_mul_apoint_allshifted_12_r<ch> uroll_comp_asgn_comp_mul_inv_apoint_plus_cx_mul_apoint_allshifted_12_r_t; + typedef uroll_uref_dptr_inc_asgn_comp_and_ff<ch> uroll_uref_dptr_inc_asgn_comp_and_ff_t; + typedef uroll_uref_dptr_inc_asgn_sptr_apoint_plus_idx_alland_ff<ch> uroll_uref_dptr_inc_asgn_sptr_apoint_plus_idx_alland_ff_t; + typedef uroll_uref_dptr_inc_asgn_comp_rshft_cval_and_ff<ch> uroll_uref_dptr_inc_asgn_comp_rshft_cval_and_ff_t; + +public: + scale_info(const U8 *src, U32 srcW, U32 srcH, U32 dstW, U32 dstH, U32 srcStride) + : xup_yup((dstW >= srcW) + ((dstH >= srcH) << 1)) + { + calc_x_points(srcW, dstW); + calc_y_strides(src, srcStride, srcH, dstH); + calc_aa_points(srcW, dstW, xup_yup&1, xapoints); + calc_aa_points(srcH, dstH, xup_yup&2, yapoints); + } + +private: + //........................................................................................... + void calc_x_points(U32 srcW, U32 dstW) + { + xpoints.resize(dstW+1); + + S32 val = dstW >= srcW ? 0x8000 * srcW / dstW - 0x8000 : 0; + S32 inc = (srcW << 16) / dstW; + + for(U32 i = 0, j = 0; i < dstW; ++i, ++j, val += inc) + { + xpoints[j] = llmax(0, val >> 16); + } + } + //........................................................................................... + void calc_y_strides(const U8 *src, U32 srcStride, U32 srcH, U32 dstH) + { + ystrides.resize(dstH+1); + + S32 val = dstH >= srcH ? 0x8000 * srcH / dstH - 0x8000 : 0; + S32 inc = (srcH << 16) / dstH; + + for(U32 i = 0, j = 0; i < dstH; ++i, ++j, val += inc) + { + ystrides[j] = src + llmax(0, val >> 16) * srcStride; + } + } + //........................................................................................... + void calc_aa_points(U32 srcSz, U32 dstSz, bool scale_up, std::vector<S32> &vp) + { + vp.resize(dstSz); + + if(scale_up) + { + S32 val = 0x8000 * srcSz / dstSz - 0x8000; + S32 inc = (srcSz << 16) / dstSz; + U32 pos; + + for(U32 i = 0, j = 0; i < dstSz; ++i, ++j, val += inc) + { + pos = val >> 16; + + if (pos < 0) + vp[j] = 0; + else if (pos >= (srcSz - 1)) + vp[j] = 0; + else + vp[j] = (val >> 8) - ((val >> 8) & 0xffffff00); + } + } + else + { + S32 inc = (srcSz << 16) / dstSz; + S32 Cp = ((dstSz << 14) / srcSz) + 1; + S32 ap; + + for(U32 i = 0, j = 0, val = 0; i < dstSz; ++i, ++j, val += inc) + { + ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8; + vp[j] = ap | (Cp << 16); + } + } + } +}; + + +template<U8 ch> +inline void bilinear_scale( + const U8 *src, U32 srcW, U32 srcH, U32 srcStride + , U8 *dst, U32 dstW, U32 dstH, U32 dstStride + ) +{ + typedef scale_info<ch> scale_info_t; + + scale_info_t info(src, srcW, srcH, dstW, dstH, srcStride); + + const U8 *sptr; + U8 *dptr; + U32 x, y; + const U8 *pix; + + S32 cx[ch], comp[ch]; + + + if(3 == info.xup_yup) + { //scale x/y - up + for(y = 0; y < dstH; ++y) + { + dptr = dst + (y * dstStride); + sptr = info.ystrides[y]; + + if(0 < info.yapoints[y]) + { + for(x = 0; x < dstW; ++x) + { + //for(c = 0; c < ch; ++c) cx[c] = comp[c] = 0; + scale_info_t::uroll_zeroze_cx_comp_t()(cx, comp); + + if(0 < info.xapoints[x]) + { + pix = info.ystrides[y] + info.xpoints[x] * ch; + + //for(c = 0; c < ch; ++c) comp[c] = pix[c] * (256 - info.xapoints[x]); + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(comp, pix, 256 - info.xapoints[x]); + + pix += ch; + + //for(c = 0; c < ch; ++c) comp[c] += pix[c] * info.xapoints[x]; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(comp, pix, info.xapoints[x]); + + pix += srcStride; + + //for(c = 0; c < ch; ++c) cx[c] = pix[c] * info.xapoints[x]; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(cx, pix, info.xapoints[x]); + + pix -= ch; + + //for(c = 0; c < ch; ++c) { + // cx[c] += pix[c] * (256 - info.xapoints[x]); + // comp[c] = ((cx[c] * info.yapoints[y]) + (comp[c] * (256 - info.yapoints[y]))) >> 16; + // *dptr++ = comp[c]&0xff; + //} + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, 256 - info.xapoints[x]); + scale_info_t::uroll_comp_asgn_cx_mul_apoint_plus_comp_mul_inv_apoint_allshifted_16_r_t()(comp, cx, info.yapoints[y]); + scale_info_t::uroll_uref_dptr_inc_asgn_comp_and_ff_t()(dptr, comp); + } + else + { + pix = info.ystrides[y] + info.xpoints[x] * ch; + + //for(c = 0; c < ch; ++c) comp[c] = pix[c] * (256 - info.yapoints[y]); + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(comp, pix, 256-info.yapoints[y]); + + pix += srcStride; + + //for(c = 0; c < ch; ++c) { + // comp[c] = (comp[c] + pix[c] * info.yapoints[y]) >> 8; + // *dptr++ = comp[c]&0xff; + //} + scale_info_t::uroll_comp_asgn_comp_plus_pix_mul_apoint_allshifted_8_r_t()(comp, pix, info.yapoints[y]); + scale_info_t::uroll_uref_dptr_inc_asgn_comp_and_ff_t()(dptr, comp); + } + } + } + else + { + for(x = 0; x < dstW; ++x) + { + if(0 < info.xapoints[x]) + { + pix = info.ystrides[y] + info.xpoints[x] * ch; + + //for(c = 0; c < ch; ++c) { + // comp[c] = pix[c] * (256 - info.xapoints[x]); + // comp[c] = (comp[c] + pix[c] * info.xapoints[x]) >> 8; + // *dptr++ = comp[c]&0xff; + //} + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(comp, pix, 256 - info.xapoints[x]); + scale_info_t::uroll_comp_asgn_comp_plus_pix_mul_apoint_allshifted_8_r_t()(comp, pix, info.xapoints[x]); + scale_info_t::uroll_uref_dptr_inc_asgn_comp_and_ff_t()(dptr, comp); + } + else + { + //for(c = 0; c < ch; ++c) *dptr++ = (sptr[info.xpoints[x]*ch + c])&0xff; + scale_info_t::uroll_uref_dptr_inc_asgn_sptr_apoint_plus_idx_alland_ff_t()(dptr, sptr, info.xpoints[x]*ch); + } + } + } + } + } + else if(info.xup_yup == 1) + { //scaling down vertically + S32 Cy, j; + S32 yap; + + for(y = 0; y < dstH; y++) + { + Cy = info.yapoints[y] >> 16; + yap = info.yapoints[y] & 0xffff; + + dptr = dst + (y * dstStride); + + for(x = 0; x < dstW; x++) + { + pix = info.ystrides[y] + info.xpoints[x] * ch; + + //for(c = 0; c < ch; ++c) comp[c] = pix[c] * yap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(comp, pix, yap); + + pix += srcStride; + + for(j = (1 << 14) - yap; j > Cy; j -= Cy, pix += srcStride) + { + //for(c = 0; c < ch; ++c) comp[c] += pix[c] * Cy; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(comp, pix, Cy); + } + + if(j > 0) + { + //for(c = 0; c < ch; ++c) comp[c] += pix[c] * j; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(comp, pix, j); + } + + if(info.xapoints[x] > 0) + { + pix = info.ystrides[y] + info.xpoints[x]*ch + ch; + //for(c = 0; c < ch; ++c) cx[c] = pix[c] * yap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(cx, pix, yap); + + pix += srcStride; + for(j = (1 << 14) - yap; j > Cy; j -= Cy) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * Cy; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, Cy); + pix += srcStride; + } + + if(j > 0) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * j; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, j); + } + + //for(c = 0; c < ch; ++c) comp[c] = ((comp[c]*(256 - info.xapoints[x])) + ((cx[c] * info.xapoints[x]))) >> 12; + scale_info_t::uroll_comp_asgn_comp_mul_inv_apoint_plus_cx_mul_apoint_allshifted_12_r_t()(comp, info.xapoints[x], cx); + } + else + { + //for(c = 0; c < ch; ++c) comp[c] >>= 4; + scale_info_t::uroll_comp_rshftasgn_constval_t()(comp, 4); + } + + //for(c = 0; c < ch; ++c) *dptr++ = (comp[c]>>10)&0xff; + scale_info_t::uroll_uref_dptr_inc_asgn_comp_rshft_cval_and_ff_t()(dptr, comp, 10); + } + } + } + else if(info.xup_yup == 2) + { // scaling down horizontally + S32 Cx, j; + S32 xap; + + for(y = 0; y < dstH; y++) + { + dptr = dst + (y * dstStride); + + for(x = 0; x < dstW; x++) + { + Cx = info.xapoints[x] >> 16; + xap = info.xapoints[x] & 0xffff; + + pix = info.ystrides[y] + info.xpoints[x] * ch; + + //for(c = 0; c < ch; ++c) comp[c] = pix[c] * xap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(comp, pix, xap); + + pix+=ch; + for(j = (1 << 14) - xap; j > Cx; j -= Cx) + { + //for(c = 0; c < ch; ++c) comp[c] += pix[c] * Cx; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(comp, pix, Cx); + pix+=ch; + } + + if(j > 0) + { + //for(c = 0; c < ch; ++c) comp[c] += pix[c] * j; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(comp, pix, j); + } + + if(info.yapoints[y] > 0) + { + pix = info.ystrides[y] + info.xpoints[x]*ch + srcStride; + //for(c = 0; c < ch; ++c) cx[c] = pix[c] * xap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(cx, pix, xap); + + pix+=ch; + for(j = (1 << 14) - xap; j > Cx; j -= Cx) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * Cx; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, Cx); + pix+=ch; + } + + if(j > 0) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * j; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, j); + } + + //for(c = 0; c < ch; ++c) comp[c] = ((comp[c] * (256 - info.yapoints[y])) + ((cx[c] * info.yapoints[y]))) >> 12; + scale_info_t::uroll_comp_asgn_comp_mul_inv_apoint_plus_cx_mul_apoint_allshifted_12_r_t()(comp, info.yapoints[y], cx); + } + else + { + //for(c = 0; c < ch; ++c) comp[c] >>= 4; + scale_info_t::uroll_comp_rshftasgn_constval_t()(comp, 4); + } + + //for(c = 0; c < ch; ++c) *dptr++ = (comp[c]>>10)&0xff; + scale_info_t::uroll_uref_dptr_inc_asgn_comp_rshft_cval_and_ff_t()(dptr, comp, 10); + } + } + } + else + { //scale x/y - down + S32 Cx, Cy, i, j; + S32 xap, yap; + + for(y = 0; y < dstH; y++) + { + Cy = info.yapoints[y] >> 16; + yap = info.yapoints[y] & 0xffff; + + dptr = dst + (y * dstStride); + for(x = 0; x < dstW; x++) + { + Cx = info.xapoints[x] >> 16; + xap = info.xapoints[x] & 0xffff; + + sptr = info.ystrides[y] + info.xpoints[x] * ch; + pix = sptr; + sptr += srcStride; + + //for(c = 0; c < ch; ++c) cx[c] = pix[c] * xap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(cx, pix, xap); + + pix+=ch; + for(i = (1 << 14) - xap; i > Cx; i -= Cx) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * Cx; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, Cx); + pix+=ch; + } + + if(i > 0) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * i; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, i); + } + + //for(c = 0; c < ch; ++c) comp[c] = (cx[c] >> 5) * yap; + scale_info_t::uroll_comp_asgn_cx_rshft_cval_all_mul_val_t()(comp, cx, 5, yap); + + for(j = (1 << 14) - yap; j > Cy; j -= Cy) + { + pix = sptr; + sptr += srcStride; + + //for(c = 0; c < ch; ++c) cx[c] = pix[c] * xap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(cx, pix, xap); + + pix+=ch; + for(i = (1 << 14) - xap; i > Cx; i -= Cx) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * Cx; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, Cx); + pix+=ch; + } + + if(i > 0) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * i; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, i); + } + + //for(c = 0; c < ch; ++c) comp[c] += (cx[c] >> 5) * Cy; + scale_info_t::uroll_comp_plusasgn_cx_rshft_cval_all_mul_val_t()(comp, cx, 5, Cy); + } + + if(j > 0) + { + pix = sptr; + sptr += srcStride; + + //for(c = 0; c < ch; ++c) cx[c] = pix[c] * xap; + scale_info_t::uroll_inp_asgn_pix_mul_val_t()(cx, pix, xap); + + pix+=ch; + for(i = (1 << 14) - xap; i > Cx; i -= Cx) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * Cx; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, Cx); + pix+=ch; + } + + if(i > 0) + { + //for(c = 0; c < ch; ++c) cx[c] += pix[c] * i; + scale_info_t::uroll_inp_plusasgn_pix_mul_val_t()(cx, pix, i); + } + + //for(c = 0; c < ch; ++c) comp[c] += (cx[c] >> 5) * j; + scale_info_t::uroll_comp_plusasgn_cx_rshft_cval_all_mul_val_t()(comp, cx, 5, j); + } + + //for(c = 0; c < ch; ++c) *dptr++ = (comp[c]>>23)&0xff; + scale_info_t::uroll_uref_dptr_inc_asgn_comp_rshft_cval_and_ff_t()(dptr, comp, 23); + } + } + } //else +} + +//wrapper +static void bilinear_scale(const U8 *src, U32 srcW, U32 srcH, U32 srcCh, U32 srcStride, U8 *dst, U32 dstW, U32 dstH, U32 dstCh, U32 dstStride) +{ + llassert(srcCh == dstCh); + + switch(srcCh) + { + case 1: + bilinear_scale<1>(src, srcW, srcH, srcStride, dst, dstW, dstH, dstStride); + break; + case 3: + bilinear_scale<3>(src, srcW, srcH, srcStride, dst, dstW, dstH, dstStride); + break; + case 4: + bilinear_scale<4>(src, srcW, srcH, srcStride, dst, dstW, dstH, dstStride); + break; + default: + llassert(!"Implement if need"); + break; + } + +} + //--------------------------------------------------------------------------- // LLImage //--------------------------------------------------------------------------- @@ -559,6 +1101,7 @@ void LLImageRaw::composite( LLImageRaw* src ) } } + // Src and dst can be any size. Src has 4 components. Dst has 3 components. void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) { @@ -589,21 +1132,6 @@ void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) // Src and dst are same size. Src has 4 components. Dst has 3 components. void LLImageRaw::compositeUnscaled4onto3( LLImageRaw* src ) { - /* - //test fastFractionalMult() - { - U8 i = 255; - U8 j = 255; - do - { - do - { - llassert( fastFractionalMult(i, j) == (U8)(255*(i/255.f)*(j/255.f) + 0.5f) ); - } while( j-- ); - } while( i-- ); - } - */ - LLImageRaw* dst = this; // Just for clarity. llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); @@ -639,6 +1167,7 @@ void LLImageRaw::compositeUnscaled4onto3( LLImageRaw* src ) } } + void LLImageRaw::copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill) { LLImageRaw* dst = this; // Just for clarity. @@ -846,6 +1375,12 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) return; } + bilinear_scale( + src->getData(), src->getWidth(), src->getHeight(), src->getComponents(), src->getWidth()*src->getComponents() + , dst->getData(), dst->getWidth(), dst->getHeight(), dst->getComponents(), dst->getWidth()*dst->getComponents() + ); + + /* S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents(); llassert_always(temp_data_size > 0); std::vector<U8> temp_buffer(temp_data_size); @@ -861,6 +1396,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) { copyLineScaled( &temp_buffer[0] + (getComponents() * src->getWidth() * row), dst->getData() + (getComponents() * dst->getWidth() * row), src->getWidth(), dst->getWidth(), 1, 1 ); } + */ } @@ -880,6 +1416,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) if (scale_image_data) { + /* S32 temp_data_size = old_width * new_height * getComponents(); llassert_always(temp_data_size > 0); std::vector<U8> temp_buffer(temp_data_size); @@ -899,6 +1436,19 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) { copyLineScaled( &temp_buffer[0] + (getComponents() * old_width * row), new_buffer + (getComponents() * new_width * row), old_width, new_width, 1, 1 ); } + */ + + S32 new_data_size = new_width * new_height * getComponents(); + llassert_always(new_data_size > 0); + + U8 *new_data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), new_data_size); + if(NULL == new_data) + { + return FALSE; + } + + bilinear_scale(getData(), old_width, old_height, getComponents(), old_width*getComponents(), new_data, new_width, new_height, getComponents(), new_width*getComponents()); + setDataAndSize(new_data, new_width, new_height, getComponents()); } else { diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 6f858cdeb3..308e83963d 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1775,6 +1775,11 @@ void LLTabContainer::onNextBtn( const LLSD& data ) scrollNext(); } mScrolled = FALSE; + + if(mCurrentTabIdx < mTabList.size()-1) + { + selectNextTab(); + } } void LLTabContainer::onNextBtnHeld( const LLSD& data ) @@ -1783,6 +1788,11 @@ void LLTabContainer::onNextBtnHeld( const LLSD& data ) { mScrollTimer.reset(); scrollNext(); + + if(mCurrentTabIdx < mTabList.size()-1) + { + selectNextTab(); + } mScrolled = TRUE; } } @@ -1794,6 +1804,11 @@ void LLTabContainer::onPrevBtn( const LLSD& data ) scrollPrev(); } mScrolled = FALSE; + + if(mCurrentTabIdx > 0) + { + selectPrevTab(); + } } void LLTabContainer::onJumpFirstBtn( const LLSD& data ) @@ -1812,6 +1827,11 @@ void LLTabContainer::onPrevBtnHeld( const LLSD& data ) { mScrollTimer.reset(); scrollPrev(); + + if(mCurrentTabIdx > 0) + { + selectPrevTab(); + } mScrolled = TRUE; } } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3193300ebb..103c5b6047 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2065,8 +2065,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para // output the styled Url appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly()); - // show query part of url with gray color if enabled in global settings in "ShowGreyQueryInUrls" - // and only for LLUrlEntryHTTP and LLUrlEntryHTTPNoProtocol url entries + // show query part of url with gray color only for LLUrlEntryHTTP and LLUrlEntryHTTPNoProtocol url entries std::string label = match.getQuery(); if (label.size()) { diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index acc8fdacfb..e18d7405ab 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -49,7 +49,6 @@ std::string localize_slapp_label(const std::string& url, const std::string& full LLUrlEntryBase::LLUrlEntryBase() { - mGreyQuery = LLUI::sSettingGroups["config"]->getBOOL("ShowGreyQueryInUrls"); } LLUrlEntryBase::~LLUrlEntryBase() @@ -206,11 +205,8 @@ std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const LLUriParser up(unescapeUrl(url)); std::string query; - if (mGreyQuery) - { - up.extractParts(); - up.glueSecond(query); - } + up.extractParts(); + up.glueSecond(query); return query; } diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 57e374f5bd..ddfc33ab78 100755 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -130,7 +130,6 @@ protected: std::string mMenuName; std::string mTooltip; std::multimap<std::string, LLUrlEntryObserver> mObservers; - bool mGreyQuery; }; /// diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 154f3b5726..a7c5dbff82 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -458,7 +458,6 @@ set(viewer_SOURCE_FILES llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp llpanelsnapshotoptions.cpp - llpanelsnapshotpostcard.cpp llpanelsnapshotprofile.cpp llpanelteleporthistory.cpp llpaneltiptoast.cpp diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 269b357b80..e20cc77ed3 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14116,6 +14116,17 @@ <key>Value</key> <integer>-1</integer> </map> + <key>MaxFPS</key> + <map> + <key>Comment</key> + <string>Yield some time to the local host if we reach a threshold framerate.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>-1.0</real> + </map> <key>ForcePeriodicRenderingTime</key> <map> <key>Comment</key> @@ -15607,17 +15618,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowGreyQueryInUrls</key> - <map> - <key>Comment</key> - <string>Enable(disable) appearance of port, query and fragment parts of url for HTTP and HTTPNoProtocol entries in grey.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> </map> </llsd> diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d7ef5fcba7..c6971edf9f 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1730,9 +1730,15 @@ bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id) { return false; } - + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false); - return gInventory.hasMatchingDirectDescendent(outfit_cat_id, is_worn); + gInventory.collectDescendentsIf(outfit_cat_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + is_worn); + return items.size() > 0; } // static diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index dc74f4a6ef..de349a03d4 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -330,24 +330,52 @@ void LLFace::dirtyTexture() { vobj->mLODChanged = TRUE; - LLVOAvatar* avatar = vobj->getAvatar(); - if (avatar) - { //avatar render cost may have changed - avatar->updateVisualComplexity(); - } + LLVOAvatar* avatar = vobj->getAvatar(); + if (avatar) + { //avatar render cost may have changed + avatar->updateVisualComplexity(); + } } gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME, FALSE); } } } - + gPipeline.markTextured(drawablep); } +void LLFace::notifyAboutCreatingTexture(LLViewerTexture *texture) +{ + LLDrawable* drawablep = getDrawable(); + if(mVObjp.notNull() && mVObjp->getVolume()) + { + LLVOVolume *vobj = drawablep->getVOVolume(); + if(vobj && vobj->notifyAboutCreatingTexture(texture)) + { + gPipeline.markTextured(drawablep); + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME); + } + } +} + +void LLFace::notifyAboutMissingAsset(LLViewerTexture *texture) +{ + LLDrawable* drawablep = getDrawable(); + if(mVObjp.notNull() && mVObjp->getVolume()) + { + LLVOVolume *vobj = drawablep->getVOVolume(); + if(vobj && vobj->notifyAboutMissingAsset(texture)) + { + gPipeline.markTextured(drawablep); + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME); + } + } +} + void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); - + if(mTexture[ch] == new_texture) { return ; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index d3a561facc..ee545acb94 100755 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -218,7 +218,7 @@ public: void setHasMedia(bool has_media) { mHasMedia = has_media ;} BOOL hasMedia() const ; - BOOL switchTexture() ; + BOOL switchTexture() ; //vertex buffer tracking void setVertexBuffer(LLVertexBuffer* buffer); @@ -230,10 +230,13 @@ public: static U32 getRiggedDataMask(U32 type); + void notifyAboutCreatingTexture(LLViewerTexture *texture); + void notifyAboutMissingAsset(LLViewerTexture *texture); + public: //aligned members LLVector4a mExtents[2]; -private: +private: F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ); BOOL calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ; public: diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 035eb307c2..62d7efc8b2 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -82,6 +82,7 @@ void LLFloaterHardwareSettings::refresh() mVideoCardMem = gSavedSettings.getS32("TextureMemory"); mFogRatio = gSavedSettings.getF32("RenderFogRatio"); mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); + mCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) mFSAASamples); refreshEnabledState(); @@ -149,6 +150,7 @@ void LLFloaterHardwareSettings::refreshEnabledState() BOOL LLFloaterHardwareSettings::postBuild() { childSetAction("OK", onBtnOK, this); + childSetAction("Cancel", onBtnCancel, this); // Don't do this on Mac as their braindead GL versioning // sets this when 8x and 16x are indeed available @@ -179,18 +181,17 @@ void LLFloaterHardwareSettings::apply() void LLFloaterHardwareSettings::cancel() { - gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO); - gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); - gSavedSettings.setU32("RenderFSAASamples", mFSAASamples); - gSavedSettings.setF32("RenderGamma", mGamma); - gSavedSettings.setS32("TextureMemory", mVideoCardMem); - gSavedSettings.setF32("RenderFogRatio", mFogRatio); - gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup ); - closeFloater(); } // static +void LLFloaterHardwareSettings::onBtnCancel( void* userdata ) +{ + LLFloaterHardwareSettings *fp =(LLFloaterHardwareSettings *)userdata; + fp->cancel(); +} + +// static void LLFloaterHardwareSettings::onBtnOK( void* userdata ) { LLFloaterHardwareSettings *fp =(LLFloaterHardwareSettings *)userdata; @@ -198,4 +199,14 @@ void LLFloaterHardwareSettings::onBtnOK( void* userdata ) fp->closeFloater(false); } - +void LLFloaterHardwareSettings::onClose(bool app_quitting) +{ + gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO); + gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); + gSavedSettings.setU32("RenderFSAASamples", mFSAASamples); + gSavedSettings.setF32("RenderGamma", mGamma); + gSavedSettings.setS32("TextureMemory", mVideoCardMem); + gSavedSettings.setF32("RenderFogRatio", mFogRatio); + gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup ); + gSavedSettings.setBOOL("RenderCompressTextures", mCompressTextures ); +} diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h index 626771b1d2..11c27c266d 100755 --- a/indra/newview/llfloaterhardwaresettings.h +++ b/indra/newview/llfloaterhardwaresettings.h @@ -40,6 +40,7 @@ public: /*virtual*/ ~LLFloaterHardwareSettings(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void onClose(bool app_quitting); /// initialize all the callbacks for the menu void initCallbacks(void); @@ -47,6 +48,9 @@ public: /// OK button static void onBtnOK( void* userdata ); + /// Cancel button + static void onBtnCancel( void* userdata ); + //// menu management /// show off our menu @@ -76,6 +80,7 @@ protected: S32 mVideoCardMem; F32 mFogRatio; BOOL mProbeHardwareOnStartup; + BOOL mCompressTextures; private: }; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 3cef7958c2..3655f1ed3d 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -78,6 +78,8 @@ #include "llgroupactions.h" +const F64 COVENANT_REFRESH_TIME_SEC = 60.0f; + static std::string OWNER_ONLINE = "0"; static std::string OWNER_OFFLINE = "1"; static std::string OWNER_GROUP = "2"; @@ -2408,33 +2410,33 @@ void LLPanelLandAccess::refresh() cit != parcel->mAccessList.end(); ++cit) { const LLAccessEntry& entry = (*cit).second; - std::string suffix; + std::string prefix; if (entry.mTime != 0) { LLStringUtil::format_map_t args; S32 now = time(NULL); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; - suffix.assign(" ("); + prefix.assign(" ("); if (seconds >= 120) { args["[MINUTES]"] = llformat("%d", (seconds/60)); std::string buf = parent_floater->getString ("Minutes", args); - suffix.append(buf); + prefix.append(buf); } else if (seconds >= 60) { - suffix.append("1 " + parent_floater->getString("Minute")); + prefix.append("1 " + parent_floater->getString("Minute")); } else { args["[SECONDS]"] = llformat("%d", seconds); std::string buf = parent_floater->getString ("Seconds", args); - suffix.append(buf); + prefix.append(buf); } - suffix.append(" " + parent_floater->getString("Remaining") + ")"); + prefix.append(" " + parent_floater->getString("Remaining") + ") "); } - mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix); + mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, "", prefix); } mListAccess->sortByName(TRUE); } @@ -2454,33 +2456,33 @@ void LLPanelLandAccess::refresh() cit != parcel->mBanList.end(); ++cit) { const LLAccessEntry& entry = (*cit).second; - std::string suffix; + std::string prefix; if (entry.mTime != 0) { LLStringUtil::format_map_t args; S32 now = time(NULL); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; - suffix.assign(" ("); + prefix.assign(" ("); if (seconds >= 120) { args["[MINUTES]"] = llformat("%d", (seconds/60)); std::string buf = parent_floater->getString ("Minutes", args); - suffix.append(buf); + prefix.append(buf); } else if (seconds >= 60) { - suffix.append("1 " + parent_floater->getString("Minute")); + prefix.append("1 " + parent_floater->getString("Minute")); } else { args["[SECONDS]"] = llformat("%d", seconds); std::string buf = parent_floater->getString ("Seconds", args); - suffix.append(buf); + prefix.append(buf); } - suffix.append(" " + parent_floater->getString("Remaining") + ")"); + prefix.append(" " + parent_floater->getString("Remaining") + ") "); } - mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix); + mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, "", prefix); } mListBanned->sortByName(TRUE); } @@ -2883,14 +2885,23 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data) //--------------------------------------------------------------------------- LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel) : LLPanel(), - mParcel(parcel) -{ + mParcel(parcel), + mNextUpdateTime(0) +{ } LLPanelLandCovenant::~LLPanelLandCovenant() { } +BOOL LLPanelLandCovenant::postBuild() +{ + mLastRegionID = LLUUID::null; + mNextUpdateTime = 0; + + return TRUE; +} + // virtual void LLPanelLandCovenant::refresh() { @@ -2937,14 +2948,23 @@ void LLPanelLandCovenant::refresh() changeable_clause->setText(getString("can_not_change")); } } - - // send EstateCovenantInfo message - LLMessageSystem *msg = gMessageSystem; - msg->newMessage("EstateCovenantRequest"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); - msg->sendReliable(region->getHost()); + + if (mLastRegionID != region->getRegionID() + || mNextUpdateTime < LLTimer::getElapsedSeconds()) + { + // Request Covenant Info + // Note: LLPanelLandCovenant doesn't change Covenant's content and any + // changes made by Estate floater should be requested by Estate floater + LLMessageSystem *msg = gMessageSystem; + msg->newMessage("EstateCovenantRequest"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); + msg->sendReliable(region->getHost()); + + mLastRegionID = region->getRegionID(); + mNextUpdateTime = LLTimer::getElapsedSeconds() + COVENANT_REFRESH_TIME_SEC; + } } // static diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 1d9bd33720..92439b69a0 100755 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -391,6 +391,7 @@ class LLPanelLandCovenant public: LLPanelLandCovenant(LLSafeHandle<LLParcelSelection>& parcelp); virtual ~LLPanelLandCovenant(); + virtual BOOL postBuild(); void refresh(); static void updateCovenantText(const std::string& string); static void updateEstateName(const std::string& name); @@ -399,6 +400,10 @@ public: protected: LLSafeHandle<LLParcelSelection>& mParcel; + +private: + LLUUID mLastRegionID; + F64 mNextUpdateTime; //seconds since client start }; #endif diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 1d0ddc2ced..08a0b74494 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -169,11 +169,7 @@ LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getActiveSnapshotT name = spanel->getName(); } - if (name == "panel_snapshot_postcard") - { - type = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; - } - else if (name == "panel_snapshot_inventory") + if (name == "panel_snapshot_inventory") { type = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; } @@ -424,7 +420,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) } LLSnapshotLivePreview* previewp = getPreviewView(floater); - BOOL got_bytes = previewp && previewp->getDataSize() > 0; BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards @@ -447,10 +442,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) } floater->getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); - floater->getChild<LLUICtrl>("file_size_label")->setColor( - shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD - && got_bytes - && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); + floater->getChild<LLUICtrl>("file_size_label")->setColor(LLUIColorTable::instance().getColor( "LabelTextColor" )); // Update the width and height spinners based on the corresponding resolution combos. (?) switch(shot_type) @@ -460,11 +452,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); setResolution(floater, "profile_size_combo"); break; - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: - layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); - setResolution(floater, "postcard_size_combo"); - break; case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); @@ -1452,18 +1439,6 @@ const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal() return previewp->getPosTakenGlobal(); } -// static -void LLFloaterSnapshot::setAgentEmail(const std::string& email) -{ - LLFloaterSnapshot* instance = findInstance(); - if (instance) - { - LLSideTrayPanelContainer* panel_container = instance->getChild<LLSideTrayPanelContainer>("panel_container"); - LLPanel* postcard_panel = panel_container->getPanelByName("panel_snapshot_postcard"); - postcard_panel->notify(LLSD().with("agent-email", email)); - } -} - ///---------------------------------------------------------------------------- /// Class LLSnapshotFloaterView ///---------------------------------------------------------------------------- diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 0bb9474bb5..5bcf1d3099 100755 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -63,7 +63,6 @@ public: static void postPanelSwitch(); static LLPointer<LLImageFormatted> getImageData(); static const LLVector3d& getPosTakenGlobal(); - static void setAgentEmail(const std::string& email); static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); } diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 56e671d902..86f9da6318 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1970,7 +1970,8 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); if (!gdatap) return; - + + gdatap->clearBanList(); LLSD::map_const_iterator i = content["ban_list"].beginMap(); LLSD::map_const_iterator iEnd = content["ban_list"].endMap(); for(;i != iEnd; ++i) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 5d3a11e245..b8b6bdaa11 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1295,8 +1295,15 @@ void LLIMModel::sendMessage(const std::string& utf8_text, gAgent.sendReliableMessage(); } + bool is_group_chat = false; + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(im_session_id); + if(session) + { + is_group_chat = session->isGroupSessionType(); + } + // If there is a mute list and this is not a group chat... - if ( LLMuteList::getInstance() ) + if ( LLMuteList::getInstance() && !is_group_chat) { // ... the target should not be in our mute list for some message types. // Auto-remove them if present. @@ -1345,7 +1352,6 @@ void LLIMModel::sendMessage(const std::string& utf8_text, if (is_not_group_id) { - LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(im_session_id); if( session == 0)//??? shouldn't really happen { LLRecentPeople::instance().add(other_participant_id); diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 8d21fda8f9..cf04c5f7a5 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -862,11 +862,14 @@ void LLLocationInputCtrl::refreshParcelIcons() bool see_avs = current_parcel->getSeeAVs(); bool pathfinding_dynamic_enabled = agent_region->dynamicPathfindingEnabled(); + bool is_parcel_owner = (gAgent.getID() == current_parcel->getOwnerID()); + bool allow_group_modify = (gAgent.isInGroup(current_parcel->getGroupID()) && current_parcel->getAllowGroupModify()); + // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); mParcelIcon[FLY_ICON]->setVisible( !allow_fly ); mParcelIcon[PUSH_ICON]->setVisible( !allow_push ); - mParcelIcon[BUILD_ICON]->setVisible( !allow_build ); + mParcelIcon[BUILD_ICON]->setVisible( !allow_build && !is_parcel_owner && !allow_group_modify ); mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mParcelIcon[PATHFINDING_DIRTY_ICON]->setVisible(mIsNavMeshDirty); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 648056484e..9a0bd9d1bc 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -72,6 +72,7 @@ #include "bufferstream.h" #include "llfasttimer.h" #include "llcorehttputil.h" +#include "lltrans.h" #include "boost/lexical_cast.hpp" @@ -693,12 +694,16 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content, args["MESSAGE"] = message; args["IDENTIFIER"] = identifier; args["LABEL"] = model_name; - gMeshRepo.uploadError(args); // Log details. LL_WARNS(LOG_MESH) << "Error in stage: " << stage << ", Reason: " << status.toString() << " (" << status.toTerseString() << ")" << LL_ENDL; + + std::ostringstream details; + typedef std::set<std::string> mav_errors_set_t; + mav_errors_set_t mav_errors; + if (content.has("error")) { const LLSD& err = content["error"]; @@ -708,8 +713,11 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content, << "', message '" << err["message"].asString() << "', id '" << err["identifier"].asString() << "'" << LL_ENDL; + if (err.has("errors")) { + details << std::endl << std::endl; + S32 error_num = 0; const LLSD& err_list = err["errors"]; for (LLSD::array_const_iterator it = err_list.beginArray(); @@ -717,6 +725,13 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content, ++it) { const LLSD& err_entry = *it; + std::string message = err_entry["message"]; + + if (message.length() > 0) + { + mav_errors.insert(message); + } + LL_WARNS(LOG_MESH) << " error[" << error_num << "]:" << LL_ENDL; for (LLSD::map_const_iterator map_it = err_entry.beginMap(); map_it != err_entry.endMap(); @@ -733,6 +748,21 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content, { LL_WARNS(LOG_MESH) << "Bad response to mesh request, no additional error information available." << LL_ENDL; } + + mav_errors_set_t::iterator mav_errors_it = mav_errors.begin(); + for (; mav_errors_it != mav_errors.end(); ++mav_errors_it) + { + std::string mav_details = "Mav_Details_" + *mav_errors_it; + details << "Message: '" << *mav_errors_it << "': " << LLTrans::getString(mav_details) << std::endl << std::endl; + } + + std::string details_str = details.str(); + if (details_str.length() > 0) + { + args["DETAILS"] = details_str; + } + + gMeshRepo.uploadError(args); } LLMeshRepoThread::LLMeshRepoThread() diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 54e4c6c1da..79988a0800 100755 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -70,7 +70,7 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) // public LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, - BOOL enabled, const std::string& suffix) + BOOL enabled, const std::string& suffix, const std::string& prefix) { //LL_INFOS() << "LLNameListCtrl::addNameItem " << agent_id << LL_ENDL; @@ -79,7 +79,7 @@ LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPositi item.enabled = enabled; item.target = INDIVIDUAL; - return addNameItemRow(item, pos, suffix); + return addNameItemRow(item, pos, suffix, prefix); } // virtual, public @@ -291,7 +291,8 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p LLScrollListItem* LLNameListCtrl::addNameItemRow( const LLNameListCtrl::NameItem& name_item, EAddPosition pos, - const std::string& suffix) + const std::string& suffix, + const std::string& prefix) { LLUUID id = name_item.value().asUUID(); LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP); @@ -365,7 +366,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( LLScrollListCell* cell = item->getColumn(mNameColumnIndex); if (cell) { - cell->setValue(fullname); + cell->setValue(prefix + fullname); } dirtyColumns(); diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 2c40eeaaca..515962df7d 100755 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -129,11 +129,12 @@ public: // Add a user to the list by name. It will be added, the name // requested from the cache, and updated as necessary. LLScrollListItem* addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM, - BOOL enabled = TRUE, const std::string& suffix = LLStringUtil::null); + BOOL enabled = TRUE, const std::string& suffix = LLStringUtil::null, const std::string& prefix = LLStringUtil::null); LLScrollListItem* addNameItem(NameItem& item, EAddPosition pos = ADD_BOTTOM); /*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); - LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM, const std::string& suffix = LLStringUtil::null); + LLScrollListItem* addNameItemRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM, const std::string& suffix = LLStringUtil::null, + const std::string& prefix = LLStringUtil::null); // Add a user to the list by name. It will be added, the name // requested from the cache, and updated as necessary. diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index 76792cc6fd..cffda02aa0 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -97,6 +97,7 @@ void LLPanelGroupBulkImpl::callbackClickAdd(void* userdata) if(picker) { root_floater->addDependentFloater(picker); + LLGroupMgr::getInstance()->sendCapGroupMembersRequest(panelp->mImplementation->mGroupID); } } } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 34f3bbf73e..921757ded7 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -237,7 +237,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } } server_choice_combo->sortByName(); - server_choice_combo->addSeparator(ADD_TOP); LL_DEBUGS("AppInit")<<"adding current "<<current_grid<<LL_ENDL; server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(), current_grid, diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 5fd575ee8b..8b927a0c6b 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1167,7 +1167,13 @@ void LLTaskNotecardBridge::openItem() { return; } - if(object->permModify() || gAgent.isGodlike()) + + // Note: even if we are not allowed to modify copyable notecard, we should be able to view it + LLInventoryItem *item = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID)); + BOOL item_copy = item && gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE); + if( item_copy + || object->permModify() + || gAgent.isGodlike()) { LLPreviewNotecard* preview = LLFloaterReg::showTypedInstance<LLPreviewNotecard>("preview_notecard", LLSD(mUUID), TAKE_FOCUS_YES); if (preview) diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index ed91d277dd..31238fdd48 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -53,6 +53,8 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" +const F64 COVENANT_REFRESH_TIME_SEC = 60.0f; + static LLPanelInjector<LLPanelPlaceProfile> t_place_profile("panel_place_profile"); // Statics for textures filenames @@ -76,6 +78,7 @@ static std::string icon_see_avs_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), + mNextCovenantUpdateTime(0), mForSalePanel(NULL), mYouAreHerePanel(NULL), mSelectedParcelID(-1), @@ -162,6 +165,9 @@ BOOL LLPanelPlaceProfile::postBuild() icon_see_avs_on = getString("icon_SeeAVs_On"); icon_see_avs_off = getString("icon_SeeAVs_Off"); + mLastSelectedRegionID = LLUUID::null; + mNextCovenantUpdateTime = 0; + return TRUE; } @@ -170,6 +176,9 @@ void LLPanelPlaceProfile::resetLocation() { LLPanelPlaceInfo::resetLocation(); + mLastSelectedRegionID = LLUUID::null; + mNextCovenantUpdateTime = 0; + mForSalePanel->setVisible(FALSE); mYouAreHerePanel->setVisible(FALSE); @@ -330,13 +339,20 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, if (!region || !parcel) return; - // send EstateCovenantInfo message - LLMessageSystem *msg = gMessageSystem; - msg->newMessage("EstateCovenantRequest"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); - msg->sendReliable(region->getHost()); + if (mLastSelectedRegionID != region->getRegionID() + || mNextCovenantUpdateTime < LLTimer::getElapsedSeconds()) + { + // send EstateCovenantInfo message + // Note: LLPanelPlaceProfile doesn't change Covenant's content and any + // changes made by Estate floater should be requested by Estate floater + LLMessageSystem *msg = gMessageSystem; + msg->newMessage("EstateCovenantRequest"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); + msg->sendReliable(region->getHost()); + mNextCovenantUpdateTime = LLTimer::getElapsedSeconds() + COVENANT_REFRESH_TIME_SEC; + } LLParcelData parcel_data; diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index 4547e14b2e..3d2654fc12 100755 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -71,6 +71,7 @@ private: */ S32 mSelectedParcelID; LLUUID mLastSelectedRegionID; + F64 mNextCovenantUpdateTime; //seconds since client start LLPanel* mForSalePanel; LLPanel* mYouAreHerePanel; diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 43e38b95e2..01dfdc4ece 100755 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -58,6 +58,8 @@ private: /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const; /*virtual*/ void updateControls(const LLSD& info); + S32 mLocalFormat; + void onFormatComboCommit(LLUICtrl* ctrl); void onQualitySliderCommit(LLUICtrl* ctrl); void onSaveFlyoutCommit(LLUICtrl* ctrl); @@ -67,6 +69,7 @@ static LLPanelInjector<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal") LLPanelSnapshotLocal::LLPanelSnapshotLocal() { + mLocalFormat = gSavedSettings.getS32("SnapshotFormat"); mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::cancel, this)); } @@ -83,6 +86,10 @@ BOOL LLPanelSnapshotLocal::postBuild() // virtual void LLPanelSnapshotLocal::onOpen(const LLSD& key) { + if(gSavedSettings.getS32("SnapshotFormat") != mLocalFormat) + { + getChild<LLComboBox>("local_format_combo")->selectNthItem(mLocalFormat); + } LLPanelSnapshot::onOpen(key); } @@ -129,6 +136,7 @@ void LLPanelSnapshotLocal::updateControls(const LLSD& info) void LLPanelSnapshotLocal::onFormatComboCommit(LLUICtrl* ctrl) { + mLocalFormat = getImageFormat(); // will call updateControls() LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); } diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 0fc9ceec83..f41bdd8881 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -56,7 +56,6 @@ private: void updateUploadCost(); void openPanel(const std::string& panel_name); void onSaveToProfile(); - void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); void onSendToFacebook(); @@ -69,7 +68,6 @@ static LLPanelInjector<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptio LLPanelSnapshotOptions::LLPanelSnapshotOptions() { mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); - mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this)); mCommitCallbackRegistrar.add("Snapshot.SendToFacebook", boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this)); @@ -120,11 +118,6 @@ void LLPanelSnapshotOptions::onSaveToProfile() openPanel("panel_snapshot_profile"); } -void LLPanelSnapshotOptions::onSaveToEmail() -{ - openPanel("panel_snapshot_postcard"); -} - void LLPanelSnapshotOptions::onSaveToInventory() { openPanel("panel_snapshot_inventory"); diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp deleted file mode 100755 index 8e37b1418c..0000000000 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/** - * @file llpanelsnapshotpostcard.cpp - * @brief Postcard sending panel. - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llcombobox.h" -#include "llnotificationsutil.h" -#include "llsidetraypanelcontainer.h" -#include "llsliderctrl.h" -#include "llspinctrl.h" -#include "lltexteditor.h" - -#include "llagent.h" -#include "llagentui.h" -#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model -#include "llpanelsnapshot.h" -#include "llpostcard.h" -#include "llviewercontrol.h" // gSavedSettings -#include "llviewerwindow.h" - -#include <boost/regex.hpp> - -/** - * Sends postcard via email. - */ -class LLPanelSnapshotPostcard -: public LLPanelSnapshot -{ - LOG_CLASS(LLPanelSnapshotPostcard); - -public: - LLPanelSnapshotPostcard(); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ S32 notify(const LLSD& info); - -private: - /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; } - /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; } - /*virtual*/ void updateControls(const LLSD& info); - - bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response); - void sendPostcard(); - - void onMsgFormFocusRecieved(); - void onFormatComboCommit(LLUICtrl* ctrl); - void onQualitySliderCommit(LLUICtrl* ctrl); - void onSend(); - - bool mHasFirstMsgFocus; - std::string mAgentEmail; -}; - -static LLPanelInjector<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpostcard"); - -LLPanelSnapshotPostcard::LLPanelSnapshotPostcard() -: mHasFirstMsgFocus(false) -{ - mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this)); - mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this)); - -} - -// virtual -BOOL LLPanelSnapshotPostcard::postBuild() -{ - // pick up the user's up-to-date email address - gAgent.sendAgentUserInfoRequest(); - - std::string name_string; - LLAgentUI::buildFullname(name_string); - getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string)); - - // For the first time a user focuses to .the msg box, all text will be selected. - getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(&LLPanelSnapshotPostcard::onMsgFormFocusRecieved, this)); - - getChild<LLUICtrl>("to_form")->setFocus(TRUE); - - getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotPostcard::onQualitySliderCommit, this, _1)); - - return LLPanelSnapshot::postBuild(); -} - -// virtual -void LLPanelSnapshotPostcard::onOpen(const LLSD& key) -{ - LLPanelSnapshot::onOpen(key); -} - -// virtual -S32 LLPanelSnapshotPostcard::notify(const LLSD& info) -{ - if (!info.has("agent-email")) - { - llassert(info.has("agent-email")); - return 0; - } - - if (mAgentEmail.empty()) - { - mAgentEmail = info["agent-email"].asString(); - } - - return 1; -} - -// virtual -void LLPanelSnapshotPostcard::updateControls(const LLSD& info) -{ - getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); - updateImageQualityLevel(); - - const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; - getChild<LLUICtrl>("send_btn")->setEnabled(have_snapshot); -} - -bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if(0 == option) - { - // User clicked OK - if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty()) - { - // Stuff the subject back into the form. - getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject")); - } - - if (!mHasFirstMsgFocus) - { - // The user never switched focus to the message window. - // Using the default string. - getChild<LLUICtrl>("msg_form")->setValue(getString("default_message")); - } - - sendPostcard(); - } - return false; -} - - -void LLPanelSnapshotPostcard::sendPostcard() -{ - std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); - std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString()); - - LLSD postcard = LLSD::emptyMap(); - postcard["pos-global"] = LLFloaterSnapshot::getPosTakenGlobal().getValue(); - postcard["to"] = to; - postcard["from"] = mAgentEmail; - postcard["name"] = getChild<LLUICtrl>("name_form")->getValue().asString(); - postcard["subject"] = subject; - postcard["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString(); - LLPostCard::send(LLFloaterSnapshot::getImageData(), postcard); - - // Give user feedback of the event. - gViewerWindow->playSnapshotAnimAndSound(); - - LLFloaterSnapshot::postSave(); -} - -void LLPanelSnapshotPostcard::onMsgFormFocusRecieved() -{ - LLTextEditor* msg_form = getChild<LLTextEditor>("msg_form"); - if (msg_form->hasFocus() && !mHasFirstMsgFocus) - { - mHasFirstMsgFocus = true; - msg_form->setText(LLStringUtil::null); - } -} - -void LLPanelSnapshotPostcard::onFormatComboCommit(LLUICtrl* ctrl) -{ - // will call updateControls() - LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); -} - -void LLPanelSnapshotPostcard::onQualitySliderCommit(LLUICtrl* ctrl) -{ - updateImageQualityLevel(); - - LLSliderCtrl* slider = (LLSliderCtrl*)ctrl; - S32 quality_val = llfloor((F32)slider->getValue().asReal()); - LLSD info; - info["image-quality-change"] = quality_val; - LLFloaterSnapshot::getInstance()->notify(info); // updates the "SnapshotQuality" setting -} - -void LLPanelSnapshotPostcard::onSend() -{ - // Validate input. - std::string to(getChild<LLUICtrl>("to_form")->getValue().asString()); - - boost::regex email_format("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); - - if (to.empty() || !boost::regex_match(to, email_format)) - { - LLNotificationsUtil::add("PromptRecipientEmail"); - return; - } - - if (mAgentEmail.empty() || !boost::regex_match(mAgentEmail, email_format)) - { - LLNotificationsUtil::add("PromptSelfEmail"); - return; - } - - std::string subject(getChild<LLUICtrl>("subject_form")->getValue().asString()); - if(subject.empty() || !mHasFirstMsgFocus) - { - LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLPanelSnapshotPostcard::missingSubjMsgAlertCallback, this, _1, _2)); - return; - } - - // Send postcard. - sendPostcard(); -} diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 109013498e..ac9a31ce4e 100755 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -313,11 +313,14 @@ void LLPanelTopInfoBar::updateParcelIcons() bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); bool see_avs = current_parcel->getSeeAVs(); + bool is_parcel_owner = (gAgent.getID() == current_parcel->getOwnerID()); + bool allow_group_modify = (gAgent.isInGroup(current_parcel->getGroupID()) && current_parcel->getAllowGroupModify()); + // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); mParcelIcon[FLY_ICON]->setVisible( !allow_fly ); mParcelIcon[PUSH_ICON]->setVisible( !allow_push ); - mParcelIcon[BUILD_ICON]->setVisible( !allow_build ); + mParcelIcon[BUILD_ICON]->setVisible( !allow_build && !is_parcel_owner && !allow_group_modify ); mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index bf2652cb49..fb21b980dc 100755 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -49,6 +49,7 @@ #include "llviewerinventory.h" #include "llviewerwindow.h" #include "lltrans.h" +#include "roles_constants.h" // Constants @@ -230,8 +231,23 @@ void LLPreview::refreshFromItem() } getChild<LLUICtrl>("desc")->setValue(item->getDescription()); - BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID()); - getChildView("desc")->setEnabled(can_agent_manipulate); + getChildView("desc")->setEnabled(canModify(mObjectUUID, item)); +} + +// static +BOOL LLPreview::canModify(const LLUUID taskUUID, const LLInventoryItem* item) +{ + if (taskUUID.notNull()) + { + LLViewerObject* object = gObjectList.findObject(taskUUID); + if(object && !object->permModify()) + { + // No permission to edit in-world inventory + return FALSE; + } + } + + return item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); } // static diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index 759430c3a5..49c114720b 100755 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -105,7 +105,11 @@ public: // llview /*virtual*/ void draw(); void refreshFromItem(); - + + // We can't modify Item or description in preview if either in-world Object + // or Item itself is unmodifiable + static BOOL canModify(const LLUUID taskUUID, const LLInventoryItem* item); + protected: virtual void onCommit(); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 1308d1e9a7..9f88b0db5f 100755 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -218,7 +218,7 @@ void LLPreviewNotecard::loadAsset() LLPermissions perm(item->getPermissions()); BOOL is_owner = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); BOOL allow_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); - BOOL allow_modify = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); + BOOL allow_modify = canModify(mObjectUUID, item); if (allow_copy || gAgent.isGodlike()) { @@ -338,10 +338,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, } previewEditor->makePristine(); - - const LLInventoryItem* item = preview->getItem(); - BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY, - item->getPermissions(), GP_OBJECT_MANIPULATE); + BOOL modifiable = preview->canModify(preview->mObjectID, preview->getItem()); preview->setEnabled(modifiable); preview->mAssetStatus = PREVIEW_ASSET_LOADED; } diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index 179a73413e..02912f12a9 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -39,6 +39,7 @@ #include "llspatialpartition.h" #include "llagent.h" #include "pipeline.h" +#include "llviewerparcelmgr.h" #include "llviewerpartsim.h" LLSceneMonitorView* gSceneMonitorView = NULL; @@ -702,6 +703,13 @@ LLSceneMonitorView::LLSceneMonitorView(const LLRect& rect) setCanMinimize(false); setCanClose(true); + + sTeleportFinishConnection = LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(boost::bind(&LLSceneMonitorView::onTeleportFinished, this)); +} + +LLSceneMonitorView::~LLSceneMonitorView() +{ + sTeleportFinishConnection.disconnect(); } void LLSceneMonitorView::onClose(bool app_quitting) @@ -714,6 +722,14 @@ void LLSceneMonitorView::onClickCloseBtn(bool app_quitting) setVisible(false); } +void LLSceneMonitorView::onTeleportFinished() +{ + if(isInVisibleChain()) + { + LLSceneMonitor::getInstance()->reset(); + } +} + void LLSceneMonitorView::onVisibilityChange(BOOL visible) { if (!LLGLSLShader::sNoFixedFunction && visible) diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index 5bde3b5aab..2b6ea57b96 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -64,10 +64,12 @@ public: void dumpToFile(std::string file_name); bool hasResults() const { return mSceneLoadRecording.getResults().getDuration() != S32Seconds(0);} + void reset(); + private: void freezeScene(); void unfreezeScene(); - void reset(); + LLRenderTarget& getCaptureTarget(); void generateDitheringTexture(S32 width, S32 height); @@ -109,7 +111,7 @@ class LLSceneMonitorView : public LLFloater { public: LLSceneMonitorView(const LLRect& rect); - + ~LLSceneMonitorView(); virtual void draw(); virtual void onVisibilityChange(BOOL visible); @@ -117,6 +119,8 @@ public: protected: virtual void onClose(bool app_quitting=false); virtual void onClickCloseBtn(bool app_quitting=false); + void onTeleportFinished(); + boost::signals2::connection sTeleportFinishConnection; }; extern LLSceneMonitorView* gSceneMonitorView; diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 050b88413d..234e922104 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -86,7 +86,7 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param mNeedsFlash(TRUE), mSnapshotQuality(gSavedSettings.getS32("SnapshotQuality")), mDataSize(0), - mSnapshotType(SNAPSHOT_POSTCARD), + mSnapshotType(SNAPSHOT_LOCAL), mSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))), mSnapshotUpToDate(FALSE), mCameraPos(LLViewerCamera::getInstance()->getOrigin()), diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index fed33bf37c..f479de59d4 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -42,7 +42,7 @@ class LLSnapshotLivePreview : public LLView public: enum ESnapshotType { - SNAPSHOT_POSTCARD, + SNAPSHOT_POSTCARD_DEPRECIATED, SNAPSHOT_TEXTURE, SNAPSHOT_LOCAL, SNAPSHOT_WEB diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0fbecd5180..056114cb6b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7109,7 +7109,6 @@ void process_user_info_reply(LLMessageSystem* msg, void**) msg->getString( "UserData", "DirectoryVisibility", dir_visibility); LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); - LLFloaterSnapshot::setAgentEmail(email); } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index faa58d423f..6666aecca2 100755 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -119,14 +119,14 @@ void LLGridManager::initialize(const std::string& grid_file) mGridFile = grid_file; // as we don't want an attacker to override our grid list // to point the default grid to an invalid grid - addSystemGrid("Second Life Main Grid (Agni)", + addSystemGrid(LLTrans::getString("AgniGridLabel"), MAINGRID, MAIN_GRID_LOGIN_URI, "https://secondlife.com/helpers/", DEFAULT_LOGIN_PAGE, SL_UPDATE_QUERY_URL, "Agni"); - addSystemGrid("Second Life Beta Test Grid (Aditi)", + addSystemGrid(LLTrans::getString("AditiGridLabel"), "util.aditi.lindenlab.com", "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", "http://aditi-secondlife.webdev.lindenlab.com/helpers/", diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4e2eef39d6..e684be4361 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -655,12 +655,36 @@ S8 LLViewerTexture::getType() const void LLViewerTexture::cleanup() { + notifyAboutMissingAsset(); + mFaceList[LLRender::DIFFUSE_MAP].clear(); mFaceList[LLRender::NORMAL_MAP].clear(); mFaceList[LLRender::SPECULAR_MAP].clear(); mVolumeList.clear(); } +void LLViewerTexture::notifyAboutCreatingTexture() +{ + for(U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + { + for(U32 f = 0; f < mNumFaces[ch]; f++) + { + mFaceList[ch][f]->notifyAboutCreatingTexture(this); + } + } +} + +void LLViewerTexture::notifyAboutMissingAsset() +{ + for(U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + { + for(U32 f = 0; f < mNumFaces[ch]; f++) + { + mFaceList[ch][f]->notifyAboutMissingAsset(this); + } + } +} + // virtual void LLViewerTexture::dump() { @@ -1281,7 +1305,7 @@ void LLViewerFetchedTexture::addToCreateTexture() llassert(mNumFaces[j] <= mFaceList[j].size()); for(U32 i = 0; i < mNumFaces[j]; i++) - { + { mFaceList[j][i]->dirtyTexture(); } } @@ -1431,9 +1455,11 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) destroyRawImage(); return FALSE; } - - res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); - + + res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); + + notifyAboutCreatingTexture(); + setActive(); if (!needsToSaveRawImage()) @@ -1441,6 +1467,7 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) mNeedsAux = FALSE; destroyRawImage(); } + return res; } @@ -2132,6 +2159,8 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) } if (is_missing) { + notifyAboutMissingAsset(); + if (mUrl.empty()) { LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 05912404e4..aed7e94945 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -169,9 +169,13 @@ public: /*virtual*/ void updateBindStatsForTester() ; protected: void cleanup() ; - void init(bool firstinit) ; + void init(bool firstinit) ; void reorganizeFaceList() ; void reorganizeVolumeList() ; + + void notifyAboutMissingAsset(); + void notifyAboutCreatingTexture(); + private: friend class LLBumpImageList; friend class LLUIImageList; @@ -307,10 +311,11 @@ public: void addToCreateTexture(); + // ONLY call from LLViewerTextureList BOOL createTexture(S32 usename = 0); - void destroyTexture() ; - + void destroyTexture() ; + virtual void processTextureStats() ; F32 calcDecodePriority() ; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b49543c158..fd2e96744a 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2040,27 +2040,228 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) return res; } +bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture) +{ //Ok, here we have confirmation about texture creation, check our wait-list + //and make changes, or return false + + std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); + + typedef std::map<U8, LLMaterialPtr> map_te_material; + map_te_material new_material; + + for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) + { + LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); + + //here we just interesting in DIFFUSE_MAP only! + if(LLRender::DIFFUSE_MAP == range_it->second.map && GL_RGBA != texture->getPrimaryFormat()) + { //ok let's check the diffuse mode + switch(cur_material->getDiffuseAlphaMode()) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { //uups... we have non 32 bit texture with LLMaterial::DIFFUSE_ALPHA_MODE_* => LLMaterial::DIFFUSE_ALPHA_MODE_NONE + + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + + } break; + } //switch + } //if + } //for + + //setup new materials + for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) + { + LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); + LLViewerObject::setTEMaterialParams(it->first, it->second); + } + + //clear wait-list + mWaitingTextureInfo.erase(range.first, range.second); + + return 0 != new_material.size(); +} + +bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture) +{ //Ok, here if we wait information about texture and it's missing + //then depending from the texture map (diffuse, normal, or specular) + //make changes in material and confirm it. If not return false. + std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); + if(range.first == range.second) return false; + + typedef std::map<U8, LLMaterialPtr> map_te_material; + map_te_material new_material; + + for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) + { + LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); + + switch(range_it->second.map) + { + case LLRender::DIFFUSE_MAP: + { + if(LLMaterial::DIFFUSE_ALPHA_MODE_NONE != cur_material->getDiffuseAlphaMode()) + { //missing texture + !LLMaterial::DIFFUSE_ALPHA_MODE_NONE => LLMaterial::DIFFUSE_ALPHA_MODE_NONE + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + } + } break; + case LLRender::NORMAL_MAP: + { //missing texture => reset material texture id + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setNormalID(LLUUID::null); + } break; + case LLRender::SPECULAR_MAP: + { //missing texture => reset material texture id + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setSpecularID(LLUUID::null); + } break; + case LLRender::NUM_TEXTURE_CHANNELS: + //nothing to do, make compiler happy + break; + } //switch + } //for + + //setup new materials + for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) + { + LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); + LLViewerObject::setTEMaterialParams(it->first, it->second); + } + + //clear wait-list + mWaitingTextureInfo.erase(range.first, range.second); + + return 0 != new_material.size(); +} + S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) { LLMaterialPtr pMaterial = const_cast<LLMaterialPtr&>(pMaterialParams); if(pMaterialParams) - { - LLViewerTexture* image = getTEImage(te); - LLGLenum image_format = image ? image->getPrimaryFormat() : GL_RGB; - LLMaterialPtr current_material = getTEMaterialParams(te); + { //check all of them according to material settings + + LLViewerTexture *img_diffuse = getTEImage(te); + LLViewerTexture *img_normal = getTENormalMap(te); + LLViewerTexture *img_specular = getTESpecularMap(te); + + llassert(NULL != img_diffuse); + + LLMaterialPtr new_material = NULL; + + //diffuse + if(NULL != img_diffuse) + { //guard + if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset()) + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te))); + } + else + { + bool bSetDiffuseNone = false; + if(img_diffuse->isMissingAsset()) + { + bSetDiffuseNone = true; + } + else + { + switch(pMaterialParams->getDiffuseAlphaMode()) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { //all of them modes available only for 32 bit textures + if(GL_RGBA != img_diffuse->getPrimaryFormat()) + { + bSetDiffuseNone = true; + } + } break; + } + } //else - U8 new_diffuse_alpha_mode = pMaterialParams->getDiffuseAlphaMode(); - if(new_diffuse_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + if(bSetDiffuseNone) + { //upps... we should substitute this material with LLMaterial::DIFFUSE_ALPHA_MODE_NONE + new_material = new LLMaterial(pMaterialParams->asLLSD()); + new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + } + } + } + + //normal + if(LLUUID::null != pMaterialParams->getNormalID()) { - new_diffuse_alpha_mode = (GL_RGB == image_format || 0 == image_format ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : new_diffuse_alpha_mode); + if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID()) + { + if(!new_material) { + new_material = new LLMaterial(pMaterialParams->asLLSD()); + } + new_material->setNormalID(LLUUID::null); + } + else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat()) + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te))); + } + + } + + + //specular + if(LLUUID::null != pMaterialParams->getSpecularID()) + { + if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID()) + { + if(!new_material) { + new_material = new LLMaterial(pMaterialParams->asLLSD()); + } + new_material->setSpecularID(LLUUID::null); + } + else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat()) + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te))); + } } - if(pMaterialParams->getDiffuseAlphaMode() != new_diffuse_alpha_mode) { - //create new material - pMaterial = new LLMaterial(pMaterialParams->asLLSD()); - pMaterial->setDiffuseAlphaMode(new_diffuse_alpha_mode); + if(new_material) { + pMaterial = new_material; LLMaterialMgr::getInstance()->put(getID(),te,*pMaterial); } } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 7503f8c5aa..bbaca316b0 100755 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -372,17 +372,37 @@ private: // statics public: - static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop + static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop static F32 sLODFactor; // LOD scale factor static F32 sDistanceFactor; // LOD distance factor - + static LLPointer<LLObjectMediaDataClient> sObjectMediaClient; static LLPointer<LLObjectMediaNavigateClient> sObjectMediaNavigateClient; protected: static S32 sNumLODChanges; - + friend class LLVolumeImplFlexible; + +public: + bool notifyAboutCreatingTexture(LLViewerTexture *texture); + bool notifyAboutMissingAsset(LLViewerTexture *texture); + +private: + struct material_info + { + LLRender::eTexIndex map; + U8 te; + + material_info(LLRender::eTexIndex map_, U8 te_) + : map(map_) + , te(te_) + {} + }; + + typedef std::multimap<LLUUID, material_info> mmap_UUID_MAP_t; + mmap_UUID_MAP_t mWaitingTextureInfo; + }; #endif // LL_LLVOVOLUME_H diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml deleted file mode 100755 index ead56f2885..0000000000 --- a/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - Postkarte aus [SECOND_LIFE]. - </string> - <string name="default_message"> - Sehen Sie mal! - </string> - <string name="upload_message"> - Senden... - </string> - <text name="title"> - E-Mail - </text> - <tab_container name="postcard_tabs"> - <panel name="panel_postcard_message" label="Nachricht"/> - <panel name="panel_postcard_settings" label="Einstellungen"/> - </tab_container> - <button name="cancel_btn" label="Abbrechen"/> - <button name="send_btn" label="Absenden"/> -</panel> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index a660e812cc..d72937ac63 100755 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -23,15 +23,15 @@ </floater.string> <floater.string name="Minutes"> - [MINUTES] minutes + [MINUTES] min. </floater.string> <floater.string name="Minute"> - minute + min. </floater.string> <floater.string name="Seconds"> - [SECONDS] seconds + [SECONDS] sec. </floater.string> <floater.string name="Remaining"> diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 9deb0d2030..dcd6d98581 100755 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -191,8 +191,18 @@ label="OK" label_selected="OK" layout="topleft" - left="-102" + right="-105" name="OK" top="192" width="90" /> + <button + follows="right|bottom" + height="22" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="5" + name="Cancel" + right="-10" + width="90" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 76adaad57c..514fb058b9 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -267,12 +267,6 @@ name="panel_snapshot_profile" filename="panel_snapshot_profile.xml" /> <panel - class="llpanelsnapshotpostcard" - follows="all" - layout="topleft" - name="panel_snapshot_postcard" - filename="panel_snapshot_postcard.xml" /> - <panel class="llpanelsnapshotinventory" follows="all" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1f816dc806..4602a41d52 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7772,9 +7772,8 @@ Select residents to share with. name="MeshUploadError" icon="alert.tga" type="alert"> - [LABEL] failed to upload: [MESSAGE] [IDENTIFIER] - -See the log file for details. + [LABEL] failed to upload: [MESSAGE] [IDENTIFIER] +[DETAILS]See SecondLife.log for details </notification> <notification diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index a258a874b0..a1e0f981dd 100755 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -119,7 +119,7 @@ name="At_My_Last_Location_Label" left_pad="8" bottom_delta="1" - width="120"> + width="110"> at last location </text> <combo_box @@ -157,7 +157,7 @@ follows="left|top" width="170" height="26" - left_pad="40" + left_pad="30" text_pad_left="8" name="location_edit" label="Type a location" @@ -186,12 +186,12 @@ height="26" max_chars="128" label="Select grid" - left_pad="40" + left_pad="30" bottom_delta="0" layout="topleft" top_pad="2" name="server_combo" - width="128" /> + width="148" /> </layout_panel> <layout_panel height="172" diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index 265217ef60..cb29e6a87a 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -107,21 +107,4 @@ <button.commit_callback function="Snapshot.SendToFlickr"/> </button> - <button - follows="left|top" - font="SansSerif" - halign="left" - height="22" - image_overlay="Snapshot_Email" - image_overlay_alignment="left" - image_top_pad="0" - imgoverlay_label_space="10" - label="Send via E-mail" - layout="topleft" - left_delta="0" - name="save_to_email_btn" - top_pad="5"> - <button.commit_callback - function="Snapshot.SaveToEmail" /> - </button> </panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml deleted file mode 100755 index 975b08be05..0000000000 --- a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - height="380" - layout="topleft" - name="panel_snapshot_postcard" - width="490"> - <string - name="default_subject"> - Postcard from [SECOND_LIFE]. - </string> - <string - name="default_message"> - Check this out! - </string> - <string - name="upload_message"> - Sending... - </string> - <icon - follows="top|left" - height="18" - image_name="Snapshot_Email" - layout="topleft" - left="12" - mouse_opaque="true" - name="title_icon" - top="7" - width="18" /> - <text - follows="top|left|right" - font="SansSerifBold" - height="14" - layout="topleft" - left_pad="12" - length="1" - name="title" - right="-10" - text_color="white" - type="string" - top_delta="2"> - E-mail - </text> - <view_border - bevel_style="in" - follows="left|top|right" - height="1" - left="9" - layout="topleft" - name="hr" - right="-5" - top_pad="5" - /> - <tab_container - name="postcard_tabs" - tab_group="1" - tab_min_width="97" - tab_height="21" - tab_position="top" - top_pad="7" - left="5" - right="-2" - height="319" - follows="all" - halign="center" - use_highlighting_on_hover="true"> - <panel - follows="all" - layout="topleft" - label="Message" - name="panel_postcard_message" - filename="panel_postcard_message.xml" /> - <panel - follows="all" - layout="topleft" - label="Settings" - name="panel_postcard_settings" - filename="panel_postcard_settings.xml" /> - </tab_container> - <button - follows="right|bottom" - height="23" - label="Cancel" - layout="topleft" - name="cancel_btn" - right="-6" - bottom="-20" - width="97"> - <button.commit_callback - function="Postcard.Cancel" /> - </button> - <button - follows="left|bottom" - height="23" - label="Send" - layout="topleft" - left="10" - name="send_btn" - top_delta="0" - width="97"> - <button.commit_callback - function="Postcard.Send" /> - </button> -</panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f77678e5f8..309f108ecc 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -96,7 +96,10 @@ Voice Server Version: [VOICE_VERSION] <string name="LoginFailed">Login failed.</string> <string name="Quit">Quit</string> <string name="create_account_url">http://join.secondlife.com/?sourceid=[sourceid]</string> - + + <string name="AgniGridLabel">Second Life Main Grid (Agni)</string> + <string name="AditiGridLabel">Second Life Beta Test Grid (Aditi)</string> + <string name="ViewerDownloadURL">http://secondlife.com/download</string> <string name="LoginFailedViewerNotPermitted"> The viewer you are using can no longer access Second Life. Please visit the following page to download a new viewer: @@ -4046,5 +4049,17 @@ Try enclosing path to the editor with double quotes. <string name="loading_chat_logs"> Loading... </string> - - </strings> + + <string name="Mav_Details_MAV_FOUND_DEGENERATE_TRIANGLES"> + The physics shape contains triangles which are too small. Try simplifying the physics model. + </string> + + <string name="Mav_Details_MAV_CONFIRMATION_DATA_MISMATCH"> + The physics shape contains bad confirmation data. Try to correct the physics model. + </string> + + <string name="Mav_Details_MAV_UNKNOWN_VERSION"> + The physics shape does not have correct version. Set the correct version for the physics model. + </string> + +</strings> diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml deleted file mode 100755 index 649d547ba0..0000000000 --- a/indra/newview/skins/default/xui/es/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - Postal desde [SECOND_LIFE]. - </string> - <string name="default_message"> - ¡Mira esto! - </string> - <string name="upload_message"> - Enviando... - </string> - <text name="title"> - Correo-e - </text> - <button label="Mensaje" name="message_btn"/> - <button label="Ajustes" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/fr/panel_login.xml b/indra/newview/skins/default/xui/fr/panel_login.xml index b39920fe13..1cb6d3c935 100755 --- a/indra/newview/skins/default/xui/fr/panel_login.xml +++ b/indra/newview/skins/default/xui/fr/panel_login.xml @@ -19,9 +19,9 @@ <combo_box.item label="Domicile" name="MyHome"/> </combo_box> <button label="Connexion" name="connect_favorite_btn"/> - <line_editor label="Tapez un emplacement" name="location_edit"/> + <line_editor label="Tapez un emplacement" name="location_edit" left_pad="20"/> <button label="Connexion" name="connect_location_btn"/> - <combo_box label="Sélectionner la grille" name="server_combo"/> + <combo_box label="Sélectionner la grille" name="server_combo" left_pad="20"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml deleted file mode 100755 index 82a4815144..0000000000 --- a/indra/newview/skins/default/xui/fr/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - Carte postale de [SECOND_LIFE]. - </string> - <string name="default_message"> - Ouvrez-moi ! - </string> - <string name="upload_message"> - Envoi en cours... - </string> - <text name="title"> - E-mail - </text> - <button label="Message" name="message_btn"/> - <button label="Paramètres" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml deleted file mode 100755 index 3703b97e6c..0000000000 --- a/indra/newview/skins/default/xui/it/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - Cartolina da [SECOND_LIFE]. - </string> - <string name="default_message"> - Dai un'occhiata! - </string> - <string name="upload_message"> - Invio... - </string> - <text name="title"> - E-mail - </text> - <button label="Messaggio" name="message_btn"/> - <button label="Impostazioni" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml deleted file mode 100755 index 1ddd723840..0000000000 --- a/indra/newview/skins/default/xui/ja/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - [SECOND_LIFE] からのポストカードです。 - </string> - <string name="default_message"> - ぜひご覧ください! - </string> - <string name="upload_message"> - 送信中... - </string> - <text name="title"> - メール - </text> - <button label="メッセージ" name="message_btn"/> - <button label="設定" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml deleted file mode 100755 index 12a648f600..0000000000 --- a/indra/newview/skins/default/xui/pt/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - Postal do [SECOND_LIFE]. - </string> - <string name="default_message"> - Confira! - </string> - <string name="upload_message"> - Enviando... - </string> - <text name="title"> - E-mail - </text> - <button label="Mensagem" name="message_btn"/> - <button label="Configurações" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml deleted file mode 100755 index 47f4caf8e3..0000000000 --- a/indra/newview/skins/default/xui/ru/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - Открытка из [SECOND_LIFE]. - </string> - <string name="default_message"> - Побывай здесь! - </string> - <string name="upload_message"> - Отправка... - </string> - <text name="title"> - Электронное письмо - </text> - <button label="Сообщение" name="message_btn"/> - <button label="Настройки" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml deleted file mode 100755 index e999678a0d..0000000000 --- a/indra/newview/skins/default/xui/tr/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - SECOND_LIFE]'dan posta kartı. - </string> - <string name="default_message"> - Buna bakın! - </string> - <string name="upload_message"> - Gönderiyor... - </string> - <text name="title"> - E-posta - </text> - <button label="İleti" name="message_btn"/> - <button label="Ayarlar" name="settings_btn"/> -</panel> diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml deleted file mode 100755 index 853a856104..0000000000 --- a/indra/newview/skins/default/xui/zh/panel_snapshot_postcard.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<panel name="panel_snapshot_postcard"> - <string name="default_subject"> - 來自 [SECOND_LIFE] 的明信片。 - </string> - <string name="default_message"> - 快來看看這個! - </string> - <string name="upload_message"> - 傳送中... - </string> - <text name="title"> - 電郵 - </text> - <button label="訊息" name="message_btn"/> - <button label="設定" name="settings_btn"/> -</panel> diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 2bc0d5a086..4694f657b6 100755 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -39,7 +39,21 @@ namespace static const char * const TEST_FILENAME("llslurl_test.xml"); } - + +// +// Stub implementation for LLTrans +// +class LLTrans +{ +public: + static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args); +}; + +std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) +{ + return std::string(); +} + //---------------------------------------------------------------------------- // Mock objects for the dependencies of the code we're testing diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 0eb0ab6500..e68da14fe9 100755 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -38,6 +38,31 @@ namespace static const char * const TEST_FILENAME("llviewernetwork_test.xml"); } + +// +// Stub implementation for LLTrans +// +class LLTrans +{ +public: + static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args); +}; + +std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) +{ + std::string grid_label = std::string(); + if(xml_desc == "AgniGridLabel") + { + grid_label = "Second Life Main Grid (Agni)"; + } + else if(xml_desc == "AditiGridLabel") + { + grid_label = "Second Life Beta Test Grid (Aditi)"; + } + + return grid_label; +} + //---------------------------------------------------------------------------- // Mock objects for the dependencies of the code we're testing |