diff options
153 files changed, 2477 insertions, 1768 deletions
| diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8d1c6b63e6..57faafc042 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -312,7 +312,7 @@ jobs:        AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}        AZURE_TENANT_ID:     ${{ secrets.AZURE_TENANT_ID }}      needs: build -    runs-on: windows +    runs-on: windows-large      steps:        - name: Sign and package Windows viewer          if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID @@ -412,7 +412,7 @@ jobs:        - uses: actions/download-artifact@v4          with:            pattern: "*-metadata" -       +        - name: Rename metadata          run: |            cp Windows-metadata/autobuild-package.xml Windows-autobuild-package.xml @@ -441,7 +441,7 @@ jobs:            append_body: true            fail_on_unmatched_files: true            files: | -            macOS-installer/*.dmg  +            macOS-installer/*.dmg              Windows-installer/*.exe              *-autobuild-package.xml              *-viewer_version.txt diff --git a/autobuild.xml b/autobuild.xml index 4c251c5d48..99d01af1a7 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2420,59 +2420,33 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>        </map>        <key>threejs</key>        <map> +        <key>copyright</key> +        <string>Copyright © 2010-2021 three.js authors</string> +        <key>license</key> +        <string>MIT</string> +        <key>license_file</key> +        <string>LICENSES/THREEJS_LICENSE.txt</string> +        <key>name</key> +        <string>threejs</string>          <key>platforms</key>          <map> -          <key>darwin64</key> -          <map> -            <key>archive</key> -            <map> -              <key>hash</key> -              <string>cfed00d8ea7265c035c2d86a234b28efb0b23756</string> -              <key>hash_algorithm</key> -              <string>sha1</string> -              <key>url</key> -              <string>https://github.com/secondlife/3p-three_js/releases/download/v0.132.2-b8f6746/threejs-0.132.2-darwin64-b8f6746.tar.zst</string> -            </map> -            <key>name</key> -            <string>darwin64</string> -          </map> -          <key>linux64</key> -          <map> -            <key>archive</key> -            <map> -              <key>hash</key> -              <string>9de1295b157c9913c28be81ff933c73493ecc132</string> -              <key>hash_algorithm</key> -              <string>sha1</string> -              <key>url</key> -              <string>https://github.com/secondlife/3p-three_js/releases/download/v0.132.2-b8f6746/threejs-0.132.2-linux64-b8f6746.tar.zst</string> -            </map> -          </map> -          <key>windows64</key> +          <key>common</key>            <map>              <key>archive</key>              <map>                <key>hash</key> -              <string>4141710fccbd1ea2b3b53d00e189bdfa2ee9d441</string> +              <string>982c0fa427458082ea9e3cb9603904210732b64e</string>                <key>hash_algorithm</key>                <string>sha1</string>                <key>url</key> -              <string>https://github.com/secondlife/3p-three_js/releases/download/v0.132.2-b8f6746/threejs-0.132.2-windows64-b8f6746.tar.zst</string> +              <string>https://github.com/secondlife/3p-three_js/releases/download/v0.132.2-5da28d9/threejs-0.132.2-common-8454371083.tar.zst</string>              </map>              <key>name</key> -            <string>windows64</string> +            <string>common</string>            </map>          </map> -        <key>license</key> -        <string>MIT</string> -        <key>license_file</key> -        <string>LICENSES/THREEJS_LICENSE.txt</string> -        <key>copyright</key> -        <string>Copyright © 2010-2021 three.js authors</string>          <key>version</key>          <string>0.132.2</string> -        <key>name</key> -        <string>threejs</string>        </map>        <key>tinygltf</key>        <map> diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 690159583a..4471380c6b 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -103,6 +103,11 @@ if (WINDOWS)      string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")      string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")    endif() + +  # workaround for github runner image breakage: +  # https://github.com/actions/runner-images/issues/10004#issuecomment-2153445161 +  # can be removed after the above issue is resolved and deployed across GHA +  add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)  endif (WINDOWS) diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index b186b9052e..f92811356e 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -119,6 +119,8 @@ public:      virtual void addDebugText( const std::string& text ) = 0; +    virtual std::string getDebugName() const { return getID().asString(); } +      virtual const LLUUID&   getID() const = 0;      //-------------------------------------------------------------------------      // End Interface diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index c63c7012d1..9392aa718b 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -86,6 +86,15 @@ std::string LLDate::asRFC1123() const      return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT"));  } +std::string LLDate::toLocalDateString (std::string fmt) const +{ +    LL_PROFILE_ZONE_SCOPED; + +    time_t locSeconds = (time_t) mSecondsSinceEpoch; +    struct tm * lt = localtime (&locSeconds); +    return toHTTPDateString(lt, fmt); +} +  std::string LLDate::toHTTPDateString (std::string fmt) const  {      LL_PROFILE_ZONE_SCOPED; diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index 81f2dd0d1c..67dfa1b5d1 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -80,6 +80,7 @@ public:      std::string asRFC1123() const;      void toStream(std::ostream&) const;      bool split(S32 *year, S32 *month = NULL, S32 *day = NULL, S32 *hour = NULL, S32 *min = NULL, S32 *sec = NULL) const; +    std::string toLocalDateString (std::string fmt) const;      std::string toHTTPDateString (std::string fmt) const;      static std::string toHTTPDateString (tm * gmt, std::string fmt);      /** diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 9d53b9be35..d3ff48073d 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -638,6 +638,14 @@ public:      {          getCPUIDInfo();          uint64_t frequency = getSysctlInt64("hw.cpufrequency"); +        if (!frequency) +        { +            auto tbfrequency = getSysctlInt64("hw.tbfrequency"); +            struct clockinfo clockrate; +            auto clockrate_len = sizeof(clockrate); +            if (!sysctlbyname("kern.clockrate", &clockrate, &clockrate_len, NULL, 0)) +                frequency = tbfrequency * clockrate.hz; +        }          setInfo(eFrequency, (F64)frequency  / (F64)1000000);      } diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index 0eb1891754..b8be7bb81a 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -4,7 +4,7 @@   * @date   2021-10-21   * @brief  ThreadPool configures a WorkQueue along with a pool of threads to   *         service it. - * + *    * $LicenseInfo:firstyear=2021&license=viewerlgpl$   * Copyright (c) 2021, Linden Research, Inc.   * $/LicenseInfo$ @@ -55,7 +55,7 @@ namespace LL           * ThreadPool listens for application shutdown messages on the "LLApp"           * LLEventPump. Call close() to shut down this ThreadPool early.           */ -        virtual void close(); +        void close();          std::string getName() const { return mName; }          size_t getWidth() const { return mThreads.size(); } diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp index 4d6276b2cd..7e1f350ab5 100644 --- a/indra/llmath/llcoordframe.cpp +++ b/indra/llmath/llcoordframe.cpp @@ -329,28 +329,30 @@ void LLCoordFrame::rotate(const LLMatrix3 &rotation_matrix)  } +// Rotate 2 normalized orthogonal vectors in direction from `source` to `target` +static void rotate2(LLVector3& source, LLVector3& target, F32 angle) +{ +    double sx = source[VX], sy = source[VY], sz = source[VZ]; +    double tx = target[VX], ty = target[VY], tz = target[VZ]; +    double c = cos(angle), s = sin(angle); + +    source.set(sx * c + tx * s, sy * c + ty * s, sz * c + tz * s); +    target.set(tx * c - sx * s, ty * c - sy * s, tz * c - sz * s); +} +  void LLCoordFrame::roll(F32 angle)  { -    LLQuaternion q(angle, mXAxis); -    LLMatrix3 rotation_matrix(q); -    rotate(rotation_matrix); -    CHECK_FINITE_OBJ(); +    rotate2(mYAxis, mZAxis, angle);  }  void LLCoordFrame::pitch(F32 angle)  { -    LLQuaternion q(angle, mYAxis); -    LLMatrix3 rotation_matrix(q); -    rotate(rotation_matrix); -    CHECK_FINITE_OBJ(); +    rotate2(mZAxis, mXAxis, angle);  }  void LLCoordFrame::yaw(F32 angle)  { -    LLQuaternion q(angle, mZAxis); -    LLMatrix3 rotation_matrix(q); -    rotate(rotation_matrix); -    CHECK_FINITE_OBJ(); +    rotate2(mXAxis, mYAxis, angle);  }  // get*() routines diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index ce0a88c26f..07e54daf87 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -58,7 +58,7 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)  LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)  { -    F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +    F32 mag = vec.length();      if (mag > FP_MAG_THRESHOLD)      {          angle *= 0.5; @@ -77,7 +77,7 @@ LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)  LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)  { -    F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]); +    F32 mag = vec.length();      if (mag > FP_MAG_THRESHOLD)      {          angle *= 0.5; diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp index ecbfe7378c..78d349f2f0 100644 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp @@ -67,7 +67,14 @@ F32 angle_between(const LLVector2& a, const LLVector2& b)      return angle;  } -BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) +F32 signed_angle_between(const LLVector2& a, const LLVector2& b) +{ +    F32 angle = angle_between(a, b); +    F32 rhombus_square = a[VX] * b[VY] - b[VX] * a[VY]; +    return rhombus_square < 0 ? -angle : angle; +} + +BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon)  {      LLVector2 an = a;      LLVector2 bn = b; diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index 5c756a7f84..978d14ece8 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -107,13 +107,14 @@ class LLVector2          friend LLVector2 operator-(const LLVector2 &a);                 // Return vector -a -        friend std::ostream&     operator<<(std::ostream& s, const LLVector2 &a);       // Stream a +        friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a);       // Stream a  };  // Non-member functions  F32 angle_between(const LLVector2 &a, const LLVector2 &b);  // Returns angle (radians) between a and b +F32 signed_angle_between(const LLVector2& a, const LLVector2& b); // Returns signed angle (radians) between a and b  BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon=F_APPROXIMATELY_ZERO);    // Returns TRUE if a and b are very close to parallel  F32 dist_vec(const LLVector2 &a, const LLVector2 &b);       // Returns distance between a and b  F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b @@ -124,26 +125,22 @@ LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u); // Returns a vect  inline LLVector2::LLVector2(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; +    clear();  }  inline LLVector2::LLVector2(F32 x, F32 y)  { -    mV[VX] = x; -    mV[VY] = y; +    set(x, y);  }  inline LLVector2::LLVector2(const F32 *vec)  { -    mV[VX] = vec[VX]; -    mV[VY] = vec[VY]; +    set(vec);  }  inline LLVector2::LLVector2(const LLVector3 &vec)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; +    set(vec.mV);  }  inline LLVector2::LLVector2(const LLSD &sd) @@ -155,28 +152,24 @@ inline LLVector2::LLVector2(const LLSD &sd)  inline void LLVector2::clear(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; +    mV[VX] = mV[VY] = 0.f;  }  inline void LLVector2::setZero(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; +    clear();  }  // deprecated  inline void LLVector2::clearVec(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; +    clear();  }  // deprecated  inline void LLVector2::zeroVec(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; +    clear();  }  inline void LLVector2::set(F32 x, F32 y) @@ -187,36 +180,31 @@ inline void LLVector2::set(F32 x, F32 y)  inline void LLVector2::set(const LLVector2 &vec)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; +    set(vec.mV);  }  inline void LLVector2::set(const F32 *vec)  { -    mV[VX] = vec[VX]; -    mV[VY] = vec[VY]; +    set(vec[VX], vec[VY]);  }  // deprecated  inline void LLVector2::setVec(F32 x, F32 y)  { -    mV[VX] = x; -    mV[VY] = y; +    set(x, y);  }  // deprecated  inline void LLVector2::setVec(const LLVector2 &vec)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; +    set(vec);  }  // deprecated  inline void LLVector2::setVec(const F32 *vec)  { -    mV[VX] = vec[VX]; -    mV[VY] = vec[VY]; +    set(vec);  } @@ -224,7 +212,7 @@ inline void LLVector2::setVec(const F32 *vec)  inline F32 LLVector2::length(void) const  { -    return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); +    return (F32) sqrt(lengthSquared());  }  inline F32 LLVector2::lengthSquared(void) const @@ -232,63 +220,44 @@ inline F32 LLVector2::lengthSquared(void) const      return mV[0]*mV[0] + mV[1]*mV[1];  } -inline F32      LLVector2::normalize(void) +inline F32 LLVector2::normalize(void)  { -    F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); -    F32 oomag; +    F32 mag = length();      if (mag > FP_MAG_THRESHOLD)      { -        oomag = 1.f/mag; -        mV[0] *= oomag; -        mV[1] *= oomag; +        *this /= mag;      }      else      { -        mV[0] = 0.f; -        mV[1] = 0.f; +        clear();          mag = 0;      } -    return (mag); +    return mag;  }  // checker  inline bool LLVector2::isFinite() const  { -    return (llfinite(mV[VX]) && llfinite(mV[VY])); +    return llfinite(mV[VX]) && llfinite(mV[VY]);  }  // deprecated -inline F32      LLVector2::magVec(void) const +inline F32 LLVector2::magVec(void) const  { -    return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); +    return length();  }  // deprecated -inline F32      LLVector2::magVecSquared(void) const +inline F32 LLVector2::magVecSquared(void) const  { -    return mV[0]*mV[0] + mV[1]*mV[1]; +    return lengthSquared();  }  // deprecated -inline F32      LLVector2::normVec(void) +inline F32 LLVector2::normVec(void)  { -    F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); -    F32 oomag; - -    if (mag > FP_MAG_THRESHOLD) -    { -        oomag = 1.f/mag; -        mV[0] *= oomag; -        mV[1] *= oomag; -    } -    else -    { -        mV[0] = 0.f; -        mV[1] = 0.f; -        mag = 0; -    } -    return (mag); +    return normalize();  }  inline const LLVector2& LLVector2::scaleVec(const LLVector2& vec) @@ -301,11 +270,7 @@ inline const LLVector2& LLVector2::scaleVec(const LLVector2& vec)  inline BOOL LLVector2::isNull()  { -    if ( F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] ) -    { -        return TRUE; -    } -    return FALSE; +    return F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY];  } @@ -337,9 +302,9 @@ inline LLVector2 operator-(const LLVector2 &a, const LLVector2 &b)      return c -= b;  } -inline F32  operator*(const LLVector2 &a, const LLVector2 &b) +inline F32 operator*(const LLVector2 &a, const LLVector2 &b)  { -    return (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1]); +    return a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1];  }  inline LLVector2 operator%(const LLVector2 &a, const LLVector2 &b) @@ -405,10 +370,7 @@ inline const LLVector2& operator*=(LLVector2 &a, F32 k)  inline const LLVector2& operator/=(LLVector2 &a, F32 k)  { -    F32 t = 1.f / k; -    a.mV[0] *= t; -    a.mV[1] *= t; -    return a; +    return a *= 1.f / k;  }  inline LLVector2 operator-(const LLVector2 &a) diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 0f4a4a07ae..513e01d3e1 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -100,24 +100,24 @@ class LLVector3          const LLVector3& setVec(const LLVector4 &vec);  // deprecated          const LLVector3& setVec(const LLVector3d &vec); // deprecated -        F32     length() const;         // Returns magnitude of LLVector3 -        F32     lengthSquared() const;  // Returns magnitude squared of LLVector3 -        F32     magVec() const;         // deprecated -        F32     magVecSquared() const;  // deprecated +        F32 length() const;         // Returns magnitude of LLVector3 +        F32 lengthSquared() const;  // Returns magnitude squared of LLVector3 +        F32 magVec() const;         // deprecated +        F32 magVecSquared() const;  // deprecated -        inline F32      normalize();    // Normalizes and returns the magnitude of LLVector3 -        inline F32      normVec();      // deprecated +        inline F32 normalize();    // Normalizes and returns the magnitude of LLVector3 +        inline F32 normVec();      // deprecated -        inline BOOL inRange( F32 min, F32 max ) const; // Returns true if all values of the vector are between min and max +        inline BOOL inRange(F32 min, F32 max) const; // Returns true if all values of the vector are between min and max -        const LLVector3&    rotVec(F32 angle, const LLVector3 &vec);    // Rotates about vec by angle radians -        const LLVector3&    rotVec(F32 angle, F32 x, F32 y, F32 z);     // Rotates about x,y,z by angle radians -        const LLVector3&    rotVec(const LLMatrix3 &mat);               // Rotates by LLMatrix4 mat -        const LLVector3&    rotVec(const LLQuaternion &q);              // Rotates by LLQuaternion q -        const LLVector3&    transVec(const LLMatrix4& mat);             // Transforms by LLMatrix4 mat (mat * v) +        const LLVector3& rotVec(F32 angle, const LLVector3 &vec);    // Rotates about vec by angle radians +        const LLVector3& rotVec(F32 angle, F32 x, F32 y, F32 z);     // Rotates about x,y,z by angle radians +        const LLVector3& rotVec(const LLMatrix3 &mat);               // Rotates by LLMatrix4 mat +        const LLVector3& rotVec(const LLQuaternion &q);              // Rotates by LLQuaternion q +        const LLVector3& transVec(const LLMatrix4& mat);             // Transforms by LLMatrix4 mat (mat * v) -        const LLVector3&    scaleVec(const LLVector3& vec);             // scales per component by vec -        LLVector3           scaledVec(const LLVector3& vec) const;          // get a copy of this vector scaled by vec +        const LLVector3& scaleVec(const LLVector3& vec);             // scales per component by vec +        LLVector3 scaledVec(const LLVector3& vec) const;             // get a copy of this vector scaled by vec          BOOL isNull() const;            // Returns TRUE if vector has a _very_small_ length          BOOL isExactlyZero() const      { return !mV[VX] && !mV[VY] && !mV[VZ]; } @@ -171,23 +171,17 @@ bool box_valid_and_non_zero(const LLVector3* box);  inline LLVector3::LLVector3(void)  { -    mV[0] = 0.f; -    mV[1] = 0.f; -    mV[2] = 0.f; +    clear();  }  inline LLVector3::LLVector3(const F32 x, const F32 y, const F32 z)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; +    set(x, y, z);  }  inline LLVector3::LLVector3(const F32 *vec)  { -    mV[VX] = vec[VX]; -    mV[VY] = vec[VY]; -    mV[VZ] = vec[VZ]; +    set(vec);  }  /* @@ -204,7 +198,7 @@ inline LLVector3::LLVector3(const LLVector3 ©)  // checker  inline BOOL LLVector3::isFinite() const  { -    return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ])); +    return llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]);  } @@ -212,30 +206,22 @@ inline BOOL LLVector3::isFinite() const  inline void LLVector3::clear(void)  { -    mV[0] = 0.f; -    mV[1] = 0.f; -    mV[2] = 0.f; +    set(0.f, 0.f, 0.f);  }  inline void LLVector3::setZero(void)  { -    mV[0] = 0.f; -    mV[1] = 0.f; -    mV[2] = 0.f; +    clear();  }  inline void LLVector3::clearVec(void)  { -    mV[0] = 0.f; -    mV[1] = 0.f; -    mV[2] = 0.f; +    clear();  }  inline void LLVector3::zeroVec(void)  { -    mV[0] = 0.f; -    mV[1] = 0.f; -    mV[2] = 0.f; +    clear();  }  inline void LLVector3::set(F32 x, F32 y, F32 z) @@ -247,107 +233,74 @@ inline void LLVector3::set(F32 x, F32 y, F32 z)  inline void LLVector3::set(const LLVector3 &vec)  { -    mV[0] = vec.mV[0]; -    mV[1] = vec.mV[1]; -    mV[2] = vec.mV[2]; +    set(vec.mV[0], vec.mV[1], vec.mV[2]);  }  inline void LLVector3::set(const F32 *vec)  { -    mV[0] = vec[0]; -    mV[1] = vec[1]; -    mV[2] = vec[2]; +    set(vec[0], vec[1], vec[2]);  }  // deprecated  inline void LLVector3::setVec(F32 x, F32 y, F32 z)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; +    set(x, y, z);  }  // deprecated  inline void LLVector3::setVec(const LLVector3 &vec)  { -    mV[0] = vec.mV[0]; -    mV[1] = vec.mV[1]; -    mV[2] = vec.mV[2]; +    set(vec);  }  // deprecated  inline void LLVector3::setVec(const F32 *vec)  { -    mV[0] = vec[0]; -    mV[1] = vec[1]; -    mV[2] = vec[2]; +    set(vec);  }  inline F32 LLVector3::normalize(void)  {      F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); -    F32 oomag;      if (mag > FP_MAG_THRESHOLD)      { -        oomag = 1.f/mag; -        mV[0] *= oomag; -        mV[1] *= oomag; -        mV[2] *= oomag; +        *this /= mag;      }      else      { -        mV[0] = 0.f; -        mV[1] = 0.f; -        mV[2] = 0.f; +        clear();          mag = 0;      } -    return (mag); +    return mag;  }  // deprecated  inline F32 LLVector3::normVec(void)  { -    F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); -    F32 oomag; - -    if (mag > FP_MAG_THRESHOLD) -    { -        oomag = 1.f/mag; -        mV[0] *= oomag; -        mV[1] *= oomag; -        mV[2] *= oomag; -    } -    else -    { -        mV[0] = 0.f; -        mV[1] = 0.f; -        mV[2] = 0.f; -        mag = 0; -    } -    return (mag); +    return normalize();  }  // LLVector3 Magnitude and Normalization Functions -inline F32  LLVector3::length(void) const +inline F32 LLVector3::length(void) const  { -    return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); +    return (F32) sqrt(lengthSquared());  } -inline F32  LLVector3::lengthSquared(void) const +inline F32 LLVector3::lengthSquared(void) const  {      return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2];  } -inline F32  LLVector3::magVec(void) const +inline F32 LLVector3::magVec(void) const  { -    return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); +    return length();  } -inline F32  LLVector3::magVecSquared(void) const +inline F32 LLVector3::magVecSquared(void) const  { -    return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; +    return lengthSquared();  }  inline BOOL LLVector3::inRange( F32 min, F32 max ) const @@ -371,7 +324,7 @@ inline LLVector3 operator-(const LLVector3 &a, const LLVector3 &b)  inline F32  operator*(const LLVector3 &a, const LLVector3 &b)  { -    return (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]); +    return a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2];  }  inline LLVector3 operator%(const LLVector3 &a, const LLVector3 &b) @@ -459,10 +412,7 @@ inline const LLVector3& operator*=(LLVector3 &a, const LLVector3 &b)  inline const LLVector3& operator/=(LLVector3 &a, F32 k)  { -    F32 t = 1.f / k; -    a.mV[0] *= t; -    a.mV[1] *= t; -    a.mV[2] *= t; +    a *= 1.f / k;      return a;  } @@ -471,7 +421,7 @@ inline LLVector3 operator-(const LLVector3 &a)      return LLVector3( -a.mV[0], -a.mV[1], -a.mV[2] );  } -inline F32  dist_vec(const LLVector3 &a, const LLVector3 &b) +inline F32 dist_vec(const LLVector3 &a, const LLVector3 &b)  {      F32 x = a.mV[0] - b.mV[0];      F32 y = a.mV[1] - b.mV[1]; @@ -479,7 +429,7 @@ inline F32  dist_vec(const LLVector3 &a, const LLVector3 &b)      return (F32) sqrt( x*x + y*y + z*z );  } -inline F32  dist_vec_squared(const LLVector3 &a, const LLVector3 &b) +inline F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b)  {      F32 x = a.mV[0] - b.mV[0];      F32 y = a.mV[1] - b.mV[1]; @@ -487,7 +437,7 @@ inline F32  dist_vec_squared(const LLVector3 &a, const LLVector3 &b)      return x*x + y*y + z*z;  } -inline F32  dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b) +inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)  {      F32 x = a.mV[0] - b.mV[0];      F32 y = a.mV[1] - b.mV[1]; @@ -501,10 +451,7 @@ inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)      {          return ((a * b) / bb) * b;      } -    else -    { -        return b.zero; -    } +    return b.zero;  }  inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b) @@ -541,11 +488,7 @@ inline LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u)  inline BOOL LLVector3::isNull() const  { -    if ( F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ] ) -    { -        return TRUE; -    } -    return FALSE; +    return F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];  }  inline void update_min_max(LLVector3& min, LLVector3& max, const LLVector3& pos) @@ -586,7 +529,7 @@ inline F32 angle_between(const LLVector3& a, const LLVector3& b)          ab = 0.0f; // get rid of negative zero      }      LLVector3 c = a % b; // crossproduct -    return atan2f(sqrtf(c * c), ab); // return the angle +    return atan2f(c.length(), ab); // return the angle  }  inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon) @@ -596,7 +539,7 @@ inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)      an.normalize();      bn.normalize();      F32 dot = an * bn; -    if ( (1.0f - fabs(dot)) < epsilon) +    if (1.0f - fabs(dot) < epsilon)      {          return TRUE;      } diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index 7f0020af6b..b9460820a1 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -96,9 +96,9 @@ class LLVector4          F32 lengthSquared() const;      // Returns magnitude squared of LLVector4          F32 normalize();                // Normalizes and returns the magnitude of LLVector4 -        F32         magVec() const;             // deprecated -        F32         magVecSquared() const;      // deprecated -        F32         normVec();                  // deprecated +        F32 magVec() const;             // deprecated +        F32 magVecSquared() const;      // deprecated +        F32 normVec();                  // deprecated          // Sets all values to absolute value of their original values          // Returns TRUE if data changed @@ -107,10 +107,10 @@ class LLVector4          BOOL isExactlyClear() const     { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; }          BOOL isExactlyZero() const      { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; } -        const LLVector4&    rotVec(F32 angle, const LLVector4 &vec);    // Rotates about vec by angle radians -        const LLVector4&    rotVec(F32 angle, F32 x, F32 y, F32 z);     // Rotates about x,y,z by angle radians -        const LLVector4&    rotVec(const LLMatrix4 &mat);               // Rotates by MAT4 mat -        const LLVector4&    rotVec(const LLQuaternion &q);              // Rotates by QUAT q +        const LLVector4& rotVec(F32 angle, const LLVector4 &vec);    // Rotates about vec by angle radians +        const LLVector4& rotVec(F32 angle, F32 x, F32 y, F32 z);     // Rotates about x,y,z by angle radians +        const LLVector4& rotVec(const LLMatrix4 &mat);               // Rotates by MAT4 mat +        const LLVector4& rotVec(const LLQuaternion &q);              // Rotates by QUAT q          const LLVector4&    scaleVec(const LLVector4& vec); // Scales component-wise by vec @@ -150,34 +150,22 @@ LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u); // Returns a vect  inline LLVector4::LLVector4(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; -    mV[VZ] = 0.f; -    mV[VW] = 1.f; +    clear();  }  inline LLVector4::LLVector4(F32 x, F32 y, F32 z)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; -    mV[VW] = 1.f; +    set(x, y, z, 1.f);  }  inline LLVector4::LLVector4(F32 x, F32 y, F32 z, F32 w)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; -    mV[VW] = w; +    set(x, y, z, w);  }  inline LLVector4::LLVector4(const F32 *vec)  { -    mV[VX] = vec[VX]; -    mV[VY] = vec[VY]; -    mV[VZ] = vec[VZ]; -    mV[VW] = vec[VW]; +    set(vec);  }  inline LLVector4::LLVector4(const F64 *vec) @@ -206,18 +194,12 @@ inline LLVector4::LLVector4(const LLVector2 &vec, F32 z, F32 w)  inline LLVector4::LLVector4(const LLVector3 &vec)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; -    mV[VZ] = vec.mV[VZ]; -    mV[VW] = 1.f; +    set(vec, 1.f);  }  inline LLVector4::LLVector4(const LLVector3 &vec, F32 w)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; -    mV[VZ] = vec.mV[VZ]; -    mV[VW] = w; +    set(vec, w);  }  inline LLVector4::LLVector4(const LLSD &sd) @@ -228,43 +210,31 @@ inline LLVector4::LLVector4(const LLSD &sd)  inline BOOL LLVector4::isFinite() const  { -    return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]) && llfinite(mV[VW])); +    return llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]) && llfinite(mV[VW]);  }  // Clear and Assignment Functions  inline void LLVector4::clear(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; -    mV[VZ] = 0.f; -    mV[VW] = 1.f; +    set(0.f, 0.f, 0.f, 1.f);  }  // deprecated  inline void LLVector4::clearVec(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; -    mV[VZ] = 0.f; -    mV[VW] = 1.f; +    clear();  }  // deprecated  inline void LLVector4::zeroVec(void)  { -    mV[VX] = 0.f; -    mV[VY] = 0.f; -    mV[VZ] = 0.f; -    mV[VW] = 0.f; +    set(0.f, 0.f, 0.f, 0.f);  }  inline void LLVector4::set(F32 x, F32 y, F32 z)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; -    mV[VW] = 1.f; +    set(x, y, z, 1.f);  }  inline void LLVector4::set(F32 x, F32 y, F32 z, F32 w) @@ -277,10 +247,7 @@ inline void LLVector4::set(F32 x, F32 y, F32 z, F32 w)  inline void LLVector4::set(const LLVector4 &vec)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; -    mV[VZ] = vec.mV[VZ]; -    mV[VW] = vec.mV[VW]; +    set(vec.mV);  }  inline void LLVector4::set(const LLVector3 &vec, F32 w) @@ -299,72 +266,56 @@ inline void LLVector4::set(const F32 *vec)      mV[VW] = vec[VW];  } -  // deprecated  inline void LLVector4::setVec(F32 x, F32 y, F32 z)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; -    mV[VW] = 1.f; +    set(x, y, z);  }  // deprecated  inline void LLVector4::setVec(F32 x, F32 y, F32 z, F32 w)  { -    mV[VX] = x; -    mV[VY] = y; -    mV[VZ] = z; -    mV[VW] = w; +    set(x, y, z, w);  }  // deprecated  inline void LLVector4::setVec(const LLVector4 &vec)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; -    mV[VZ] = vec.mV[VZ]; -    mV[VW] = vec.mV[VW]; +    set(vec);  }  // deprecated  inline void LLVector4::setVec(const LLVector3 &vec, F32 w)  { -    mV[VX] = vec.mV[VX]; -    mV[VY] = vec.mV[VY]; -    mV[VZ] = vec.mV[VZ]; -    mV[VW] = w; +    set(vec, w);  }  // deprecated  inline void LLVector4::setVec(const F32 *vec)  { -    mV[VX] = vec[VX]; -    mV[VY] = vec[VY]; -    mV[VZ] = vec[VZ]; -    mV[VW] = vec[VW]; +    set(vec);  }  // LLVector4 Magnitude and Normalization Functions -inline F32      LLVector4::length(void) const +inline F32 LLVector4::length(void) const  { -    return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); +    return (F32) sqrt(lengthSquared());  } -inline F32      LLVector4::lengthSquared(void) const +inline F32 LLVector4::lengthSquared(void) const  {      return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];  } -inline F32      LLVector4::magVec(void) const +inline F32 LLVector4::magVec(void) const  { -    return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); +    return length();  } -inline F32      LLVector4::magVecSquared(void) const +inline F32 LLVector4::magVecSquared(void) const  { -    return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; +    return lengthSquared();  }  // LLVector4 Operators @@ -383,7 +334,7 @@ inline LLVector4 operator-(const LLVector4 &a, const LLVector4 &b)  inline F32  operator*(const LLVector4 &a, const LLVector4 &b)  { -    return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ]); +    return a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ];  }  inline LLVector4 operator%(const LLVector4 &a, const LLVector4 &b) @@ -456,11 +407,7 @@ inline const LLVector4& operator*=(LLVector4 &a, F32 k)  inline const LLVector4& operator/=(LLVector4 &a, F32 k)  { -    F32 t = 1.f / k; -    a.mV[VX] *= t; -    a.mV[VY] *= t; -    a.mV[VZ] *= t; -    return a; +    return a *= 1.f / k;  }  inline LLVector4 operator-(const LLVector4 &a) @@ -468,16 +415,16 @@ inline LLVector4 operator-(const LLVector4 &a)      return LLVector4( -a.mV[VX], -a.mV[VY], -a.mV[VZ] );  } -inline F32  dist_vec(const LLVector4 &a, const LLVector4 &b) +inline F32 dist_vec(const LLVector4 &a, const LLVector4 &b)  {      LLVector4 vec = a - b; -    return (vec.length()); +    return vec.length();  } -inline F32  dist_vec_squared(const LLVector4 &a, const LLVector4 &b) +inline F32 dist_vec_squared(const LLVector4 &a, const LLVector4 &b)  {      LLVector4 vec = a - b; -    return (vec.lengthSquared()); +    return vec.lengthSquared();  }  inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u) @@ -489,17 +436,13 @@ inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u)          a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u);  } -inline F32      LLVector4::normalize(void) +inline F32 LLVector4::normalize(void)  {      F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); -    F32 oomag;      if (mag > FP_MAG_THRESHOLD)      { -        oomag = 1.f/mag; -        mV[VX] *= oomag; -        mV[VY] *= oomag; -        mV[VZ] *= oomag; +        *this /= mag;      }      else      { @@ -508,34 +451,18 @@ inline F32      LLVector4::normalize(void)          mV[2] = 0.f;          mag = 0;      } -    return (mag); +    return mag;  }  // deprecated -inline F32      LLVector4::normVec(void) +inline F32 LLVector4::normVec(void)  { -    F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); -    F32 oomag; - -    if (mag > FP_MAG_THRESHOLD) -    { -        oomag = 1.f/mag; -        mV[VX] *= oomag; -        mV[VY] *= oomag; -        mV[VZ] *= oomag; -    } -    else -    { -        mV[0] = 0.f; -        mV[1] = 0.f; -        mV[2] = 0.f; -        mag = 0; -    } -    return (mag); +    return normalize();  }  // Because apparently some parts of the viewer use this for color info. -inline const LLVector4 srgbVector4(const LLVector4 &a) { +inline const LLVector4 srgbVector4(const LLVector4 &a) +{      LLVector4 srgbColor;      srgbColor.mV[0] = linearTosRGB(a.mV[0]); diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 236cef9c3f..9c49f64452 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -66,7 +66,12 @@ LLModel::~LLModel()  {      if (mDecompID >= 0)      { -        LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID); +        // can be null on shutdown +        LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); +        if (decomp) +        { +            decomp->deleteDecomposition(mDecompID); +        }      }      mPhysics.mMesh.clear();  } diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 28b5bc7495..b6fd78eefa 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -1094,7 +1094,8 @@ S32 LLGLSLShader::bindTexture(S32 uniform, LLTexture* texture, LLTexUnit::eTextu      if (uniform < 0 || uniform >= (S32)mTexture.size())      { -        LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; +        LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; +        llassert(false);          return -1;      } @@ -1115,6 +1116,8 @@ S32 LLGLSLShader::bindTexture(S32 uniform, LLRenderTarget* texture, bool depth,      if (uniform < 0 || uniform >= (S32)mTexture.size())      { +        LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; +        llassert(false);          return -1;      } @@ -1162,7 +1165,8 @@ S32 LLGLSLShader::unbindTexture(S32 uniform, LLTexUnit::eTextureType mode)      if (uniform < 0 || uniform >= (S32)mTexture.size())      { -        LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; +        LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; +        llassert(false);          return -1;      } @@ -1187,7 +1191,8 @@ S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode, LLTex      if (uniform < 0 || uniform >= (S32)mTexture.size())      { -        LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; +        LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; +        llassert(false);          return -1;      } @@ -1208,7 +1213,8 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode, LLTe      if (uniform < 0 || uniform >= (S32)mTexture.size())      { -        LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; +        LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; +        llassert(false);          return -1;      }      S32 index = mTexture[uniform]; @@ -1239,7 +1245,8 @@ void LLGLSLShader::uniform1i(U32 index, GLint x)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1264,7 +1271,8 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1299,7 +1307,8 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1325,7 +1334,8 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1351,7 +1361,8 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1377,7 +1388,8 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1403,7 +1415,8 @@ void LLGLSLShader::uniform4iv(U32 index, U32 count, const GLint* v)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1430,7 +1443,8 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1456,7 +1470,8 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1482,7 +1497,8 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1508,7 +1524,8 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v)      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1535,7 +1552,8 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1555,7 +1573,8 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1575,7 +1594,8 @@ void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose,      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } @@ -1595,7 +1615,8 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c      {          if (mUniform.size() <= index)          { -            LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; +            LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; +            llassert(false);              return;          } diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index ebdc9e751d..be9f3895e7 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -548,6 +548,5 @@ glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloa  glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up);  #define LL_SHADER_LOADING_WARNS(...) LL_WARNS() -#define LL_SHADER_UNIFORM_ERRS(...)  LL_ERRS("Shader")  #endif diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 71b3c3ddd1..eaf8f99eab 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -31,11 +31,12 @@  #include "llfolderviewitem.h"  #include "llfolderview.h"  #include "llfolderviewmodel.h" -#include "llpanel.h"  #include "llcallbacklist.h"  #include "llcriticaldamp.h"  #include "llclipboard.h"  #include "llfocusmgr.h"     // gFocusMgr +#include "llnotificationsutil.h" +#include "llpanel.h"  #include "lltrans.h"  #include "llwindow.h" @@ -108,7 +109,7 @@ LLFolderViewItem::Params::Params()      item_height("item_height"),      item_top_pad("item_top_pad"),      creation_date(), -    allow_wear("allow_wear", true), +    marketplace_item("marketplace_item", false),      allow_drop("allow_drop", true),      font_color("font_color"),      font_highlight_color("font_highlight_color"), @@ -149,7 +150,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)      mRoot(p.root),      mViewModelItem(p.listener),      mIsMouseOverTitle(false), -    mAllowWear(p.allow_wear), +    mMarketplaceItem(p.marketplace_item),      mAllowDrop(p.allow_drop),      mFontColor(p.font_color),      mFontHighlightColor(p.font_highlight_color), @@ -543,10 +544,15 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)  void LLFolderViewItem::openItem( void )  { -    if (mAllowWear || !getViewModelItem()->isItemWearable()) +    if (!mMarketplaceItem || !getViewModelItem()->isItemWearable())      {          getViewModelItem()->openItem();      } +    else if (mMarketplaceItem) +    { +        // Wearing an object from any listing, active or not, is verbotten +        LLNotificationsUtil::add("AlertMerchantListingCannotWear"); +    }  }  void LLFolderViewItem::rename(const std::string& new_name) diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 0afe86e151..f7a8ff6444 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -61,7 +61,7 @@ public:                                                      item_top_pad;          Optional<time_t>                            creation_date; -        Optional<bool>                              allow_wear; +        Optional<bool>                              marketplace_item;          Optional<bool>                              allow_drop;          Optional<LLUIColor>                         font_color; @@ -125,7 +125,7 @@ protected:                                  mIsCurSelection,                                  mDragAndDropTarget,                                  mIsMouseOverTitle, -                                mAllowWear, +                                mMarketplaceItem,                                  mAllowDrop,                                  mSingleFolderMode,                                  mDoubleClickOverride, diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 8fcb558aae..b4a3ca0844 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -46,6 +46,7 @@  #include "llfocusmgr.h"  #include "llcoord.h"  #include "llwindow.h" +#include "llemojihelper.h"  #include "llcriticaldamp.h"  #include "lluictrlfactory.h" @@ -1411,6 +1412,7 @@ void LLMenuItemBranchDownGL::openMenu( void )      }      else      { +        LLEmojiHelper::instance().hideHelper(nullptr, true);          if (branch->getTornOff())          {              LLFloater * branch_parent = dynamic_cast<LLFloater *>(branch->getParent()); diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index eac43900f6..f09b87493c 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -28,6 +28,7 @@  #include "llmodaldialog.h" +#include "llemojihelper.h"  #include "llfocusmgr.h"  #include "v4color.h"  #include "v2math.h" @@ -35,19 +36,20 @@  #include "llwindow.h"  #include "llkeyboard.h"  #include "llmenugl.h" +  // static  std::list<LLModalDialog*> LLModalDialog::sModalStack; -LLModalDialog::LLModalDialog( const LLSD& key, BOOL modal ) +LLModalDialog::LLModalDialog(const LLSD& key, BOOL modal)      : LLFloater(key), -      mModal( modal ) +      mModal(modal)  {      if (modal)      {          setCanMinimize(FALSE);          setCanClose(FALSE);      } -    setVisible( FALSE ); +    setVisible(FALSE);      setBackgroundVisible(TRUE);      setBackgroundOpaque(TRUE);      centerOnScreen(); // default position @@ -98,7 +100,7 @@ void LLModalDialog::onOpen(const LLSD& key)  {      if (mModal)      { -        // If Modal, Hide the active modal dialog +        // If Modal, hide the active modal dialog          if (!sModalStack.empty())          {              LLModalDialog* front = sModalStack.front(); @@ -148,13 +150,18 @@ void LLModalDialog::stopModal()      }  } -  void LLModalDialog::setVisible( BOOL visible )  {      if (mModal)      { -        if( visible ) +        if (visible)          { +            // Hide all menus currently shown +            LLMenuGL::sMenuContainer->hideMenus(); + +            // Hide EmojiPicker if it is shown +            LLEmojiHelper::instance().hideHelper(nullptr, true); +              // This is a modal dialog.  It sucks up all mouse and keyboard operations.              gFocusMgr.setMouseCapture( this ); @@ -257,7 +264,6 @@ BOOL LLModalDialog::handleRightMouseDown(S32 x, S32 y, MASK mask)      return TRUE;  } -  BOOL LLModalDialog::handleKeyHere(KEY key, MASK mask )  {      LLFloater::handleKeyHere(key, mask ); @@ -301,7 +307,6 @@ void LLModalDialog::centerOnScreen()      centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));  } -  // static  void LLModalDialog::onAppFocusLost()  { @@ -333,6 +338,7 @@ void LLModalDialog::onAppFocusGained()      }  } +// static  void LLModalDialog::shutdownModals()  {      // This method is only for use during app shutdown. ~LLModalDialog() diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e030861f20..3e49be1770 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -265,7 +265,9 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :      mShowEmojiHelper(p.show_emoji_helper),      mEnableTooltipPaste(p.enable_tooltip_paste),      mPassDelete(false), -    mKeepSelectionOnReturn(false) +    mKeepSelectionOnReturn(false), +    mSelectAllOnFocusReceived(false), +    mSelectedOnFocusReceived(false)  {      mSourceID.generate(); @@ -389,6 +391,7 @@ void LLTextEditor::selectNext(const std::string& search_text_in, BOOL case_insen      setCursorPos(loc);      mIsSelecting = TRUE; +    mSelectedOnFocusReceived = false;      mSelectionEnd = mCursorPos;      mSelectionStart = llmin((S32)getLength(), (S32)(mCursorPos + search_text.size()));  } @@ -668,6 +671,13 @@ BOOL LLTextEditor::canSelectAll() const      return TRUE;  } +//virtual +void LLTextEditor::deselect() +{ +    LLTextBase::deselect(); +    mSelectedOnFocusReceived = false; +} +  // virtual  void LLTextEditor::selectAll()  { @@ -685,6 +695,11 @@ void LLTextEditor::selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_p      endSelection();  } +void LLTextEditor::setSelectAllOnFocusReceived(bool b) +{ +    mSelectAllOnFocusReceived = b; +} +  void LLTextEditor::insertEmoji(llwchar emoji)  {      LL_INFOS() << "LLTextEditor::insertEmoji(" << wchar_utf8_preview(emoji) << ")" << LL_ENDL; @@ -762,8 +777,16 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)      // Delay cursor flashing      resetCursorBlink(); +    mSelectedOnFocusReceived = false;      if (handled && !gFocusMgr.getMouseCapture())      { +        if (!mask && mSelectAllOnFocusReceived) +        { +            mIsSelecting = false; +            mSelectionStart = getLength(); +            mSelectionEnd = 0; +            mSelectedOnFocusReceived = true; +        }          gFocusMgr.setMouseCapture( this );      }      return handled; @@ -2127,6 +2150,11 @@ void LLTextEditor::focusLostHelper()          gEditMenuHandler = NULL;      } +    if (mSelectedOnFocusReceived) +    { +        deselect(); +    } +      if (mCommitOnFocusLost)      {          onCommit(); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index e917f65fbd..8ef9673739 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -142,8 +142,10 @@ public:      virtual BOOL    canDoDelete() const;      virtual void    selectAll();      virtual BOOL    canSelectAll()  const; +    virtual void    deselect();      void            selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos); +    void            setSelectAllOnFocusReceived(bool b);      virtual bool    canLoadOrSaveToFile(); @@ -331,6 +333,8 @@ private:      bool            mEnableTooltipPaste;      bool            mPassDelete;      bool            mKeepSelectionOnReturn; // disabling of removing selected text after pressing of Enter +    bool            mSelectAllOnFocusReceived; +    bool            mSelectedOnFocusReceived;      LLUUID          mSourceID; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index d6b93b93d9..aea7367337 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -351,10 +351,9 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool      LLWindowWin32Thread();      void run() override; -    void close() override;      // closes queue, wakes thread, waits until thread closes -    void wakeAndDestroy(); +    bool wakeAndDestroy();      void glReady()      { @@ -425,6 +424,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool      // *HACK: Attempt to prevent startup crashes by deferring memory accounting      // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18      bool mGLReady = false; +    bool mDeleteOnExit = false;      // best guess at available video memory in MB      std::atomic<U32> mAvailableVRAM; @@ -997,7 +997,11 @@ void LLWindowWin32::close()      mhDC = NULL;      mWindowHandle = NULL; -    mWindowThread->wakeAndDestroy(); +    if (mWindowThread->wakeAndDestroy()) +    { +        // thread will delete itselfs once done +        mWindowThread = NULL; +    }  }  BOOL LLWindowWin32::isValid() @@ -3110,10 +3114,17 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_          break;          }      } -    else +    else // (NULL == window_imp)      { -        // (NULL == window_imp) -        LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL; +        if (u_msg == WM_DESTROY) +        { +            PostQuitMessage(0);  // Posts WM_QUIT with an exit code of 0 +            return 0; +        } +        else +        { +            LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL; +        }      }      // pass unhandled messages down to Windows @@ -4572,25 +4583,11 @@ U32 LLWindowWin32::getAvailableVRAMMegabytes()  #endif // LL_WINDOWS  inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() -    : LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, true /*should be false, temporary workaround for SL-18721*/) +    : LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, false)  {      LL::ThreadPool::start();  } -void LLWindowWin32::LLWindowWin32Thread::close() -{ -    if (!mQueue->isClosed()) -    { -        LL_WARNS() << "Closing window thread without using destroy_window_handler" << LL_ENDL; -        LL::ThreadPool::close(); - -        // Workaround for SL-18721 in case window closes too early and abruptly -        LLSplashScreen::show(); -        LLSplashScreen::update("..."); // will be updated later -    } -} - -  /**   * LogChange is to log changes in status while trying to avoid spamming the   * log with repeated messages, especially in a tight loop. It refuses to log @@ -4935,14 +4932,19 @@ void LLWindowWin32::LLWindowWin32Thread::run()      }      cleanupDX(); + +    if (mDeleteOnExit) +    { +        delete this; +    }  } -void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy() +bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()  {      if (mQueue->isClosed())      { -        LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." << LL_ENDL; -        return; +        LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." <<LL_ENDL; +        return false;      }      // Make sure we don't leave a blank toolbar button. @@ -4981,6 +4983,15 @@ void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()               mGLReady = false;           }); +    mDeleteOnExit = true; +    SetWindowLongPtr(old_handle, GWLP_USERDATA, NULL); + +    // Let thread finish on its own and don't block main thread. +    for (auto& pair : mThreads) +    { +        pair.second.detach(); +    } +      LL_DEBUGS("Window") << "Closing window's pool queue" << LL_ENDL;      mQueue->close(); @@ -4995,49 +5006,8 @@ void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()          PostMessage(old_handle, WM_DUMMY_, wparam, 0x1337);      } -    // There are cases where window will refuse to close, -    // can't wait forever on join, check state instead -    LLTimer timeout; -    timeout.setTimerExpirySec(2.0); -    while (!getQueue().done() && !timeout.hasExpired() && mWindowHandleThrd) -    { -        ms_sleep(100); -    } - -    if (getQueue().done() || mWindowHandleThrd == NULL) -    { -        // Window is closed, started closing or is cleaning up -        // now wait for our single thread to die. -        if (mWindowHandleThrd) -        { -            LL_INFOS("Window") << "Window is closing, waiting on pool's thread to join, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL; -        } -        else -        { -            LL_DEBUGS("Window") << "Waiting on pool's thread, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL; -        } -        for (auto& pair : mThreads) -        { -            pair.second.join(); -        } -    } -    else -    { -        // Something suspended window thread, can't afford to wait forever -        // so kill thread instead -        // Ex: This can happen if user starts dragging window arround (if it -        // was visible) or a modal notification pops up -        LL_WARNS("Window") << "Window is frozen, couldn't perform clean exit" << LL_ENDL; - -        for (auto& pair : mThreads) -        { -            // very unsafe -            TerminateThread(pair.second.native_handle(), 0); -            pair.second.detach(); -            cleanupDX(); -        } -    }      LL_DEBUGS("Window") << "thread pool shutdown complete" << LL_ENDL; +    return true;  }  void LLWindowWin32::post(const std::function<void()>& func) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c2869eedfd..8f45d10708 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -331,6 +331,7 @@ set(viewer_SOURCE_FILES      llhudeffectpointat.cpp      llhudeffecttrail.cpp      llhudeffectblob.cpp +    llhudeffectresetskeleton.cpp      llhudicon.cpp      llhudmanager.cpp      llhudnametag.cpp @@ -995,6 +996,7 @@ set(viewer_HEADER_FILES      llhudeffectpointat.h      llhudeffecttrail.h      llhudeffectblob.h +    llhudeffectresetskeleton.h      llhudicon.h      llhudmanager.h      llhudnametag.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2f72f94048..e383c1f5c6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -91,7 +91,7 @@        <key>Type</key>        <string>S32</string>        <key>Value</key> -      <real>300.0</real> +      <real>300</real>      </map>      <key>AckCollectTime</key>      <map> @@ -1830,6 +1830,17 @@      <key>Value</key>      <integer>0</integer>    </map> +    <key>DebugSelectionLODs</key> +    <map> +        <key>Comment</key> +        <string>Force selection to show specific LOD, -1 for off, 0 - lowest, 4 - high.</string> +        <key>Persist</key> +        <integer>0</integer> +        <key>Type</key> +        <string>S32</string> +        <key>Value</key> +        <integer>-1</integer> +    </map>    <key>AnimatedObjectsAllowLeftClick</key>    <map>      <key>Comment</key> diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 6b788dd78f..99c43acd49 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -329,7 +329,7 @@      <key>KeepConversationLogTranscripts</key>      	<map>        	<key>Comment</key> -      		<string>Keep a conversation log and transcripts</string> +      		<string>Keep a conversation log and transcripts 2 - both, 1 - logs, 0 - none</string>        	<key>Persist</key>        		<integer>1</integer>        	<key>Type</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl index cf0595ee45..e77e972873 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/screenSpaceReflUtil.glsl @@ -27,11 +27,11 @@  float random (vec2 uv)  { -    return 0; +    return 0.f;  }  float tapScreenSpaceReflection(int totalSamples, vec2 tc, vec3 viewPos, vec3 n, inout vec4 collectedColor, sampler2D source, float glossiness)  {      collectedColor = vec4(0); -    return 0; +    return 0.f;  } diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6db7088812..8e15a08373 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -222,7 +222,6 @@ private:      LLVector3d mPosGlobal;  }; -  class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation  {  public: @@ -844,7 +843,6 @@ void LLAgent::movePitch(F32 mag)      }  } -  // Does this parcel allow you to fly?  BOOL LLAgent::canFly()  { @@ -926,7 +924,6 @@ void LLAgent::setFlying(BOOL fly, BOOL fail_sound)      mbFlagsDirty = TRUE;  } -  // UI based mechanism of setting fly state  //-----------------------------------------------------------------------------  // toggleFlying() @@ -1005,7 +1002,6 @@ void LLAgent::capabilityReceivedCallback(const LLUUID ®ion_id, LLViewerRegion      }  } -  //-----------------------------------------------------------------------------  // setRegion()  //----------------------------------------------------------------------------- @@ -1112,7 +1108,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp)      mRegionChangedSignal();  } -  //-----------------------------------------------------------------------------  // getRegion()  //----------------------------------------------------------------------------- @@ -1121,7 +1116,6 @@ LLViewerRegion *LLAgent::getRegion() const      return mRegionp;  } -  LLHost LLAgent::getRegionHost() const  {      if (mRegionp) @@ -1152,7 +1146,6 @@ BOOL LLAgent::inPrelude()      return mRegionp && mRegionp->isPrelude();  } -  std::string LLAgent::getRegionCapability(const std::string &name)  {      if (!mRegionp) @@ -1161,7 +1154,6 @@ std::string LLAgent::getRegionCapability(const std::string &name)      return mRegionp->getCapability(name);  } -  //-----------------------------------------------------------------------------  // canManageEstate()  //----------------------------------------------------------------------------- @@ -1189,7 +1181,6 @@ void LLAgent::sendMessage()      gMessageSystem->sendMessage(mRegionp->getHost());  } -  //-----------------------------------------------------------------------------  // sendReliableMessage()  //----------------------------------------------------------------------------- @@ -1223,7 +1214,6 @@ LLVector3 LLAgent::getVelocity() const      }  } -  //-----------------------------------------------------------------------------  // setPositionAgent()  //----------------------------------------------------------------------------- @@ -1292,12 +1282,11 @@ const LLVector3 &LLAgent::getPositionAgent()              mFrameAgent.setOrigin(gAgentAvatarp->getPositionAgent());          }          else -    { -        mFrameAgent.setOrigin(gAgentAvatarp->getRenderPosition()); -    } +        { +            mFrameAgent.setOrigin(gAgentAvatarp->getRenderPosition()); +        }      } -      return mFrameAgent.getOrigin();  } @@ -1306,7 +1295,6 @@ boost::signals2::connection LLAgent::whenPositionChanged(position_signal_t::slot      return mOnPositionChanged.connect(fn);  } -  //-----------------------------------------------------------------------------  // getRegionsVisited()  //----------------------------------------------------------------------------- @@ -1323,7 +1311,6 @@ F64 LLAgent::getDistanceTraveled() const      return mDistanceTraveled;  } -  //-----------------------------------------------------------------------------  // getPosAgentFromGlobal()  //----------------------------------------------------------------------------- @@ -1334,7 +1321,6 @@ LLVector3 LLAgent::getPosAgentFromGlobal(const LLVector3d &pos_global) const      return pos_agent;  } -  //-----------------------------------------------------------------------------  // getPosGlobalFromAgent()  //----------------------------------------------------------------------------- @@ -1350,7 +1336,6 @@ void LLAgent::sitDown()      setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);  } -  //-----------------------------------------------------------------------------  // resetAxes()  //----------------------------------------------------------------------------- @@ -1359,7 +1344,6 @@ void LLAgent::resetAxes()      mFrameAgent.resetAxes();  } -  // Copied from LLCamera::setOriginAndLookAt  // Look_at must be unit vector  //----------------------------------------------------------------------------- @@ -1388,7 +1372,6 @@ void LLAgent::resetAxes(const LLVector3 &look_at)      mFrameAgent.setAxes(look_at, left, up);  } -  //-----------------------------------------------------------------------------  // rotate()  //----------------------------------------------------------------------------- @@ -1397,7 +1380,6 @@ void LLAgent::rotate(F32 angle, const LLVector3 &axis)      mFrameAgent.rotate(angle, axis);  } -  //-----------------------------------------------------------------------------  // rotate()  //----------------------------------------------------------------------------- @@ -1406,7 +1388,6 @@ void LLAgent::rotate(F32 angle, F32 x, F32 y, F32 z)      mFrameAgent.rotate(angle, x, y, z);  } -  //-----------------------------------------------------------------------------  // rotate()  //----------------------------------------------------------------------------- @@ -1415,7 +1396,6 @@ void LLAgent::rotate(const LLMatrix3 &matrix)      mFrameAgent.rotate(matrix);  } -  //-----------------------------------------------------------------------------  // rotate()  //----------------------------------------------------------------------------- @@ -1424,7 +1404,6 @@ void LLAgent::rotate(const LLQuaternion &quaternion)      mFrameAgent.rotate(quaternion);  } -  //-----------------------------------------------------------------------------  // getReferenceUpVector()  //----------------------------------------------------------------------------- @@ -1453,51 +1432,71 @@ LLVector3 LLAgent::getReferenceUpVector()      return up_vector;  } -  // Radians, positive is forward into ground  //-----------------------------------------------------------------------------  // pitch()  //-----------------------------------------------------------------------------  void LLAgent::pitch(F32 angle)  { -    // don't let user pitch if pointed almost all the way down or up +    if (gAgentCamera.getCameraMode() == CAMERA_MODE_THIRD_PERSON || +        gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) +    { +        // Backup the current orientation +        LLCoordFrame saved_frame_agent(mFrameAgent); -    // A dot B = mag(A) * mag(B) * cos(angle between A and B) -    // so... cos(angle between A and B) = A dot B / mag(A) / mag(B) -    //                                  = A dot B for unit vectors +        // Optimistic rotation up/down (vertical angle can reach and exceed 0 or 180) +        mFrameAgent.pitch(angle); -    LLVector3 skyward = getReferenceUpVector(); +        // Cosine of the angle between current agent At and Up directions +        F32 agent_at_to_up_now_cos = saved_frame_agent.mXAxis * gAgentCamera.getCameraUpVector(); +        bool pitch_away_from_horizont = (angle < 0) ^ (agent_at_to_up_now_cos < 0); +        // We always allow to pitch in direction to horizont (from zenith or from nadir) +        if (!pitch_away_from_horizont) +            return; -    // clamp pitch to limits -    if (angle >= 0.f) -    { -        const F32 look_down_limit = 179.f * DEG_TO_RAD; -        F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); -        if (angle_from_skyward + angle > look_down_limit) +        // Current angle between agent At and Up directions +        F32 agent_at_to_up_now = acos(agent_at_to_up_now_cos); +        // Requested angle between agent At and Up directions +        F32 agent_at_to_up_new = agent_at_to_up_now + angle; +        F32 agent_at_to_up_new_sin = sin(agent_at_to_up_new); +        // Overpitched? Then rollback +        if (agent_at_to_up_new_sin < 1e-4)          { -            angle = look_down_limit - angle_from_skyward; +            mFrameAgent = saved_frame_agent; +            return;          } -    } -    else if (angle < 0.f) -    { -        const F32 look_up_limit = 5.f * DEG_TO_RAD; -        const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin(); -        LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); -        LLVector3 look_dir = agent_focus_pos - viewer_camera_pos; -        F32 angle_from_skyward = angle_between(look_dir, skyward); -        if (angle_from_skyward + angle < look_up_limit) + +        if (gAgentCamera.getCameraMode() == CAMERA_MODE_THIRD_PERSON || +            (isAgentAvatarValid() && gAgentAvatarp->getParent()))          { -            angle = look_up_limit - angle_from_skyward; +            // Camera sight relative to agent frame (focus - offset) +            LLVector3 camera_offset(gAgentCamera.getCameraOffsetInitial()); +            LLVector3 camera_focus(gAgentCamera.getFocusOffsetInitial()); +            LLVector3 camera_sight(camera_focus - camera_offset); +            // 2D projection of the camera sight to the XZ plane +            LLVector2 camera_sight_2d_vert(1, camera_sight[VZ]); +            camera_sight_2d_vert.normalize(); +            // Cosine of the 2D angle between initial camera At and X axis (in the XZ plane) +            F32 camera_sight_to_at_2d_vert_cos = camera_sight_2d_vert * LLVector2(LLVector3::x_axis); +            F32 camera_sight_to_at_2d_vert = acos(camera_sight_to_at_2d_vert_cos); +            // Requested angle between camera At and Up directions +            F32 camera_at_to_up_new = agent_at_to_up_new - camera_sight_to_at_2d_vert; +            F32 camera_at_to_up_new_sin = sin(camera_at_to_up_new); +            // Overpitched? Then rollback +            if (camera_at_to_up_new_sin < 1e-4) +            { +                mFrameAgent = saved_frame_agent; +                return; +            }          }      } - -    if (fabs(angle) > 1e-4) +    else      { +        // No limitations in other modes          mFrameAgent.pitch(angle);      }  } -  //-----------------------------------------------------------------------------  // roll()  //----------------------------------------------------------------------------- @@ -1506,7 +1505,6 @@ void LLAgent::roll(F32 angle)      mFrameAgent.roll(angle);  } -  //-----------------------------------------------------------------------------  // yaw()  //----------------------------------------------------------------------------- @@ -1518,7 +1516,6 @@ void LLAgent::yaw(F32 angle)      }  } -  // Returns a quat that represents the rotation of the agent in the absolute frame  //-----------------------------------------------------------------------------  // getQuat() @@ -1545,7 +1542,6 @@ void LLAgent::setControlFlags(U32 mask)      mbFlagsDirty = TRUE;  } -  //-----------------------------------------------------------------------------  // clearControlFlags()  //----------------------------------------------------------------------------- @@ -1659,7 +1655,6 @@ bool LLAgent::isDoNotDisturb() const      return mIsDoNotDisturb;  } -  //-----------------------------------------------------------------------------  // startAutoPilotGlobal()  //----------------------------------------------------------------------------- @@ -1765,7 +1760,6 @@ void LLAgent::startAutoPilotGlobal(      mAutoPilotNoProgressFrameCount = 0;  } -  //-----------------------------------------------------------------------------  // setAutoPilotTargetGlobal  //----------------------------------------------------------------------------- @@ -1819,7 +1813,6 @@ void LLAgent::startFollowPilot(const LLUUID &leader_id, BOOL allow_flying, F32 s                           allow_flying);  } -  //-----------------------------------------------------------------------------  // stopAutoPilot()  //----------------------------------------------------------------------------- @@ -1861,7 +1854,6 @@ void LLAgent::stopAutoPilot(BOOL user_cancel)      }  } -  // Returns necessary agent pitch and yaw changes, radians.  //-----------------------------------------------------------------------------  // autoPilot() @@ -2050,7 +2042,6 @@ void LLAgent::autoPilot(F32 *delta_yaw)      }  } -  //-----------------------------------------------------------------------------  // propagate()  //----------------------------------------------------------------------------- @@ -2071,11 +2062,20 @@ void LLAgent::propagate(const F32 dt)      }      // handle rotation based on keyboard levels -    const F32 YAW_RATE = 90.f * DEG_TO_RAD;             // radians per second -    yaw(YAW_RATE * gAgentCamera.getYawKey() * dt); +    if (fabs(dt) > 1e-6) +    { +        if (fabs(gAgentCamera.getYawKey()) > 1e-6) +        { +            static const F32 YAW_RATE = 90.f * DEG_TO_RAD;   // radians per second +            yaw(YAW_RATE * gAgentCamera.getYawKey() * dt); +        } -    const F32 PITCH_RATE = 90.f * DEG_TO_RAD;           // radians per second -    pitch(PITCH_RATE * gAgentCamera.getPitchKey() * dt); +        if (fabs(gAgentCamera.getPitchKey()) > 1e-6) +        { +            static const F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second +            pitch(PITCH_RATE * gAgentCamera.getPitchKey() * dt); +        } +    }      // handle auto-land behavior      if (isAgentAvatarValid()) @@ -2236,7 +2236,6 @@ void LLAgent::clearRenderState(U8 clearstate)      mRenderState &= ~clearstate;  } -  //-----------------------------------------------------------------------------  // getRenderState()  //----------------------------------------------------------------------------- @@ -2278,6 +2277,7 @@ void LLAgent::endAnimationUpdateUI()      {          return;      } +      if (gAgentCamera.getCameraMode() == gAgentCamera.getLastCameraMode())      {          // We're already done endAnimationUpdateUI for this transition. @@ -2343,9 +2343,8 @@ void LLAgent::endAnimationUpdateUI()              mViewsPushed = FALSE;          } -          gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR); -        if( gMorphView ) +        if (gMorphView)          {              gMorphView->setVisible( FALSE );          } @@ -2353,7 +2352,7 @@ void LLAgent::endAnimationUpdateUI()          // Disable mouselook-specific animations          if (isAgentAvatarValid())          { -            if( gAgentAvatarp->isAnyAnimationSignaled(AGENT_GUN_AIM_ANIMS, NUM_AGENT_GUN_AIM_ANIMS) ) +            if (gAgentAvatarp->isAnyAnimationSignaled(AGENT_GUN_AIM_ANIMS, NUM_AGENT_GUN_AIM_ANIMS))              {                  if (gAgentAvatarp->mSignaledAnimations.find(ANIM_AGENT_AIM_RIFLE_R) != gAgentAvatarp->mSignaledAnimations.end())                  { @@ -2972,7 +2971,6 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)      }  } -  void LLAgent::processMaturityPreferenceFromServer(const LLSD &result, U8 perferredMaturity)  {      U8 maturity = SIM_ACCESS_MIN; @@ -3042,7 +3040,6 @@ void LLAgent::changeInterestListMode(const std::string &new_mode)      }  } -  bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure)  {      if (getRegion()) @@ -3370,7 +3367,6 @@ void LLAgent::sendAnimationStateReset()      sendReliableMessage();  } -  // Send a message to the region to revoke sepecified permissions on ALL scripts in the region  // If the target is an object in the region, permissions in scripts on that object are cleared.  // If it is the region ID, all scripts clear the permissions for this agent @@ -4304,7 +4300,6 @@ void LLAgent::onCapabilitiesReceivedAfterTeleport()      check_merchant_status();  } -  void LLAgent::teleportRequest(      const U64& region_handle,      const LLVector3& pos_local, @@ -4404,7 +4399,6 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike)      }  } -  // James Cook, July 28, 2005  void LLAgent::teleportCancel()  { @@ -4529,7 +4523,6 @@ LLAgent::ETeleportState LLAgent::getTeleportState() const          TELEPORT_NONE : mTeleportState;  } -  void LLAgent::setTeleportState(ETeleportState state)  {      if (mTeleportRequest && (state != TELEPORT_NONE) && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed)) @@ -4574,7 +4567,6 @@ void LLAgent::setTeleportState(ETeleportState state)      }  } -  void LLAgent::stopCurrentAnimations()  {      LL_DEBUGS("Avatar") << "Stopping current animations" << LL_ENDL; @@ -4689,7 +4681,6 @@ void LLAgent::stopFidget()      gAgent.sendAnimationRequests(anims, ANIM_REQUEST_STOP);  } -  void LLAgent::requestEnterGodMode()  {      LLMessageSystem* msg = gMessageSystem; @@ -4810,7 +4801,6 @@ void LLAgent::sendAgentUpdateUserInfo(const std::string& directory_visibility)      }  } -  void LLAgent::updateAgentUserInfoCoro(std::string capurl, std::string directory_visibility)  {      LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 1912d9d1d5..3fbba7ac54 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1232,7 +1232,7 @@ void LLAgentCamera::updateCamera()      }      //NOTE - this needs to be integrated into a general upVector system here within llAgent. -    if ( camera_mode == CAMERA_MODE_FOLLOW && mFocusOnAvatar ) +    if (camera_mode == CAMERA_MODE_FOLLOW && mFocusOnAvatar)      {          mCameraUpVector = mFollowCam.getUpVector();      } @@ -1463,13 +1463,12 @@ void LLAgentCamera::updateCamera()  //  LL_INFOS() << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << LL_ENDL;      LLVector3 focus_agent = gAgent.getPosAgentFromGlobal(mFocusGlobal); +    LLVector3 position_agent = gAgent.getPosAgentFromGlobal(camera_pos_global); -    mCameraPositionAgent = gAgent.getPosAgentFromGlobal(camera_pos_global); +    // Try to move the camera -    // Move the camera - -    LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); -    //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); +    if (!LLViewerCamera::getInstance()->updateCameraLocation(position_agent, mCameraUpVector, focus_agent)) +        return;      // Change FOV      LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1477,7 +1476,7 @@ void LLAgentCamera::updateCamera()      // follow camera when in customize mode      if (cameraCustomizeAvatar())      { -        setLookAt(LOOKAT_TARGET_FOCUS, NULL, mCameraPositionAgent); +        setLookAt(LOOKAT_TARGET_FOCUS, NULL, position_agent);      }      // update the travel distance stat @@ -1496,8 +1495,8 @@ void LLAgentCamera::updateCamera()          LLVector3 head_pos = gAgentAvatarp->mHeadp->getWorldPosition() +              LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatarp->mHeadp->getWorldRotation() +              LLVector3(0.1f, 0.f, 0.f) * gAgentAvatarp->mPelvisp->getWorldRotation(); -        LLVector3 diff = mCameraPositionAgent - head_pos; -        diff = diff * ~gAgentAvatarp->mRoot->getWorldRotation(); +        LLVector3 diff = position_agent - head_pos; +        diff *= ~gAgentAvatarp->mRoot->getWorldRotation();          LLJoint* torso_joint = gAgentAvatarp->mTorsop;          LLJoint* chest_joint = gAgentAvatarp->mChestp; @@ -2259,7 +2258,7 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate)          return;      } -    if(mCameraMode != CAMERA_MODE_FOLLOW) +    if (mCameraMode != CAMERA_MODE_FOLLOW)      {          if (mCameraMode == CAMERA_MODE_MOUSELOOK)          { @@ -2271,7 +2270,8 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate)          mCameraMode = CAMERA_MODE_FOLLOW;          // bang-in the current focus, position, and up vector of the follow cam -        mFollowCam.reset(mCameraPositionAgent, LLViewerCamera::getInstance()->getPointOfInterest(), LLVector3::z_axis); +        const LLViewerCamera& camera = LLViewerCamera::instance(); +        mFollowCam.reset(camera.getOrigin(), camera.getPointOfInterest(), LLVector3::z_axis);          if (gBasicToolset)          { diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 4a9e5efadf..a2c8a6891a 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -112,6 +112,7 @@ private:      //--------------------------------------------------------------------  public:      void switchCameraPreset(ECameraPreset preset); +    ECameraPreset getCameraPreset() const { return mCameraPreset; }      /** Determines default camera offset depending on the current camera preset */      LLVector3 getCameraOffsetInitial();      /** Determines default focus offset depending on the current camera preset */ @@ -138,13 +139,14 @@ private:      //--------------------------------------------------------------------  public:      LLVector3d      getCameraPositionGlobal() const; -    const LLVector3 &getCameraPositionAgent() const; +    const LLVector3& getCameraPositionAgent() const;      LLVector3d      calcCameraPositionTargetGlobal(BOOL *hit_limit = NULL); // Calculate the camera position target      F32             getCameraMinOffGround();        // Minimum height off ground for this mode, meters      void            setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; }      BOOL            calcCameraMinDistance(F32 &obj_min_distance); -    F32             getCurrentCameraBuildOffset()   { return (F32)mCameraFocusOffset.length(); } +    F32             getCurrentCameraBuildOffset() const { return (F32)mCameraFocusOffset.length(); }      void            clearCameraLag() { mCameraLag.clearVec(); } +    const LLVector3& getCameraUpVector() const { return mCameraUpVector; }  private:      LLVector3       getAvatarRootPosition(); @@ -154,7 +156,6 @@ private:      F32             mCameraCurrentFOVZoomFactor;    // Interpolated fov zoom      LLVector4       mCameraCollidePlane;            // Colliding plane for camera      F32             mCameraZoomFraction;            // Mousewheel driven fraction of zoom -    LLVector3       mCameraPositionAgent;           // Camera position in agent coordinates      LLVector3       mCameraVirtualPositionAgent;    // Camera virtual position (target) before performing FOV zoom      LLVector3d      mCameraSmoothingLastPositionGlobal;      LLVector3d      mCameraSmoothingLastPositionAgent; @@ -188,8 +189,8 @@ private:      // Animation      //--------------------------------------------------------------------  public: -    void            setCameraAnimating(BOOL b)          { mCameraAnimating = b; } -    BOOL            getCameraAnimating()                { return mCameraAnimating; } +    void            setCameraAnimating(BOOL b) { mCameraAnimating = b; } +    BOOL            getCameraAnimating() const { return mCameraAnimating; }      void            setAnimationDuration(F32 seconds);      void            startCameraAnimation();      void            stopCameraAnimation(); @@ -278,7 +279,7 @@ public:      F32             getAgentHUDTargetZoom();      void            resetCameraZoomFraction(); -    F32             getCurrentCameraZoomFraction() { return mCameraZoomFraction; } +    F32             getCurrentCameraZoomFraction() const { return mCameraZoomFraction; }      //--------------------------------------------------------------------      // Pan diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index ecb705ec2d..4bd00bf427 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -322,9 +322,7 @@ void LLAgentPilot::moveCamera()          LLViewerCamera::getInstance()->setView(view);          LLViewerCamera::getInstance()->setOrigin(origin); -        LLViewerCamera::getInstance()->mXAxis = LLVector3(mat.mMatrix[0]); -        LLViewerCamera::getInstance()->mYAxis = LLVector3(mat.mMatrix[1]); -        LLViewerCamera::getInstance()->mZAxis = LLVector3(mat.mMatrix[2]); +        LLViewerCamera::getInstance()->setAxes(mat);      }  } diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 76271571cd..f3a5eb7c73 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -839,7 +839,7 @@ void AISAPI::onUpdateReceived(const LLSD& update, COMMAND_TYPE type, const LLSD&      if ( (type == UPDATECATEGORY || type == UPDATEITEM)          && gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))      { -        dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update); +        dump_sequential_xml(gAgentAvatarp->getDebugName() + "_ais_update", update);      }      AISUpdate ais_update(update, type, request_body); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fe567f8d1a..b825bd9f41 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2266,7 +2266,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)      }      if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))      { -        dump_sequential_xml(gAgentAvatarp->getFullname() + "_slam_request", contents); +        dump_sequential_xml(gAgentAvatarp->getDebugName() + "_slam_request", contents);      }      slam_inventory_folder(getCOF(), contents, link_waiter); @@ -3959,7 +3959,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd          LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL;          if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))          { -            dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", result); +            dump_sequential_xml(gAgentAvatarp->getDebugName() + "_appearance_request_ok", result);          }      } while (bRetry); @@ -3968,7 +3968,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd  /*static*/  void LLAppearanceMgr::debugAppearanceUpdateCOF(const LLSD& content)  { -    dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content); +    dump_sequential_xml(gAgentAvatarp->getDebugName() + "_appearance_request_error", content);      LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger()          << " ================================= " << LL_ENDL; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1626af74e2..6168f09437 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -456,11 +456,20 @@ void idle_afk_check()  {      // check idle timers      F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); -    F32 afk_timeout  = gSavedSettings.getS32("AFKTimeout"); -    if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) +    LLCachedControl<S32> afk_timeout(gSavedSettings, "AFKTimeout", 300); +    if (afk_timeout() && (current_idle > afk_timeout()))      { -        LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; -        gAgent.setAFK(); +        if (!gAgent.getAFK()) +        { +            LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; +            gAgent.setAFK(); +        } +        else +        { +            // Refresh timer so that random one click or hover won't clear the status. +            // But expanding the window still should lift afk status +            gAwayTimer.reset(); +        }      }  } diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index e1d494f7c7..08e09d2d22 100644 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -536,11 +536,12 @@ LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::replaceList(const LL          S32 search_index;          LLSD targetList;          // The following is working around the fact that LLSD arrays containing maps also seem to have undefined entries... see LLSD-30 -        for ( search_index = 0, targetList = mLists[0]; +        for ( search_index = 0;                !listFound && search_index < mLists.size(); -              search_index += 1, targetList = mLists[search_index] +              search_index += 1               )          { +            targetList = mLists[search_index];              if ( targetList.isMap() )              {                  if ( listNameMatches( targetList, listName) ) diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index ec9cf2c8b7..246630521d 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -231,7 +231,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U      {          LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*iter);          if (avatar && -            avatar->getRezzedStatus() >= 2 &&                   // Mostly rezzed (maybe without baked textures downloaded) +            avatar->getRezzedStatus() >= AV_REZZED_TEXTURED &&  // Mostly rezzed (maybe without baked textures downloaded)              !avatar->isDead() &&                                // Not dead yet              !avatar->isControlAvatar() &&                       // Not part of an animated object              avatar->getObjectHost() == regionp->getHost())      // Ensure it's on the same region diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 61fc9d00f3..29b7fff125 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -70,7 +70,7 @@ mLatestOverLimitPct(0.0f),  mShowOverLimitAgents(false),  mNotifyOutfitLoading(false),  mLastCofVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), -mLastOutfitRezStatus(-1), +mLastOutfitRezStatus(AV_REZZED_UNKNOWN),  mLastSkeletonSerialNum(-1)  {      mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 97c24c3cba..73fa87b192 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -33,6 +33,8 @@  class LLViewerRegion; +enum ERezzedStatus : S32; +  struct LLHUDComplexity  {      LLHUDComplexity() @@ -130,7 +132,7 @@ private:      S32 mLastSkeletonSerialNum;      // Used to detect changes in voavatar's rezzed status.      // If value decreases - there were changes in outfit. -    S32 mLastOutfitRezStatus; +    enum ERezzedStatus mLastOutfitRezStatus;      object_complexity_list_t mObjectComplexityList;  }; diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index b7317272a1..173cf3237d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -137,14 +137,14 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_          {              LLVector3 pos_box_offset = point_to_box_offset(vol_pos, unshift_extents);              F32 offset_dist = pos_box_offset.length(); -            if (offset_dist > MAX_LEGAL_OFFSET && offset_dist > 0.f) +            if (offset_dist > max_legal_offset && offset_dist > 0.f)              { -                F32 target_dist = (offset_dist - MAX_LEGAL_OFFSET); +                F32 target_dist = (offset_dist - max_legal_offset);                  new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;              }              if (new_pos_fixup != mPositionConstraintFixup)              { -                LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup " +                LL_DEBUGS("ConstraintFix") << getDebugName() << " pos fix, offset_dist " << offset_dist << " pos fixup "                                             << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;                  LL_DEBUGS("ConstraintFix") << "vol_pos " << vol_pos << LL_ENDL;                  LL_DEBUGS("ConstraintFix") << "extents " << extents[0] << " " << extents[1] << LL_ENDL; @@ -152,11 +152,11 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_              }          } -        if (box_size/mScaleConstraintFixup > MAX_LEGAL_SIZE) +        if (box_size/mScaleConstraintFixup > max_legal_size)          { -            new_scale_fixup = mScaleConstraintFixup* MAX_LEGAL_SIZE /box_size; -            LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, box_size " << box_size << " fixup " -                                       << mScaleConstraintFixup << " max legal " << MAX_LEGAL_SIZE +            new_scale_fixup = mScaleConstraintFixup*max_legal_size/box_size; +            LL_DEBUGS("ConstraintFix") << getDebugName() << " scale fix, box_size " << box_size << " fixup " +                                       << mScaleConstraintFixup << " max legal " << max_legal_size                                         << " -> new scale " << new_scale_fixup << LL_ENDL;          }      } @@ -239,7 +239,7 @@ void LLControlAvatar::matchVolumeTransform()              const LLMeshSkinInfo* skin_info = mRootVolp->getSkinInfo();              if (skin_info)              { -                LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL; +                LL_DEBUGS("BindShape") << getDebugName() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL;                  bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(skin_info->mBindShapeMatrix));              }  #endif diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index dd4ca845a0..8c3d2219bc 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -647,7 +647,7 @@ void LLConversationLog::onClearLogResponse(const LLSD& notification, const LLSD&      {          mConversations.clear();          notifyObservers(); -        cache(); +        saveToFile(getFileName());          deleteBackupLogs();      }  } diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 2d44949c4a..bede506a7f 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -756,9 +756,12 @@ void LLRenderPass::pushGLTFBatch(LLDrawInfo& params)  {      auto& mat = params.mGLTFMaterial; -    mat->bind(params.mTexture); +    if (mat.notNull()) +    { +        mat->bind(params.mTexture); +    } -    LLGLDisable cull_face(mat->mDoubleSided ? GL_CULL_FACE : 0); +    LLGLDisable cull_face(mat.notNull() && mat->mDoubleSided ? GL_CULL_FACE : 0);      setup_texture_matrix(params); diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index f3b924a306..9bc012d6f0 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -33,6 +33,7 @@  #include "llagentui.h"  #include "llbase64.h"  #include "llcallbacklist.h" +#include "lldate.h"  #include "llenvironment.h"  #include "llimagejpeg.h"  #include "llmediactrl.h" @@ -83,7 +84,7 @@ LLFloater360Capture::~LLFloater360Capture()      // Normally LLFloater360Capture tells the Simulator send everything      // and now reverts to the regular "keyhole" frustum of interest      // list updates. -    if (!LLApp::isExiting() && +    if (!LLApp::isExiting() &&           gSavedSettings.getBOOL("360CaptureUseInterestListCap") &&          mStartILMode != gAgent.getInterestListMode())      { @@ -578,7 +579,7 @@ void LLFloater360Capture::capture360Images()          LLViewerStats::instance().getRecording().resume();          LLAppViewer::instance()->resumeMainloopTimeout(); - +                  // update main loop timeout state          LLAppViewer::instance()->pingMainloopTimeout("LLFloater360Capture::capture360Images");      } @@ -862,15 +863,7 @@ const std::string LLFloater360Capture::generate_proposed_filename()      filename << "_";      // add in the current HH-MM-SS (with leading 0's) so users can easily save many shots in same folder -    std::time_t cur_epoch = std::time(nullptr); -    std::tm* tm_time = std::localtime(&cur_epoch); -    filename << std::setfill('0') << std::setw(4) << (tm_time->tm_year + 1900); -    filename << std::setfill('0') << std::setw(2) << (tm_time->tm_mon + 1); -    filename << std::setfill('0') << std::setw(2) << tm_time->tm_mday; -    filename << "_"; -    filename << std::setfill('0') << std::setw(2) << tm_time->tm_hour; -    filename << std::setfill('0') << std::setw(2) << tm_time->tm_min; -    filename << std::setfill('0') << std::setw(2) << tm_time->tm_sec; +    filename << LLDate::now().toLocalDateString("%Y%m%d_%H%M%S");      // the unusual way we save the output image (originates in the      // embedded browser and not the C++ code) means that the system diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp index bdcaf2dc22..71a7875931 100644 --- a/indra/newview/llfloaterautoreplacesettings.cpp +++ b/indra/newview/llfloaterautoreplacesettings.cpp @@ -422,7 +422,13 @@ bool LLFloaterAutoReplaceSettings::callbackNewListName(const LLSD& notification,      LLSD newList = notification["payload"]["list"]; -    if ( response.has("listname") && response["listname"].isString() ) +    S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +    if (option != 1) // Must also match RenameAutoReplaceList +    { +        // user cancelled +        return false; +    } +    else if (response.has("listname") && response["listname"].isString() )      {          std::string newName = response["listname"].asString();          LLAutoReplaceSettings::setListName(newList, newName); @@ -508,12 +514,53 @@ bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notifica      return false;  } +bool LLFloaterAutoReplaceSettings::callbackRemoveList(const LLSD& notification, const LLSD& response) +{ +    std::string listName = notification["payload"]["list"]; + +    S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +    switch (option) +    { +    case 1: +        if (mSettings.removeReplacementList(listName)) +        { +            LL_INFOS("AutoReplace") << "deleted list '" << listName << "'" << LL_ENDL; +            mReplacementsList->deleteSelectedItems();   // remove from the scrolling list +            mSelectedListName.clear(); +            updateListNames(); +            updateListNamesControls(); +            updateReplacementsList(); +        } +        break; +    case 0: +        break; + +    default: +        LL_ERRS("AutoReplace") << "invalid selected option " << option << LL_ENDL; +    } + +    return false; +} +  void LLFloaterAutoReplaceSettings::onDeleteList()  {      std::string listName = mListNames->getSelectedValue().asString();      if ( ! listName.empty() )      { -        if ( mSettings.removeReplacementList(listName) ) +        const LLSD* mappings = mSettings.getListEntries(mSelectedListName); +        if (mappings->size() > 0) +        { +            LLSD payload; +            payload["list"] = listName; + +            LLSD args; +            args["MAP_SIZE"] = llformat("%d",mappings->size()); +            args["LIST_NAME"] = listName; + +            LLNotificationsUtil::add("RemoveAutoReplaceList", args, payload, +                boost::bind(&LLFloaterAutoReplaceSettings::callbackRemoveList, this, _1, _2)); +        } +        else if ( mSettings.removeReplacementList(listName) )          {              LL_INFOS("AutoReplace")<<"deleted list '"<<listName<<"'"<<LL_ENDL;              mReplacementsList->deleteSelectedItems();   // remove from the scrolling list diff --git a/indra/newview/llfloaterautoreplacesettings.h b/indra/newview/llfloaterautoreplacesettings.h index 7f1953d485..8b752a6f5a 100644 --- a/indra/newview/llfloaterautoreplacesettings.h +++ b/indra/newview/llfloaterautoreplacesettings.h @@ -107,6 +107,8 @@ private:      bool callbackNewListName(const LLSD& notification, const LLSD& response);      /// called from the RenameAutoReplaceList notification dialog      bool callbackListNameConflict(const LLSD& notification, const LLSD& response); +    /// called from the RemoveAutoReplaceList notification dialog +    bool callbackRemoveList(const LLSD& notification, const LLSD& response);      bool selectedListIsFirst();      bool selectedListIsLast(); diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 1fb0a72d3e..5c80d9cdc9 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -118,8 +118,8 @@ std::string STATUS[] =  //-----------------------------------------------------------------------------  // LLFloaterBvhPreview()  //----------------------------------------------------------------------------- -LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename) : -    LLFloaterNameDesc(filename) +LLFloaterBvhPreview::LLFloaterBvhPreview(const LLSD& args) : +    LLFloaterNameDesc(args)  {      mLastMouseX = 0;      mLastMouseY = 0; @@ -1013,7 +1013,8 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)                      LLFloaterPerms::getNextOwnerPerms("Uploads"),                      LLFloaterPerms::getGroupPerms("Uploads"),                      LLFloaterPerms::getEveryonePerms("Uploads"), -                    expected_upload_cost)); +                    expected_upload_cost, +                    floaterp->mDestinationFolderId));                  upload_new_resource(assetUploadInfo);              } diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h index 9de74c39cd..4dd28389a5 100644 --- a/indra/newview/llfloaterbvhpreview.h +++ b/indra/newview/llfloaterbvhpreview.h @@ -70,7 +70,7 @@ protected:  class LLFloaterBvhPreview : public LLFloaterNameDesc  {  public: -    LLFloaterBvhPreview(const std::string& filename); +    LLFloaterBvhPreview(const LLSD& args);      virtual ~LLFloaterBvhPreview();      BOOL postBuild(); diff --git a/indra/newview/llfloatereditenvironmentbase.h b/indra/newview/llfloatereditenvironmentbase.h index 1b7771fe94..0b7d5ca39b 100644 --- a/indra/newview/llfloatereditenvironmentbase.h +++ b/indra/newview/llfloatereditenvironmentbase.h @@ -133,7 +133,8 @@ protected:      LLSettingsEditPanel() :          LLPanel(),          mIsDirty(false), -        mOnDirtyChanged() +        mOnDirtyChanged(), +        mCanEdit(false)      {}  private: diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 73adb2175a..da3a0b16a8 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -72,8 +72,8 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 320;  //-----------------------------------------------------------------------------  // LLFloaterImagePreview()  //----------------------------------------------------------------------------- -LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : -    LLFloaterNameDesc(filename), +LLFloaterImagePreview::LLFloaterImagePreview(const LLSD& args) : +    LLFloaterNameDesc(args),      mAvatarPreview(NULL),      mSculptedPreview(NULL), diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index 6cd5bb4ca7..6f0b20d14c 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -110,7 +110,7 @@ protected:  class LLFloaterImagePreview : public LLFloaterNameDesc  {  public: -    LLFloaterImagePreview(const std::string& filename); +    LLFloaterImagePreview(const LLSD& args);      virtual ~LLFloaterImagePreview();      BOOL postBuild() override; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 0ef7353eac..ab5766f260 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -349,14 +349,14 @@ void LLFloaterModelPreview::initModelPreview()  }  //static -bool LLFloaterModelPreview::showModelPreview() +void LLFloaterModelPreview::showModelPreview(const LLUUID& dest_folder)  {      LLFloaterModelPreview* fmp = (LLFloaterModelPreview*)LLFloaterReg::getInstance("upload_model");      if (fmp && !fmp->isModelLoading())      { +        fmp->setUploadDestination(dest_folder);          fmp->loadHighLodModel();      } -    return true;  }  void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl) @@ -505,7 +505,7 @@ void LLFloaterModelPreview::onClickCalculateBtn()      gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,                            childGetValue("upload_textures").asBoolean(),                            upload_skinweights, upload_joint_positions, lock_scale_if_joint_position, -                          mUploadModelUrl, false, +                          mUploadModelUrl, mDestinationFolderId, false,                            getWholeModelFeeObserverHandle());      toggleCalculateButton(false); @@ -1655,7 +1655,7 @@ void LLFloaterModelPreview::onUpload(void* user_data)      gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale,                            mp->childGetValue("upload_textures").asBoolean(),                            upload_skinweights, upload_joint_positions, lock_scale_if_joint_position, -                          mp->mUploadModelUrl, +                          mp->mUploadModelUrl, mp->mDestinationFolderId,                            true, LLHandle<LLWholeModelFeeObserver>(), mp->getWholeModelUploadObserverHandle());  } @@ -1765,9 +1765,15 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)      if (index == LLModelPreview::MESH_OPTIMIZER_AUTO          || index == LLModelPreview::MESH_OPTIMIZER_SLOPPY          || index == LLModelPreview::MESH_OPTIMIZER_PRECISE) -    { //rebuild LoD to update triangle counts +    { +        // rebuild LoD to update triangle counts          onLODParamCommit(lod, true);      } +    if (index == LLModelPreview::USE_LOD_ABOVE) +    { +        // refresh to pick triangle counts +        mModelPreview->mDirty = true; +    }  }  void LLFloaterModelPreview::resetDisplayOptions() diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 20e645532b..018014ba04 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -73,7 +73,8 @@ public:      /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);      void initModelPreview(); -    static bool showModelPreview(); +    void setUploadDestination(const LLUUID& dest_folder) { mDestinationFolderId = dest_folder; } +    static void showModelPreview(const LLUUID& dest_folder = LLUUID::null);      BOOL handleMouseDown(S32 x, S32 y, MASK mask);      BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -164,9 +165,6 @@ protected:      static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata);      static void onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata); -    static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata); -    static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata); -    static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata);      void            draw(); @@ -225,6 +223,7 @@ private:      void createSmoothComboBox(LLComboBox* combo_box, float min, float max); +    LLUUID mDestinationFolderId;      LLButton* mUploadBtn;      LLButton* mCalculateBtn;      LLViewerTextEditor* mUploadLogText; diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index f93af9c312..48138a258a 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -1,25 +1,25 @@ -/** +/**    * @file llfloatergesture.cpp   * @brief LLFloaterMyEnvironment class implementation   *   * $LicenseInfo:firstyear=2002&license=viewerlgpl$   * Second Life Viewer Source Code   * Copyright (C) 2019, 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$   */ @@ -38,7 +38,9 @@  #include "llcheckboxctrl.h"  #include "llviewerinventory.h"  #include "llenvironment.h" +#include "llnotificationsutil.h"  #include "llparcel.h" +#include "lltrans.h"  #include "llviewerparcelmgr.h"  //========================================================================= @@ -223,6 +225,35 @@ void LLFloaterMyEnvironment::onFilterEdit(const std::string& search_string)      mInventoryList->setFilterSubString(search_string);  } +void LLFloaterMyEnvironment::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, uuid_vec_t item_ids) +{ +    S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +    if (option == 0) +    { +        const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); +        for (const LLUUID& itemid : item_ids) +        { +            LLInventoryItem* inv_item = gInventory.getItem(itemid); + +            if (inv_item && inv_item->getInventoryType() == LLInventoryType::IT_SETTINGS) +            { +                LLInventoryModel::update_list_t update; +                LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); +                update.push_back(old_folder); +                LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1); +                update.push_back(new_folder); +                gInventory.accountForUpdate(update); + +                LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item); +                new_item->setParent(trash_id); +                new_item->updateParentOnServer(FALSE); +                gInventory.updateItem(new_item); +            } +        } +        gInventory.notifyObservers(); +    } +} +  void LLFloaterMyEnvironment::onDeleteSelected()  {      uuid_vec_t selected; @@ -231,27 +262,16 @@ void LLFloaterMyEnvironment::onDeleteSelected()      if (selected.empty())          return; -    const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); -    for (const LLUUID& itemid: selected) -    { -        LLInventoryItem* inv_item = gInventory.getItem(itemid); - -        if (inv_item && inv_item->getInventoryType() == LLInventoryType::IT_SETTINGS) +    LLSD args; +    args["QUESTION"] = LLTrans::getString(selected.size() > 1 ? "DeleteItems" : "DeleteItem"); +    LLNotificationsUtil::add( +        "DeleteItems", +        args, +        LLSD(), +        [this, selected](const LLSD& notification, const LLSD& response)          { -            LLInventoryModel::update_list_t update; -            LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); -            update.push_back(old_folder); -            LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1); -            update.push_back(new_folder); -            gInventory.accountForUpdate(update); - -            LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item); -            new_item->setParent(trash_id); -            new_item->updateParentOnServer(FALSE); -            gInventory.updateItem(new_item); -        } -    } -    gInventory.notifyObservers(); +            onItemsRemovalConfirmation(notification, response, selected); +        });  } @@ -278,7 +298,7 @@ void LLFloaterMyEnvironment::onDoApply(const std::string &context)          std::string name = itemp->getName();          U32 flags(0); - +                  if (!itemp->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID()))              flags |= LLSettingsBase::FLAG_NOMOD;          if (!itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) @@ -317,14 +337,14 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)          return false;      if (context == PARAMETER_EDIT) -    { -        return (selected.size() == 1) && isSettingSelected(selected.front()); +    {  +        return (selected.size() == 1) && isSettingId(selected.front());      }      else if (context == PARAMETER_COPY)      {          for (std::vector<LLUUID>::iterator it = selected.begin(); it != selected.end(); it++)          { -            if(!isSettingSelected(*it)) +            if(!isSettingId(*it))              {                  return false;              } @@ -340,7 +360,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)          LLClipboard::instance().pasteFromClipboard(ids);          for (std::vector<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)          { -            if (!isSettingSelected(*it)) +            if (!isSettingId(*it))              {                  return false;              } @@ -349,7 +369,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)      }      else if (context == PARAMETER_COPYUUID)      { -        return (selected.size() == 1) && isSettingSelected(selected.front()); +        return (selected.size() == 1) && isSettingId(selected.front());      }      return false; @@ -364,17 +384,43 @@ bool LLFloaterMyEnvironment::canApply(const std::string &context)          return false;      if (context == PARAMETER_REGION) -    { -        return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); +    {  +        return isSettingId(selected.front()) && LLEnvironment::instance().canAgentUpdateRegionEnvironment();      }      else if (context == PARAMETER_PARCEL) +    {  +        return isSettingId(selected.front()) && LLEnvironment::instance().canAgentUpdateParcelEnvironment(); +    } +    else if (context == PARAMETER_LOCAL)      { -        return LLEnvironment::instance().canAgentUpdateParcelEnvironment(); +        return isSettingId(selected.front());      } -    else + +    return false; +} + +bool can_delete(const LLUUID& id) +{ +    const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); +    if (id == trash_id || gInventory.isObjectDescendentOf(id, trash_id)) +    { +        return false; +    } + +    LLViewerInventoryCategory* cat = gInventory.getCategory(id); +    if (cat)      { -        return (context == PARAMETER_LOCAL); +        if (!get_is_category_removable(&gInventory, id)) +        { +            return false; +        } +    } +    else if (!get_is_item_removable(&gInventory, id, false)) +    { +        return false;      } + +    return true;  }  //------------------------------------------------------------------------- @@ -387,7 +433,14 @@ void LLFloaterMyEnvironment::refreshButtonStates()      getChild<LLUICtrl>(BUTTON_GEAR)->setEnabled(settings_ok);      getChild<LLUICtrl>(BUTTON_NEWSETTINGS)->setEnabled(true); -    getChild<LLUICtrl>(BUTTON_DELETE)->setEnabled(settings_ok && !selected.empty()); + +    bool enable_delete = false; +    if(settings_ok && !selected.empty()) +    { +        enable_delete = can_delete(selected.front()); +    } + +    getChild<LLUICtrl>(BUTTON_DELETE)->setEnabled(enable_delete);  }  //------------------------------------------------------------------------- @@ -436,7 +489,7 @@ LLUUID LLFloaterMyEnvironment::findItemByAssetId(LLUUID asset_id, bool copyable_      return LLUUID::null;  } -bool LLFloaterMyEnvironment::isSettingSelected(LLUUID item_id) +bool LLFloaterMyEnvironment::isSettingId(const LLUUID& item_id)  {      LLInventoryItem* itemp = gInventory.getItem(item_id); diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index 54e23c4f6e..4f1cdf6a3e 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -60,6 +60,7 @@ private:      void                            onFilterCheckChange();      void                            onFilterEdit(const std::string& search_string);      void                            onSelectionChange(); +    void                            onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, uuid_vec_t item_ids);      void                            onDeleteSelected();      void                            onDoCreate(const LLSD &data);      void                            onDoApply(const std::string &context); @@ -69,7 +70,7 @@ private:      void                            getSelectedIds(uuid_vec_t& ids) const;      void                            refreshButtonStates(); -    bool                            isSettingSelected(LLUUID item_id); +    static bool                     isSettingId(const LLUUID &item_id);      static LLUUID                   findItemByAssetId(LLUUID asset_id, bool copyable_only, bool ignore_library);  }; diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index b47deb838b..ffb21f34c9 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -62,11 +62,20 @@ const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;  //-----------------------------------------------------------------------------  // LLFloaterNameDesc()  //----------------------------------------------------------------------------- -LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& filename ) -    : LLFloater(filename), -      mIsAudio(FALSE) +LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& args) +    : LLFloater(args) +    , mIsAudio(FALSE) +    , mIsText(FALSE)  { -    mFilenameAndPath = filename.asString(); +    if (args.isString()) +    { +        mFilenameAndPath = args.asString(); +    } +    else +    { +        mFilenameAndPath = args["filename"].asString(); +        mDestinationFolderId = args["dest"].asUUID(); +    }      mFilename = gDirUtilp->getBaseFileName(mFilenameAndPath, false);  } @@ -203,7 +212,8 @@ void LLFloaterNameDesc::onBtnOK( )              LLFloaterPerms::getNextOwnerPerms("Uploads"),              LLFloaterPerms::getGroupPerms("Uploads"),              LLFloaterPerms::getEveryonePerms("Uploads"), -            expected_upload_cost)); +            expected_upload_cost, +            mDestinationFolderId));          upload_new_resource(uploadInfo, callback, nruserdata);      } @@ -230,8 +240,8 @@ void LLFloaterNameDesc::onBtnCancel()  // LLFloaterSoundPreview()  //----------------------------------------------------------------------------- -LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& filename ) -    : LLFloaterNameDesc(filename) +LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& args ) +    : LLFloaterNameDesc(args)  {      mIsAudio = TRUE;  } @@ -251,8 +261,8 @@ BOOL LLFloaterSoundPreview::postBuild()  // LLFloaterAnimPreview()  //----------------------------------------------------------------------------- -LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& filename ) -    : LLFloaterNameDesc(filename) +LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& args ) +    : LLFloaterNameDesc(args)  {  } @@ -270,8 +280,8 @@ BOOL LLFloaterAnimPreview::postBuild()  // LLFloaterScriptPreview()  //----------------------------------------------------------------------------- -LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename ) -    : LLFloaterNameDesc(filename) +LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& args ) +    : LLFloaterNameDesc(args)  {      mIsText = TRUE;  } diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h index 4b3a9b536d..c1e688151e 100644 --- a/indra/newview/llfloaternamedesc.h +++ b/indra/newview/llfloaternamedesc.h @@ -39,7 +39,7 @@ class LLRadioGroup;  class LLFloaterNameDesc : public LLFloater  {  public: -    LLFloaterNameDesc(const LLSD& filename); +    LLFloaterNameDesc(const LLSD& args);      virtual ~LLFloaterNameDesc();      virtual BOOL postBuild(); @@ -58,26 +58,27 @@ protected:      std::string     mFilenameAndPath;      std::string     mFilename; +    LLUUID          mDestinationFolderId;  };  class LLFloaterSoundPreview : public LLFloaterNameDesc  {  public: -    LLFloaterSoundPreview(const LLSD& filename ); +    LLFloaterSoundPreview(const LLSD& args );      virtual BOOL postBuild();  };  class LLFloaterAnimPreview : public LLFloaterNameDesc  {  public: -    LLFloaterAnimPreview(const LLSD& filename ); +    LLFloaterAnimPreview(const LLSD& args );      virtual BOOL postBuild();  };  class LLFloaterScriptPreview : public LLFloaterNameDesc  {  public: -    LLFloaterScriptPreview(const LLSD& filename ); +    LLFloaterScriptPreview(const LLSD& args );      virtual BOOL postBuild();  }; diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp index 090b0657d1..8e102ab3b2 100644 --- a/indra/newview/llfloaterobjectweights.cpp +++ b/indra/newview/llfloaterobjectweights.cpp @@ -36,6 +36,14 @@  #include "llviewerparcelmgr.h"  #include "llviewerregion.h" +static const std::string lod_strings[4] = +{ +    "lowest_lod", +    "low_lod", +    "medium_lod", +    "high_lod", +}; +  // virtual  bool LLCrossParcelFunctor::apply(LLViewerObject* obj)  { @@ -75,7 +83,10 @@ LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)      mSelectedOnLand(NULL),      mRezzedOnLand(NULL),      mRemainingCapacity(NULL), -    mTotalCapacity(NULL) +    mTotalCapacity(NULL), +    mLodLevel(nullptr), +    mTrianglesShown(nullptr), +    mPixelArea(nullptr)  {  } @@ -99,6 +110,10 @@ BOOL LLFloaterObjectWeights::postBuild()      mRemainingCapacity = getChild<LLTextBox>("remaining_capacity");      mTotalCapacity = getChild<LLTextBox>("total_capacity"); +    mLodLevel = getChild<LLTextBox>("lod_level"); +    mTrianglesShown = getChild<LLTextBox>("triangles_shown"); +    mPixelArea = getChild<LLTextBox>("pixel_area"); +      return TRUE;  } @@ -135,6 +150,69 @@ void LLFloaterObjectWeights::setErrorStatus(S32 status, const std::string& reaso      toggleWeightsLoadingIndicators(false);  } +void LLFloaterObjectWeights::draw() +{ +    // Normally it's a bad idea to set text and visibility inside draw +    // since it can cause rect updates go to different, already drawn elements, +    // but floater is very simple and these elements are supposed to be isolated +    LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); +    if (selection->isEmpty()) +    { +        const std::string text = getString("nothing_selected"); +        mLodLevel->setText(text); +        mTrianglesShown->setText(text); +        mPixelArea->setText(text); + +        toggleRenderLoadingIndicators(false); +    } +    else +    { +        S32 object_lod = -1; +        bool multiple_lods = false; +        S32 total_tris = 0; +        S32 pixel_area = 0; +        for (LLObjectSelection::valid_root_iterator iter = selection->valid_root_begin(); +            iter != selection->valid_root_end(); ++iter) +        { +            LLViewerObject* object = (*iter)->getObject(); +            S32 lod = object->getLOD(); +            if (object_lod < 0) +            { +                object_lod = lod; +            } +            else if (object_lod != lod) +            { +                multiple_lods = true; +            } + +            if (object->isRootEdit()) +            { +                total_tris += object->recursiveGetTriangleCount(); +                pixel_area += object->getPixelArea(); +            } +        } + +        if (multiple_lods) +        { +            mLodLevel->setText(getString("multiple_lods")); +            toggleRenderLoadingIndicators(false); +        } +        else if (object_lod < 0) +        { +            // nodes are waiting for data +            toggleRenderLoadingIndicators(true); +        } +        else +        { +            mLodLevel->setText(getString(lod_strings[object_lod])); +            toggleRenderLoadingIndicators(false); +        } +        mTrianglesShown->setText(llformat("%d", total_tris)); +        mPixelArea->setText(llformat("%d", pixel_area)); +    } +    LLFloater::draw(); +} +  void LLFloaterObjectWeights::updateLandImpacts(const LLParcel* parcel)  {      if (!parcel || LLSelectMgr::getInstance()->getSelection()->isEmpty()) @@ -252,6 +330,17 @@ void LLFloaterObjectWeights::toggleLandImpactsLoadingIndicators(bool visible)      mTotalCapacity->setVisible(!visible);  } +void LLFloaterObjectWeights::toggleRenderLoadingIndicators(bool visible) +{ +    childSetVisible("lod_level_loading_indicator", visible); +    childSetVisible("triangles_shown_loading_indicator", visible); +    childSetVisible("pixel_area_loading_indicator", visible); + +    mLodLevel->setVisible(!visible); +    mTrianglesShown->setVisible(!visible); +    mPixelArea->setVisible(!visible); +} +  void LLFloaterObjectWeights::updateIfNothingSelected()  {      const std::string text = getString("nothing_selected"); @@ -269,6 +358,11 @@ void LLFloaterObjectWeights::updateIfNothingSelected()      mRemainingCapacity->setText(text);      mTotalCapacity->setText(text); +    mLodLevel->setText(text); +    mTrianglesShown->setText(text); +    mPixelArea->setText(text); +      toggleWeightsLoadingIndicators(false);      toggleLandImpactsLoadingIndicators(false); +    toggleRenderLoadingIndicators(false);  } diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h index 10e790f5aa..5d67a12f13 100644 --- a/indra/newview/llfloaterobjectweights.h +++ b/indra/newview/llfloaterobjectweights.h @@ -58,21 +58,24 @@ public:      LLFloaterObjectWeights(const LLSD& key);      ~LLFloaterObjectWeights(); -    /*virtual*/ BOOL postBuild(); +     BOOL postBuild() override; -    /*virtual*/ void onOpen(const LLSD& key); +    void onOpen(const LLSD& key) override; -    /*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost); -    /*virtual*/ void setErrorStatus(S32 status, const std::string& reason); +    void onWeightsUpdate(const SelectionCost& selection_cost) override; +    void setErrorStatus(S32 status, const std::string& reason) override; + +    void draw() override;      void updateLandImpacts(const LLParcel* parcel); -    void refresh(); +    void refresh() override;  private: -    /*virtual*/ void generateTransactionID(); +    void generateTransactionID() override;      void toggleWeightsLoadingIndicators(bool visible);      void toggleLandImpactsLoadingIndicators(bool visible); +    void toggleRenderLoadingIndicators(bool visible);      void updateIfNothingSelected(); @@ -88,6 +91,10 @@ private:      LLTextBox       *mRezzedOnLand;      LLTextBox       *mRemainingCapacity;      LLTextBox       *mTotalCapacity; + +    LLTextBox       *mLodLevel; +    LLTextBox       *mTrianglesShown; +    LLTextBox       *mPixelArea;  };  #endif //LL_LLFLOATEROBJECTWEIGHTS_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d731f1c592..481c13846a 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1913,7 +1913,21 @@ void LLFloaterPreference::selectChatPanel()  void LLFloaterPreference::changed()  { -    getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0); +    if (LLConversationLog::instance().getIsLoggingEnabled()) +    { +        getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0); +    } +    else +    { +        // onClearLog clears list, then notifies changed() and only then clears file, +        // so check presence of conversations before checking file, file will cleared later. +        llstat st; +        bool has_logs = LLConversationLog::instance().getConversations().size() > 0 +                        && LLFile::stat(LLConversationLog::instance().getFileName(), &st) == 0 +                        && S_ISREG(st.st_mode) +                        && st.st_size > 0; +        getChild<LLButton>("clear_log")->setEnabled(has_logs); +    }      // set 'enable' property for 'Delete transcripts...' button      updateDeleteTranscriptsButton(); diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp new file mode 100644 index 0000000000..aa5532f0fc --- /dev/null +++ b/indra/newview/llhudeffectresetskeleton.cpp @@ -0,0 +1,210 @@ +/** + * @file llhudeffectresetskeleton.cpp + * @brief LLHUDEffectResetSkeleton class implementation + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, 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 "llhudeffectresetskeleton.h" + +#include "llagent.h" +#include "llviewerobjectlist.h" +#include "llvoavatar.h" +#include "message.h" + +// packet layout +const S32 TARGET_OBJECT = 0; // This is to allow for targetting owned animesh +const S32 RESET_ANIMATIONS = 16; //This can also be a flags if needed +const S32 PKT_SIZE = 17; + +//----------------------------------------------------------------------------- +// LLHUDEffectResetSkeleton() +//----------------------------------------------------------------------------- +LLHUDEffectResetSkeleton::LLHUDEffectResetSkeleton(const U8 type) : +    LLHUDEffect(type) +{ +} + +//----------------------------------------------------------------------------- +// ~LLHUDEffectResetSkeleton() +//----------------------------------------------------------------------------- +LLHUDEffectResetSkeleton::~LLHUDEffectResetSkeleton() +{ +} + +//----------------------------------------------------------------------------- +// packData() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::packData(LLMessageSystem *mesgsys) +{ +    // Pack the default data +    LLHUDEffect::packData(mesgsys); + +    // Pack the type-specific data.  Uses a fun packed binary format.  Whee! +    U8 packed_data[PKT_SIZE]; +    memset(packed_data, 0, PKT_SIZE); + +    // pack both target object and position +    // position interpreted as offset if target object is non-null +    if (mTargetObject) +    { +        htolememcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16); +    } +    else +    { +        htolememcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); +    } + +    U8 resetAnimations = (U8)mResetAnimations; +    htolememcpy(&(packed_data[RESET_ANIMATIONS]), &resetAnimations, MVT_U8, 1); + +    mesgsys->addBinaryDataFast(_PREHASH_TypeData, packed_data, PKT_SIZE); +} + +//----------------------------------------------------------------------------- +// unpackData() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::unpackData(LLMessageSystem *mesgsys, S32 blocknum) +{ +    LLVector3d new_target; +    U8 packed_data[PKT_SIZE]; + + +    LLHUDEffect::unpackData(mesgsys, blocknum); + +    LLUUID source_id; +    mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_AgentID, source_id, blocknum); + +    LLViewerObject *objp = gObjectList.findObject(source_id); +    if (objp && objp->isAvatar()) +    { +        setSourceObject(objp); +    } +    else +    { +        //LL_WARNS() << "Could not find source avatar for ResetSkeleton effect" << LL_ENDL; +        return; +    } + +    S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); +    if (size != PKT_SIZE) +    { +        LL_WARNS() << "ResetSkeleton effect with bad size " << size << LL_ENDL; +        return; +    } + +    mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum); + +    LLUUID target_id; +    htolememcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); + +    // The purpose for having a target ID is if we want to reset animesh, or +    // other things in the future. +    // I implemented this, but due to issues regarding various permission +    // checks, I scrapped it for now. --Chaser Zaks +    // See https://github.com/secondlife/viewer/pull/1212 for additional info + +    if (target_id.isNull()) +    { +        target_id = source_id; +    } + +    objp = gObjectList.findObject(target_id); + +    if (objp) +    { +        setTargetObject(objp); +    } + +    U8 resetAnimations = 0; +    htolememcpy(&resetAnimations, &(packed_data[RESET_ANIMATIONS]), MVT_U8, 1); + +    // Pre-emptively assume this is going to be flags in the future. +    // It isn't needed now, but this will assure that only bit 1 is set +    mResetAnimations = resetAnimations & 1; + +    update(); +} + +//----------------------------------------------------------------------------- +// setTargetObjectAndOffset() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::setTargetObject(LLViewerObject *objp) +{ +    mTargetObject = objp; +} + + +//----------------------------------------------------------------------------- +// markDead() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::markDead() +{ +    LLHUDEffect::markDead(); +} + +void LLHUDEffectResetSkeleton::setSourceObject(LLViewerObject* objectp) +{ +    // restrict source objects to avatars +    if (objectp && objectp->isAvatar()) +    { +        LLHUDEffect::setSourceObject(objectp); +    } +} + +//----------------------------------------------------------------------------- +// update() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::update() +{ +    // If the target object is dead, set the target object to NULL +    if (mTargetObject.isNull() || mTargetObject->isDead()) +    { +        markDead(); +        return; +    } + +    if (mSourceObject.isNull() || mSourceObject->isDead()) +    { +        markDead(); +        return; +    } + +    if (mTargetObject->isAvatar()) +    { +        // Only the owner of a avatar can reset their skeleton like this +        if (mSourceObject->getID() == mTargetObject->getID()) +        { +            LLVOAvatar* avatar = mTargetObject->asAvatar(); +            avatar->resetSkeleton(mResetAnimations); +        } +    } +    else +    { +        LL_WARNS() << mSourceObject->getID() << " attempted to reset skeleton on " +                << mTargetObject->getID() << ", but it is not a avatar!" << LL_ENDL; +    } + +    markDead(); +} diff --git a/indra/newview/llhudeffectresetskeleton.h b/indra/newview/llhudeffectresetskeleton.h new file mode 100644 index 0000000000..39a6137054 --- /dev/null +++ b/indra/newview/llhudeffectresetskeleton.h @@ -0,0 +1,59 @@ +/** + * @file llhudeffectresetskeleton.h + * @brief LLHUDEffectResetSkeleton class definition + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, 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$ + */ + +#ifndef LL_LLHUDEFFECTRESETSKELETON_H +#define LL_LLHUDEFFECTRESETSKELETON_H + +#include "llhudeffect.h" + +class LLViewerObject; +class LLVOAvatar; + + +class LLHUDEffectResetSkeleton final : public LLHUDEffect +{ +public: +    friend class LLHUDObject; + +    /*virtual*/ void markDead(); +    /*virtual*/ void setSourceObject(LLViewerObject* objectp); + +    void setTargetObject(LLViewerObject *objp); +    void setResetAnimations(bool enable){ mResetAnimations = enable; }; + +protected: +    LLHUDEffectResetSkeleton(const U8 type); +    ~LLHUDEffectResetSkeleton(); + +    /*virtual*/ void packData(LLMessageSystem *mesgsys); +    /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); + +    void update(); +private: +    bool                        mResetAnimations; +}; + +#endif // LL_LLHUDEFFECTRESETSKELETON_H diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index e922e8230c..0547b8086c 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -36,6 +36,7 @@  #include "llhudeffecttrail.h"  #include "llhudeffectlookat.h"  #include "llhudeffectpointat.h" +#include "llhudeffectresetskeleton.h"  #include "llhudnametag.h"  #include "llvoicevisualizer.h" @@ -241,6 +242,9 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)      case LL_HUD_EFFECT_BLOB:          hud_objectp = new LLHUDEffectBlob(type);          break; +    case LL_HUD_EFFECT_RESET_SKELETON: +        hud_objectp = new LLHUDEffectResetSkeleton(type); +        break;      default:          LL_WARNS() << "Unknown type of hud effect:" << (U32) type << LL_ENDL;      } diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h index 13953d2329..6dedc96776 100644 --- a/indra/newview/llhudobject.h +++ b/indra/newview/llhudobject.h @@ -96,7 +96,8 @@ public:          LL_HUD_EFFECT_POINTAT,          LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella          LL_HUD_NAME_TAG, -        LL_HUD_EFFECT_BLOB +        LL_HUD_EFFECT_BLOB, +        LL_HUD_EFFECT_RESET_SKELETON      };  protected:      static void sortObjects(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 187dbdd3a2..80ff3c7739 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1578,6 +1578,8 @@ bool LLIMModel::logToFile(const std::string& file_name, const std::string& from,      }      else      { +        // will check KeepConversationLogTranscripts on its own +        LLConversationLog::instance().cache();          return false;      }  } diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp index add9a22f15..f4197e475a 100644 --- a/indra/newview/llinspecttexture.cpp +++ b/indra/newview/llinspecttexture.cpp @@ -115,7 +115,6 @@ public:  protected:      LLPointer<LLViewerFetchedTexture> m_Image; -    S32         mImageBoostLevel = LLGLTexture::BOOST_NONE;      std::string mLoadingText;  }; @@ -128,11 +127,7 @@ LLTexturePreviewView::LLTexturePreviewView(const LLView::Params& p)  LLTexturePreviewView::~LLTexturePreviewView()  { -    if (m_Image) -    { -        m_Image->setBoostLevel(mImageBoostLevel); -        m_Image = nullptr; -    } +    m_Image = nullptr;  }  void LLTexturePreviewView::draw() @@ -153,19 +148,19 @@ void LLTexturePreviewView::draw()          bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0);          if (isLoading)              LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, llfloor(rctClient.mLeft + 3),  llfloor(rctClient.mTop - 25), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); -        m_Image->addTextureStats((isLoading) ? MAX_IMAGE_AREA : (F32)(rctClient.getWidth() * rctClient.getHeight())); + +        m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);      }  }  void LLTexturePreviewView::setImageFromAssetId(const LLUUID& idAsset)  { -    m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); +    m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_THUMBNAIL);      if (m_Image)      { -        mImageBoostLevel = m_Image->getBoostLevel(); -        m_Image->setBoostLevel(LLGLTexture::BOOST_PREVIEW);          m_Image->forceToSaveRawImage(0); -        if ( (!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()) ) +        m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE); +        if ((!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()))          {              if (m_Image->isInFastCacheList())              { @@ -179,7 +174,7 @@ void LLTexturePreviewView::setImageFromAssetId(const LLUUID& idAsset)  void LLTexturePreviewView::setImageFromItemId(const LLUUID& idItem)  {      const LLViewerInventoryItem* pItem = gInventory.getItem(idItem); -    setImageFromAssetId( (pItem) ? pItem->getAssetUUID() : LLUUID::null ); +    setImageFromAssetId( (pItem) ? pItem->getAssetUUID() : LLUUID::null);  }  // ============================================================================ diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8a92d0871f..ace0a791f3 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4313,6 +4313,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t&   items          }          disabled_items.push_back(std::string("New Folder")); +        disabled_items.push_back(std::string("upload_options"));          disabled_items.push_back(std::string("upload_def"));          disabled_items.push_back(std::string("create_new"));      } @@ -4336,6 +4337,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t&   items      if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)      {          disabled_items.push_back(std::string("New Folder")); +        disabled_items.push_back(std::string("upload_options"));          disabled_items.push_back(std::string("upload_def"));          disabled_items.push_back(std::string("create_new"));      } @@ -4401,6 +4403,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t&   items                  }                  if (!isMarketplaceListingsFolder())                  { +                    items.push_back(std::string("upload_options"));                      items.push_back(std::string("upload_def"));                      items.push_back(std::string("create_new"));                      items.push_back(std::string("New Script")); @@ -6936,7 +6939,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action)          else if(item && item->isFinished())          {              // must be in library. copy it to our inventory and put it on. -            LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); +            LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, true));              copy_inventory_item(                  gAgent.getID(),                  item->getPermissions().getOwner(), diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 7dbbb341f6..9a81d99b0d 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -821,7 +821,7 @@ private:  void rez_attachment(LLViewerInventoryItem* item,                      LLViewerJointAttachment* attachment, -                    bool replace = false); +                    bool replace);  // Move items from an in-world object's "Contents" folder to a specified  // folder in agent inventory. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 28d79b7665..ca27ea8b3f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -51,6 +51,7 @@  #include "lldirpicker.h"  #include "lldonotdisturbnotificationstorage.h"  #include "llfloatermarketplacelistings.h" +#include "llfloatermodelpreview.h"  #include "llfloatersidepanelcontainer.h"  #include "llfocusmgr.h"  #include "llfolderview.h" @@ -62,6 +63,7 @@  #include "llinventorymodel.h"  #include "llinventorypanel.h"  #include "lllineeditor.h" +#include "llmaterialeditor.h"  #include "llmarketplacenotifications.h"  #include "llmarketplacefunctions.h"  #include "llmenugl.h" @@ -86,6 +88,7 @@  #include "llviewermessage.h"  #include "llviewerfoldertype.h"  #include "llviewerobjectlist.h" +#include "llviewermenufile.h"  #include "llviewerregion.h"  #include "llviewerwindow.h"  #include "llvoavatarself.h" @@ -3316,7 +3319,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root                  for (LLInventoryModel::item_array_t::value_type& item : items)                  { -                    if (get_is_item_worn(item)) +                    if (!item->getIsLinkType() && get_is_item_worn(item))                      {                          has_worn = true;                          LLWearableType::EType type = item->getWearableType(); @@ -3336,7 +3339,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root                  }              }              LLViewerInventoryItem* item = gInventory.getItem(obj_id); -            if (item && get_is_item_worn(item)) +            if (item && !item->getIsLinkType() && get_is_item_worn(item))              {                  has_worn = true;                  LLWearableType::EType type = item->getWearableType(); @@ -3693,6 +3696,54 @@ void LLInventoryAction::removeItemFromDND(LLFolderView* root)      }  } +void LLInventoryAction::fileUploadLocation(const LLUUID& dest_id, const std::string& action) +{ +    if (action == "def_model") +    { +        gSavedPerAccountSettings.setString("ModelUploadFolder", dest_id.asString()); +    } +    else if (action == "def_texture") +    { +        gSavedPerAccountSettings.setString("TextureUploadFolder", dest_id.asString()); +    } +    else if (action == "def_sound") +    { +        gSavedPerAccountSettings.setString("SoundUploadFolder", dest_id.asString()); +    } +    else if (action == "def_animation") +    { +        gSavedPerAccountSettings.setString("AnimationUploadFolder", dest_id.asString()); +    } +    else if (action == "def_pbr_material") +    { +        gSavedPerAccountSettings.setString("PBRUploadFolder", dest_id.asString()); +    } +    else if (action == "upload_texture") +    { +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_IMAGE, false); +    } +    else if (action == "upload_sound") +    { +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_WAV, false); +    } +    else if (action == "upload_animation") +    { +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_ANIM, false); +    } +    else if (action == "upload_model") +    { +        LLFloaterModelPreview::showModelPreview(dest_id); +    } +    else if (action == "upload_pbr_material") +    { +        LLMaterialEditor::importMaterial(dest_id); +    } +    else if (action == "upload_bulk") +    { +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, dest_id), LLFilePicker::FFLOAD_ALL, true); +    } +} +  void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root)  {      S32 option = LLNotificationsUtil::getSelectedOption(notification, response); diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 0eabf696ae..fdb6fc77d7 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -599,6 +599,7 @@ struct LLInventoryAction      static void callback_copySelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action);      static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root);      static void removeItemFromDND(LLFolderView* root); +    static void fileUploadLocation(const LLUUID& dest_id, const std::string& action);      static void saveMultipleTextures(const std::vector<std::string>& filenames, std::set<LLFolderViewItem*> selected_items, LLInventoryModel* model); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 8d4b191b2b..a6bedc8854 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2001,7 +2001,7 @@ void LLInventoryGallery::deleteSelection()              for (LLInventoryModel::item_array_t::value_type& item : items)              { -                if (get_is_item_worn(item)) +                if (!item->getIsLinkType() && get_is_item_worn(item))                  {                      has_worn = true;                      LLWearableType::EType type = item->getWearableType(); @@ -2022,7 +2022,7 @@ void LLInventoryGallery::deleteSelection()          }          LLViewerInventoryItem* item = gInventory.getItem(id); -        if (item && get_is_item_worn(item)) +        if (item && !item->getIsLinkType() && get_is_item_worn(item))          {              has_worn = true;              LLWearableType::EType type = item->getWearableType();             diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 5f97404627..13436819a5 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -358,22 +358,7 @@ void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLS  void LLInventoryGalleryContextMenu::fileUploadLocation(const LLSD& userdata)  {      const std::string param = userdata.asString(); -    if (param == "model") -    { -        gSavedPerAccountSettings.setString("ModelUploadFolder", mUUIDs.front().asString()); -    } -    else if (param == "texture") -    { -        gSavedPerAccountSettings.setString("TextureUploadFolder", mUUIDs.front().asString()); -    } -    else if (param == "sound") -    { -        gSavedPerAccountSettings.setString("SoundUploadFolder", mUUIDs.front().asString()); -    } -    else if (param == "animation") -    { -        gSavedPerAccountSettings.setString("AnimationUploadFolder", mUUIDs.front().asString()); -    } +    LLInventoryAction::fileUploadLocation(mUUIDs.front(), param);  }  bool LLInventoryGalleryContextMenu::canSetUploadLocation(const LLSD& userdata) @@ -539,6 +524,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men                  {                      items.push_back(std::string("New Folder"));                  } +                items.push_back(std::string("upload_options"));                  items.push_back(std::string("upload_def"));              } @@ -751,6 +737,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men              }              disabled_items.push_back(std::string("New Folder")); +            disabled_items.push_back(std::string("upload_options"));              disabled_items.push_back(std::string("upload_def"));          } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 33d9f08e14..bc5f52dc4f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1791,26 +1791,8 @@ bool LLInventoryPanel::beginIMSession()  void LLInventoryPanel::fileUploadLocation(const LLSD& userdata)  {      const std::string param = userdata.asString(); -    if (param == "model") -    { -        gSavedPerAccountSettings.setString("ModelUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); -    } -    else if (param == "texture") -    { -        gSavedPerAccountSettings.setString("TextureUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); -    } -    else if (param == "sound") -    { -        gSavedPerAccountSettings.setString("SoundUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); -    } -    else if (param == "animation") -    { -        gSavedPerAccountSettings.setString("AnimationUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); -    } -    else if (param == "pbr_material") -    { -        gSavedPerAccountSettings.setString("PBRUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); -    } +    const LLUUID dest = LLFolderBridge::sSelf.get()->getUUID(); +    LLInventoryAction::fileUploadLocation(dest, param);  }  void LLInventoryPanel::openSingleViewInventory(LLUUID folder_id) diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 5b7243ece2..4cf4db7881 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -671,15 +671,16 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id)                  if (override_mat)                  {                      // do not create a new material, reuse existing pointer -                    LLFetchedGLTFMaterial* render_mat = (LLFetchedGLTFMaterial*)entry->getGLTFRenderMaterial(); +                    LLFetchedGLTFMaterial* render_mat = dynamic_cast<LLFetchedGLTFMaterial*>(entry->getGLTFRenderMaterial());                      if (render_mat)                      { -                        llassert(dynamic_cast<LLFetchedGLTFMaterial*>(entry->getGLTFRenderMaterial()) != nullptr); -                        { -                            *render_mat = *fetched_mat; -                        } +                        *render_mat = *fetched_mat;                          render_mat->applyOverride(*override_mat);                      } +                    else +                    { +                        LL_WARNS_ONCE() << "Failed to apply local material override, render material not found" << LL_ENDL;                     +                    }                  }              }          } diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 36a0834845..c63a7956ab 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1414,7 +1414,7 @@ bool LLMaterialEditor::saveIfNeeded()          }          std::string res_desc = buildMaterialDescription(); -        createInventoryItem(buffer, mMaterialName, res_desc, local_permissions); +        createInventoryItem(buffer, mMaterialName, res_desc, local_permissions, mUploadFolder);          // We do not update floater with uploaded asset yet, so just close it.          closeFloater(); @@ -1584,12 +1584,12 @@ private:      std::string mNewName;  }; -void LLMaterialEditor::createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions) +void LLMaterialEditor::createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions, const LLUUID& upload_folder)  {      // gen a new uuid for this asset      LLTransactionID tid;      tid.generate();     // timestamp-based randomization + uniquification -    LLUUID parent = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL); +    LLUUID parent = upload_folder.isNull() ? gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL) : upload_folder;      const U8 subtype = NO_INV_SUBTYPE;  // TODO maybe use AT_SETTINGS and LLSettingsType::ST_MATERIAL ?      LLPointer<LLObjectsMaterialItemCallback> cb = new LLObjectsMaterialItemCallback(permissions, buffer, name); @@ -1903,7 +1903,11 @@ static void pack_textures(      }  } -void LLMaterialEditor::uploadMaterialFromModel(const std::string& filename, tinygltf::Model& model_in, S32 index) +void LLMaterialEditor::uploadMaterialFromModel( +    const std::string& filename, +    tinygltf::Model& model_in, +    S32 index, +    const LLUUID& dest)  {      if (index < 0 || !LLMaterialEditor::capabilitiesAvailable())      { @@ -1926,12 +1930,13 @@ void LLMaterialEditor::uploadMaterialFromModel(const std::string& filename, tiny      // This uses 'filename' to make sure multiple bulk uploads work      // instead of fighting for a single instance.      LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor", LLSD().with("filename", filename).with("index", LLSD::Integer(index))); +    me->mUploadFolder = dest;      me->loadMaterial(model_in, filename, index, false);      me->saveIfNeeded();  } -void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 index) +void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 index, const LLUUID& dest_folder)  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; @@ -1977,6 +1982,7 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind      }      LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor"); +    me->mUploadFolder = dest_folder;      if (index >= 0)      { @@ -2427,17 +2433,15 @@ void LLMaterialEditor::onSaveObjectsMaterialAsMsgCallback(const LLSD& notificati          return;      } -    createInventoryItem(str.str(), new_name, std::string(), permissions); +    createInventoryItem(str.str(), new_name, std::string(), permissions, LLUUID::null);  } -const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type); -  void LLMaterialEditor::loadMaterial(const tinygltf::Model &model_in, const std::string &filename, S32 index, bool open_floater)  {      if (index == model_in.materials.size())      {          // bulk upload all the things -        upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL); +        upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, mUploadFolder);          return;      } @@ -2844,10 +2848,10 @@ void LLMaterialEditor::setFromGltfMetaData(const std::string& filename, const ti      }  } -void LLMaterialEditor::importMaterial() +void LLMaterialEditor::importMaterial(const LLUUID dest_folder)  {      LLFilePickerReplyThread::startPicker( -        [](const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter load_filter, LLFilePicker::ESaveFilter save_filter) +        [dest_folder](const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter load_filter, LLFilePicker::ESaveFilter save_filter)              {                  if (LLAppViewer::instance()->quitRequested())                  { @@ -2855,7 +2859,7 @@ void LLMaterialEditor::importMaterial()                  }                  if (filenames.size() > 0)                  { -                    LLMaterialEditor::loadMaterialFromFile(filenames[0], -1); +                    LLMaterialEditor::loadMaterialFromFile(filenames[0], -1, dest_folder);                  }              },          LLFilePicker::FFLOAD_MATERIAL, @@ -3536,6 +3540,7 @@ void LLMaterialEditor::saveTexture(LLImageJ2C* img, const std::string& name, con          LLFloaterPerms::getGroupPerms("Uploads"),          LLFloaterPerms::getEveryonePerms("Uploads"),          expected_upload_cost, +        mUploadFolder,          false,          cb,          failed_upload)); diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h index 11809d26be..57998ff399 100644 --- a/indra/newview/llmaterialeditor.h +++ b/indra/newview/llmaterialeditor.h @@ -94,7 +94,7 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener      void setFromGltfMetaData(const std::string& filename, const  tinygltf::Model& model, S32 index);      // open a file dialog and select a gltf/glb file for import -    static void importMaterial(); +    static void importMaterial(const LLUUID dest_folder = LLUUID::null);      // for live preview, apply current material to currently selected object      void applyToSelection(); @@ -105,8 +105,11 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener      void loadAsset() override;      // @index if -1 and file contains more than one material,      // will promt to select specific one -    static void uploadMaterialFromModel(const std::string& filename, tinygltf::Model& model, S32 index); -    static void loadMaterialFromFile(const std::string& filename, S32 index = -1); +    static void uploadMaterialFromModel(const std::string& filename, +                                        tinygltf::Model& model, +                                        S32 index, +                                        const LLUUID& dest_folder_id = LLUUID::null); +    static void loadMaterialFromFile(const std::string& filename, S32 index = -1, const LLUUID& dest_folder = LLUUID::null);      void onSelectionChanged(); // live overrides selection changes @@ -134,8 +137,6 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener      void onClickSave(); -    void getGLTFModel(tinygltf::Model& model); -      std::string getEncodedAsset();      bool decodeAsset(const std::vector<char>& buffer); @@ -239,7 +240,7 @@ private:      static void saveObjectsMaterialAs(const LLGLTFMaterial *render_material, const LLLocalGLTFMaterial *local_material, const LLPermissions& permissions, const LLUUID& object_id /* = LLUUID::null */, const LLUUID& item /* = LLUUID::null */);      static bool updateInventoryItem(const std::string &buffer, const LLUUID &item_id, const LLUUID &task_id); -    static void createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions); +    static void createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions, const LLUUID& upload_folder);      void setFromGLTFMaterial(LLGLTFMaterial* mat);      bool setFromSelection(); @@ -249,6 +250,7 @@ private:      friend class LLMaterialFilePicker;      LLUUID mAssetID; +    LLUUID mUploadFolder;      LLTextureCtrl* mBaseColorTextureCtrl;      LLTextureCtrl* mMetallicTextureCtrl; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index f6441f8404..d6e6cd4578 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -740,8 +740,12 @@ public:  }; -void log_upload_error(LLCore::HttpStatus status, const LLSD& content, -                      const char * const stage, const std::string & model_name) +void log_upload_error( +    LLCore::HttpStatus status, +    const LLSD& content, +    const char * const stage, +    const std::string & model_name, +    const std::vector<std::string> & texture_filenames)  {      // Add notification popup.      LLSD args; @@ -799,6 +803,20 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content,                  error_num++;              }          } + +        if (err.has("TextureIndex")) +        { +            S32 texture_index = err["TextureIndex"].asInteger(); +            if (texture_index < texture_filenames.size()) +            { +                args["MESSAGE"] = message + "\n" + texture_filenames[texture_index]; +            } +            else +            { +                llassert(false); // figure out why or how texture wasn't in the list +                args["MESSAGE"] = message + llformat("\nTexture index: %d", texture_index); +            } +        }      }      else      { @@ -2094,7 +2112,7 @@ EMeshProcessingResult LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_  LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,                                         bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, -                                       const std::string & upload_url, bool do_upload, +                                       const std::string & upload_url, LLUUID destination_folder_id, bool do_upload,                                         LLHandle<LLWholeModelFeeObserver> fee_observer,                                         LLHandle<LLWholeModelUploadObserver> upload_observer)    : LLThread("mesh upload"), @@ -2102,6 +2120,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,      mDiscarded(false),      mDoUpload(do_upload),      mWholeModelUploadURL(upload_url), +    mDestinationFolderId(destination_folder_id),      mFeeObserverHandle(fee_observer),      mUploadObserverHandle(upload_observer)  { @@ -2219,13 +2238,21 @@ LLSD llsd_from_file(std::string filename)      return result;  } -void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) +void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector<std::string>& texture_list_dest, bool include_textures)  {      LLSD result;      LLSD res; -    result["folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT); -    result["texture_folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); +    if (mDestinationFolderId.isNull()) +    { +        result["folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT); +        result["texture_folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); +    } +    else +    { +        result["folder_id"] = mDestinationFolderId; +        result["texture_folder_id"] = mDestinationFolderId; +    }      result["asset_type"] = "mesh";      result["inventory_type"] = "object";      result["description"] = "(No Description)"; @@ -2365,12 +2392,12 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)                          LLPointer<LLImageJ2C> upload_file =                              LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); -                        if (!upload_file.isNull() && upload_file->getDataSize()) +                        if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid())                          { -                        texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); +                            texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); +                        }                      }                  } -                }                  if (texture != NULL &&                      mUploadTextures && @@ -2378,7 +2405,9 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)                  {                      texture_index[texture] = texture_num;                      std::string str = texture_str.str(); -                    res["texture_list"][texture_num] = LLSD::Binary(str.begin(),str.end()); +                    res["texture_list"][texture_num] = LLSD::Binary(str.begin(), str.end()); +                    // store indexes for error handling; +                    texture_list_dest.push_back(material.mDiffuseMapFilename);                      texture_num++;                  } @@ -2641,7 +2670,8 @@ void LLMeshUploadThread::doWholeModelUpload()          LL_DEBUGS(LOG_MESH) << "Hull generation completed." << LL_ENDL;          mModelData = LLSD::emptyMap(); -        wholeModelToLLSD(mModelData, true); +        mTextureFiles.clear(); +        wholeModelToLLSD(mModelData, mTextureFiles, true);          LLSD body = mModelData["asset_resources"];          dump_llsd_to_file(body, make_dump_name("whole_model_body_", dump_num)); @@ -2694,7 +2724,8 @@ void LLMeshUploadThread::requestWholeModelFee()      generateHulls();      mModelData = LLSD::emptyMap(); -    wholeModelToLLSD(mModelData, false); +    mTextureFiles.clear(); +    wholeModelToLLSD(mModelData, mTextureFiles, false);      dump_llsd_to_file(mModelData, make_dump_name("whole_model_fee_request_", dump_num));      LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,                                                                      mHttpPolicyClass, @@ -2760,7 +2791,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp              body["error"] = LLSD::emptyMap();              body["error"]["message"] = reason;              body["error"]["identifier"] = "NetworkError";       // from asset-upload/upload_util.py -            log_upload_error(status, body, "upload", mModelData["name"].asString()); +            log_upload_error(status, body, "upload", mModelData["name"].asString(), mTextureFiles);              if (observer)              { @@ -2795,7 +2826,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp              else              {                  LL_WARNS(LOG_MESH) << "Upload failed.  Not in expected 'complete' state." << LL_ENDL; -                log_upload_error(status, body, "upload", mModelData["name"].asString()); +                log_upload_error(status, body, "upload", mModelData["name"].asString(), mTextureFiles);                  if (observer)                  { @@ -2820,7 +2851,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp              body["error"] = LLSD::emptyMap();              body["error"]["message"] = reason;              body["error"]["identifier"] = "NetworkError";       // from asset-upload/upload_util.py -            log_upload_error(status, body, "fee", mModelData["name"].asString()); +            log_upload_error(status, body, "fee", mModelData["name"].asString(), mTextureFiles);              if (observer)              { @@ -2853,7 +2884,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp              else              {                  LL_WARNS(LOG_MESH) << "Fee request failed.  Not in expected 'upload' state." << LL_ENDL; -                log_upload_error(status, body, "fee", mModelData["name"].asString()); +                log_upload_error(status, body, "fee", mModelData["name"].asString(), mTextureFiles);                  if (observer)                  { @@ -4338,12 +4369,12 @@ bool LLMeshRepoThread::hasHeader(const LLUUID& mesh_id)  void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,                                     bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, -                                   std::string upload_url, bool do_upload, +                                   std::string upload_url, const LLUUID& destination_folder_id, bool do_upload,                                     LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)  {      LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures,                                                          upload_skin, upload_joints, lock_scale_if_joint_position, -                                                        upload_url, do_upload, fee_observer, upload_observer); +                                                        upload_url, destination_folder_id, do_upload, fee_observer, upload_observer);      mUploadWaitList.push_back(thread);  } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index b31d726004..f605cfc0b9 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -501,10 +501,13 @@ public:      LLHost          mHost;      std::string     mWholeModelFeeCapability;      std::string     mWholeModelUploadURL; +    LLUUID          mDestinationFolderId;      LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures,                         bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, -                       const std::string & upload_url, bool do_upload = true, +                       const std::string & upload_url, +                       const LLUUID destination_folder_id = LLUUID::null, +                       bool do_upload = true,                         LLHandle<LLWholeModelFeeObserver> fee_observer = (LLHandle<LLWholeModelFeeObserver>()),                         LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));      ~LLMeshUploadThread(); @@ -520,7 +523,7 @@ public:      void doWholeModelUpload();      void requestWholeModelFee(); -    void wholeModelToLLSD(LLSD& dest, bool include_textures); +    void wholeModelToLLSD(LLSD& dest, std::vector<std::string>& texture_list_dest, bool include_textures);      void decomposeMeshMatrix(LLMatrix4& transformation,                               LLVector3& result_pos, @@ -541,6 +544,7 @@ private:      bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded      LLSD mModelData; +    std::vector<std::string> mTextureFiles;      // llcorehttp library interface objects.      LLCore::HttpStatus                  mHttpStatus; @@ -663,7 +667,9 @@ public:      void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,                       bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, -                     std::string upload_url, bool do_upload = true, +                     std::string upload_url, +                     const LLUUID& destination_folder_id = LLUUID::null, +                     bool do_upload = true,                       LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()),                       LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>())); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 736971276e..ac41558721 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -2285,7 +2285,7 @@ void LLModelPreview::updateStatusMessages()          if (lod != lod_high)          { -            if (total_submeshes[lod] && total_submeshes[lod] != total_submeshes[lod_high]) +            if (total_submeshes[lod] && total_submeshes[lod] > total_submeshes[lod_high])              { //number of submeshes is different                  message = "mesh_status_submesh_mismatch";                  upload_status[lod] = 2; diff --git a/indra/newview/llpanelgroupcreate.cpp b/indra/newview/llpanelgroupcreate.cpp index 1b8947caee..913db0e198 100644 --- a/indra/newview/llpanelgroupcreate.cpp +++ b/indra/newview/llpanelgroupcreate.cpp @@ -1,24 +1,24 @@ -/** +/**    * @file llpanelgroupcreate.cpp   *   * $LicenseInfo:firstyear=2019&license=viewerlgpl$   * Second Life Viewer Source Code   * Copyright (C) 2019, 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$   */ @@ -85,6 +85,7 @@ BOOL LLPanelGroupCreate::postBuild()      mInsignia = getChild<LLTextureCtrl>("insignia", TRUE);      mInsignia->setAllowLocalTexture(FALSE); +    mInsignia->setBakeTextureEnabled(FALSE);      mInsignia->setCanApplyImmediately(FALSE);      return TRUE; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 9c6f16ee9e..73fb6012e4 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -197,6 +197,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group)      {          mInsignia->setCommitCallback(onCommitAny, this);          mInsignia->setAllowLocalTexture(FALSE); +        mInsignia->setBakeTextureEnabled(FALSE);      }      mFounderName = getChild<LLTextBox>("founder_name"); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 12c253a04a..7228f5a98b 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -308,20 +308,27 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const  BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name)  {      LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); -    if(object) +    if(!object)      { -        LLViewerInventoryItem* item = NULL; -        item = (LLViewerInventoryItem*)object->getInventoryObject(mUUID); -        if(item && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), -                                        GP_OBJECT_MANIPULATE, GOD_LIKE))) -        { -            LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); -            new_item->rename(new_name); -            object->updateInventory( -                new_item, -                TASK_INVENTORY_ITEM_KEY, -                false); -        } +        return false; +    } +    if (!object->permModify()) +    { +        LLNotificationsUtil::add("CantModifyContentInNoModTask"); +        return false; +    } + +    LLViewerInventoryItem* item = NULL; +    item = (LLViewerInventoryItem*)object->getInventoryObject(mUUID); +    if (item && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), +        GP_OBJECT_MANIPULATE, GOD_LIKE))) +    { +        LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); +        new_item->rename(new_name); +        object->updateInventory( +            new_item, +            TASK_INVENTORY_ITEM_KEY, +            false);      }      return TRUE;  } @@ -388,10 +395,7 @@ BOOL LLTaskInvFVBridge::removeItem()              }              else              { -                LLSD payload; -                payload["task_id"] = mPanel->getTaskUUID(); -                payload["inventory_ids"].append(mUUID); -                LLNotificationsUtil::add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); +                LLNotificationsUtil::add("CantModifyContentInNoModTask");                  return FALSE;              }          } @@ -414,15 +418,7 @@ void   LLTaskInvFVBridge::removeBatch(std::vector<LLFolderViewModelItem*>& batch      if (!object->permModify())      { -        LLSD payload; -        payload["task_id"] = mPanel->getTaskUUID(); -        for (S32 i = 0; i < (S32)batch.size(); i++) -        { -            LLTaskInvFVBridge* itemp = (LLTaskInvFVBridge*)batch[i]; -            payload["inventory_ids"].append(itemp->getUUID()); -        } -        LLNotificationsUtil::add("RemoveItemWarn", LLSD(), payload, boost::bind(&remove_task_inventory_callback, _1, _2, mPanel)); - +        LLNotificationsUtil::add("CantModifyContentInNoModTask");      }      else      { @@ -1379,7 +1375,23 @@ BOOL LLPanelObjectInventory::postBuild()  void LLPanelObjectInventory::doToSelected(const LLSD& userdata)  { -    LLInventoryAction::doToSelected(&gInventory, mFolders, userdata.asString()); +    std::string action = userdata.asString(); +    if ("rename" == action || "delete" == action) +    { +        LLViewerObject* objectp = gObjectList.findObject(mTaskUUID); +        if (objectp && !objectp->permModify()) +        { +            LLNotificationsUtil::add("CantModifyContentInNoModTask"); +        } +        else +        { +            LLInventoryAction::doToSelected(&gInventory, mFolders, action); +        } +    } +    else +    { +        LLInventoryAction::doToSelected(&gInventory, mFolders, action); +    }  }  void LLPanelObjectInventory::clearContents() diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 172c7d0828..a8734ac1e4 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -347,7 +347,10 @@ void PeopleContextMenu::eject()              avatar = (LLVOAvatar*) object;          }      } -    if (!avatar) return; + +    if (!avatar) +        return; +      LLSD payload;      payload["avatar_id"] = avatar->getID();      std::string fullname = avatar->getFullname(); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 90cfcc6d8a..ec25a9086e 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -176,7 +176,7 @@ BOOL LLPanelPermissions::postBuild()      childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this); -    childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSaleInfo, this); +    childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSalePrice, this);      childSetCommitCallback("checkbox next owner can modify",LLPanelPermissions::onCommitNextOwnerModify,this);      childSetCommitCallback("checkbox next owner can copy",LLPanelPermissions::onCommitNextOwnerCopy,this); @@ -781,7 +781,9 @@ void LLPanelPermissions::refresh()      if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER))      { -        getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); +        bool change_sale_allowed = can_transfer || (!can_transfer && num_for_sale); +        getChildView("checkbox for sale")->setEnabled(change_sale_allowed); +        getChildView("Edit Cost")->setEnabled(change_sale_allowed && !is_for_sale_mixed);          // Set the checkbox to tentative if the prices of each object selected          // are not the same.          getChild<LLUICtrl>("checkbox for sale")->setTentative(              is_for_sale_mixed); @@ -1223,6 +1225,16 @@ void LLPanelPermissions::onCommitSaleType(LLUICtrl*, void* data)      self->setAllSaleInfo();  } +void LLPanelPermissions::onCommitSalePrice(LLUICtrl *, void *data) +{ +    LLPanelPermissions *self = (LLPanelPermissions *) data; +    LLCheckBoxCtrl *checkPurchase = self->getChild<LLCheckBoxCtrl>("checkbox for sale"); +    if (checkPurchase && checkPurchase->get()) +    { +        self->setAllSaleInfo(); +    } +} +  void LLPanelPermissions::setAllSaleInfo()  {      LL_INFOS() << "LLPanelPermissions::setAllSaleInfo()" << LL_ENDL; diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 790ac9920d..5bc2db9826 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -77,6 +77,7 @@ protected:      static void onCommitSaleInfo(LLUICtrl* ctrl, void* data);      static void onCommitSaleType(LLUICtrl* ctrl, void* data); +    static void onCommitSalePrice(LLUICtrl *ctrl, void *data);      void setAllSaleInfo();      static void onCommitClickAction(LLUICtrl* ctrl, void*); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 0f0af37485..4c78f7e3f5 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -974,7 +974,7 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data)      setDescriptionText(avatar_data->about_text); -    mSecondLifePic->setValue(avatar_data->image_id); +        mSecondLifePic->setValue(avatar_data->image_id);      if (getSelfProfile())      { @@ -1122,10 +1122,10 @@ void LLPanelProfileSecondLife::fillAgeData(const LLAvatarData* avatar_data)      }      else      { -        std::string register_date = getString("age_format"); -        LLSD args_age; +    std::string register_date = getString("age_format"); +    LLSD args_age;          args_age["[AGE]"] = LLDateUtil::ageFromDate(avatar_data->born_on, LLDate::now()); -        LLStringUtil::format(register_date, args_age); +    LLStringUtil::format(register_date, args_age);          userAgeCtrl->setValue(register_date);      } @@ -1568,12 +1568,12 @@ void LLPanelProfileSecondLife::onShowInSearchCallback()      if (value == mAllowPublish)          return; -    mAllowPublish = value; +        mAllowPublish = value;      saveAgentUserInfoCoro("allow_publish", value); -} +    }  void LLPanelProfileSecondLife::onHideAgeCallback() -{ +    {      bool value = mHideAgeCombo->getValue().asInteger();      if (value == mHideAge)          return; @@ -1722,35 +1722,35 @@ void LLPanelProfileSecondLife::onCommitProfileImage(const LLUUID& id)      if (mSecondLifePic->getImageAssetId() == id)          return; -    std::function<void(bool)> callback = [id](bool result) -    { -        if (result) +        std::function<void(bool)> callback = [id](bool result)          { -            LLAvatarIconIDCache::getInstance()->add(gAgentID, id); +            if (result) +            { +                LLAvatarIconIDCache::getInstance()->add(gAgentID, id);              // Should trigger callbacks in icon controls (or request Legacy) -            LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgentID); -        } -    }; +                LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgentID); +            } +        };      if (!saveAgentUserInfoCoro("sl_image_id", id, callback))          return;      mSecondLifePic->setValue(id); -    LLFloater *floater = mFloaterProfileTextureHandle.get(); -    if (floater) -    { -        LLFloaterProfileTexture * texture_view = dynamic_cast<LLFloaterProfileTexture*>(floater); -        if (id == LLUUID::null) -        { -            texture_view->resetAsset(); -        } -        else +        LLFloater *floater = mFloaterProfileTextureHandle.get(); +        if (floater)          { +            LLFloaterProfileTexture * texture_view = dynamic_cast<LLFloaterProfileTexture*>(floater); +        if (id == LLUUID::null) +            { +                texture_view->resetAsset(); +            } +            else +            {              texture_view->loadAsset(id); +            }          }      } -}  //////////////////////////////////////////////////////////////////////////  // LLPanelProfileWeb @@ -2018,7 +2018,8 @@ void LLPanelProfileFirstLife::onChangePhoto()                      onCommitPhoto(asset_id);                  }              }); -            texture_floaterp->setLocalTextureEnabled(FALSE); +            texture_floaterp->setLocalTextureEnabled(false); +            texture_floaterp->setBakeTextureEnabled(false);              texture_floaterp->setCanApply(false, true, false);              parent_floater->addDependentFloater(mFloaterTexturePickerHandle); diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp index 2604c2ba53..b563967cd6 100644 --- a/indra/newview/llreflectionmap.cpp +++ b/indra/newview/llreflectionmap.cpp @@ -251,32 +251,27 @@ bool LLReflectionMap::getBox(LLMatrix4& box)      if (mViewerObject)      {          LLVolume* volume = mViewerObject->getVolume(); -        if (volume) +        if (volume && mViewerObject->getReflectionProbeIsBox())          { -            LLVOVolume* vobjp = (LLVOVolume*)mViewerObject; - -            if (vobjp->getReflectionProbeIsBox()) +            glh::matrix4f mv(gGLModelView); +            glh::matrix4f scale; +            LLVector3 s = mViewerObject->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f)); +            mRadius = s.magVec(); +            scale.set_scale(glh::vec3f(s.mV)); +            if (mViewerObject->mDrawable != nullptr)              { -                glh::matrix4f mv(gGLModelView); -                glh::matrix4f scale; -                LLVector3 s = vobjp->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f)); -                mRadius = s.magVec(); -                scale.set_scale(glh::vec3f(s.mV)); -                if (vobjp->mDrawable != nullptr) -                { -                    // object to agent space (no scale) -                    glh::matrix4f rm((F32*)vobjp->mDrawable->getWorldMatrix().mMatrix); +                // object to agent space (no scale) +                glh::matrix4f rm((F32*)mViewerObject->mDrawable->getWorldMatrix().mMatrix); -                    // construct object to camera space (with scale) -                    mv = mv * rm * scale; +                // construct object to camera space (with scale) +                mv = mv * rm * scale; -                    // inverse is camera space to object unit cube  -                    mv = mv.inverse(); +                // inverse is camera space to object unit cube  +                mv = mv.inverse(); -                    box = LLMatrix4(mv.m); +                box = LLMatrix4(mv.m); -                    return true; -                } +                return true;              }          }      } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f602dee0cb..690b9562a8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -250,6 +250,23 @@ LLSelectMgr::LLSelectMgr()      mForceSelection = FALSE;      mShowSelection = FALSE; + +    LLControlVariable* ctrl = gSavedSettings.getControl("DebugSelectionLODs").get(); +    if (ctrl) +    { +        mSlectionLodModChangedConnection = ctrl->getSignal()->connect([this](LLControlVariable*, const LLSD&, const LLSD&) +        { +            for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); +                iter != mSelectedObjects->end(); ++iter) +            { +                LLViewerObject* object = (*iter)->getObject(); +                if (object) +                { +                    object->updateLOD(); +                } +            } +        }); +    }  } @@ -259,6 +276,7 @@ LLSelectMgr::LLSelectMgr()  LLSelectMgr::~LLSelectMgr()  {      clearSelections(); +    mSlectionLodModChangedConnection.disconnect();  }  void LLSelectMgr::clearSelections() diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 02c74d0ab0..198d634d76 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -937,6 +937,7 @@ private:      BOOL                    mForceSelection;      std::vector<LLAnimPauseRequest> mPauseRequests; +    boost::signals2::connection mSlectionLodModChangedConnection;  };  // *DEPRECATED: For callbacks or observers, use diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 4506088fd3..c278f9ae65 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -56,6 +56,8 @@  #include "llviewerregion.h" +const char* const DEFAULT_DESC = "(No Description)"; +  class PropertiesChangedCallback : public LLInventoryCallback  {  public: @@ -128,6 +130,7 @@ LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p)      , mUpdatePendingId(-1)      , mIsDirty(false) /*Not ready*/      , mParentFloater(NULL) +    , mLabelItemDesc(NULL)  {      gInventory.addObserver(this);      gIdleCallbacks.addFunction(&LLSidepanelItemInfo::onIdle, (void*)this); @@ -158,10 +161,11 @@ BOOL LLSidepanelItemInfo::postBuild()      mItemTypeIcon = getChild<LLIconCtrl>("item_type_icon");      mLabelOwnerName = getChild<LLTextBox>("LabelOwnerName");      mLabelCreatorName = getChild<LLTextBox>("LabelCreatorName"); +    mLabelItemDesc = getChild<LLTextEditor>("LabelItemDesc");      getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);      getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); -    getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); +    mLabelItemDesc->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this));      // Thumnail edition      mChangeThumbnailBtn->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onEditThumbnail, this));      // acquired date @@ -342,10 +346,14 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)      getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards      getChild<LLUICtrl>("LabelItemName")->setValue(item->getName());      getChildView("LabelItemDescTitle")->setEnabled(TRUE); -    getChildView("LabelItemDesc")->setEnabled(is_modifiable); -    getChild<LLUICtrl>("LabelItemDesc")->setValue(item->getDescription());      getChild<LLUICtrl>("item_thumbnail")->setValue(item->getThumbnailUUID()); +    // Asset upload substitutes empty description with a (No Description) placeholder +    std::string desc = item->getDescription(); +    mLabelItemDesc->setSelectAllOnFocusReceived(desc == DEFAULT_DESC); +    mLabelItemDesc->setValue(desc); +    mLabelItemDesc->setEnabled(is_modifiable); +      LLUIImagePtr icon_img = LLInventoryIcon::getIcon(item->getType(), item->getInventoryType(), item->getFlags(), FALSE);      mItemTypeIcon->setImage(icon_img); @@ -927,17 +935,22 @@ void LLSidepanelItemInfo::onCommitDescription()      LLViewerInventoryItem* item = findItem();      if(!item) return; -    LLTextEditor* labelItemDesc = getChild<LLTextEditor>("LabelItemDesc"); -    if(!labelItemDesc) +    if(!mLabelItemDesc) +    { +        return; +    } +    if (!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))      {          return;      } -    if((item->getDescription() != labelItemDesc->getText()) && -       (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))) +    std::string old_desc = item->getDescription(); +    std::string new_desc = mLabelItemDesc->getText(); +    if(old_desc != new_desc)      { +        mLabelItemDesc->setSelectAllOnFocusReceived(false);          LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); -        new_item->setDescription(labelItemDesc->getText()); +        new_item->setDescription(new_desc);          onCommitChanges(new_item);      }  } diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 45709b82f3..3868b75af9 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -46,6 +46,7 @@ class LLObjectInventoryObserver;  class LLViewerObject;  class LLPermissions;  class LLTextBox; +class LLTextEditor;  class LLSidepanelItemInfo : public LLPanel, public LLInventoryObserver  { @@ -105,6 +106,7 @@ private:      LLIconCtrl* mItemTypeIcon;      LLTextBox* mLabelOwnerName;      LLTextBox* mLabelCreatorName; +    LLTextEditor* mLabelItemDesc;      //      // UI Elements diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 438b04ff39..f71e861f17 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -110,8 +110,8 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin          // needed for handling of any legacy bad data.          if (!avatar->getJoint(skin->mJointNames[j]))          { -            LL_DEBUGS("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL; -            LL_WARNS_ONCE("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL; +            LL_DEBUGS("Avatar") << avatar->getDebugName() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL; +            LL_WARNS_ONCE("Avatar") << avatar->getDebugName() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL;              skin->mJointNames[j] = "mPelvis";              skin->mJointNumsInitialized = false; // force update after names change.          } diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index ef0f58ff7a..1310826d06 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -1028,7 +1028,7 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name)              tid, LLAssetType::AT_TEXTURE, res_name, res_desc, 0,              folder_type, inv_type,              PERM_ALL, LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), -            expected_upload_cost, !outfit_snapshot)); +            expected_upload_cost, LLUUID::null, !outfit_snapshot));          upload_new_resource(assetUploadInfo); diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index fa4e92e209..6a7ebaf8d6 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -127,6 +127,12 @@ void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d      S32 removed_index = -1;      if (item_iter != mItems.end())      { +        // When teleporting via history it's possible that there can be +        // an offset applied to the position, so each new teleport can +        // be a meter higher than the last. +        // Avoid it by preserving original position. +        item.mGlobalPos = item_iter->mGlobalPos; +          removed_index = item_iter - mItems.begin();          mItems.erase(item_iter);      } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4744edd5a3..2773f538cc 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -185,6 +185,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(      mSetImageAssetIDCallback(NULL),      mOnUpdateImageStatsCallback(NULL),      mBakeTextureEnabled(FALSE), +    mLocalTextureEnabled(false),      mInventoryPickType(pick_type)  {      mCanApplyImmediately = can_apply_immediately; @@ -524,6 +525,8 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask)  void LLFloaterTexturePicker::onOpen(const LLSD& key)  {      if (sLastPickerMode != 0 +        && (mLocalTextureEnabled || sLastPickerMode != 1) +        && (mBakeTextureEnabled || sLastPickerMode != 2)          && mModeSelector->selectByValue(sLastPickerMode))      {          changeMode(); @@ -1490,7 +1493,13 @@ void LLFloaterTexturePicker::refreshInventoryFilter()  void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled)  { +    mLocalTextureEnabled = enabled;      mModeSelector->setEnabledByValue(1, enabled); +    if (!enabled && (mModeSelector->getValue().asInteger() == 2)) +    { +        mModeSelector->selectByValue(0); +        onModeSelect(0, this); +    }  }  void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) @@ -1877,11 +1886,9 @@ void LLTextureCtrl::showPicker(BOOL take_focus)          if (texture_floaterp)          {              texture_floaterp->setOnFloaterCommitCallback(boost::bind(&LLTextureCtrl::onFloaterCommit, this, _1, _2, _3, _4, _5)); -        } -        if (texture_floaterp) -        {              texture_floaterp->setSetImageAssetIDCallback(boost::bind(&LLTextureCtrl::setImageAssetID, this, _1)); +            texture_floaterp->setLocalTextureEnabled(mAllowLocalTexture);              texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled);          } @@ -1891,12 +1898,6 @@ void LLTextureCtrl::showPicker(BOOL take_focus)          floaterp->openFloater();      } -    LLFloaterTexturePicker* picker_floater = dynamic_cast<LLFloaterTexturePicker*>(floaterp); -    if (picker_floater) -    { -        picker_floater->setLocalTextureEnabled(mAllowLocalTexture); -    } -      if (take_focus)      {          floaterp->setFocus(TRUE); @@ -2076,6 +2077,16 @@ void LLTextureCtrl::setOnTextureSelectedCallback(texture_selected_callback cb)      }  } +void LLTextureCtrl::setAllowLocalTexture(BOOL b) +{ +    mAllowLocalTexture = b; +    LLFloaterTexturePicker* picker_floater = dynamic_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); +    if (picker_floater) +    { +        picker_floater->setLocalTextureEnabled(mAllowLocalTexture); +    } +} +  void    LLTextureCtrl::setImageAssetName(const std::string& name)  {      LLPointer<LLUIImage> imagep = LLUI::getUIImage(name); diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index db36ac9cc2..819b76e8bc 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -181,7 +181,7 @@ public:      void            setAllowNoTexture( BOOL b )                 { mAllowNoTexture = b; }      bool            getAllowNoTexture() const                   { return mAllowNoTexture; } -    void            setAllowLocalTexture(BOOL b)                    { mAllowLocalTexture = b; } +    void            setAllowLocalTexture(BOOL b);      BOOL            getAllowLocalTexture() const                    { return mAllowLocalTexture; }      const LLUUID&   getImageItemID() { return mImageItemID; } @@ -455,6 +455,7 @@ private:      set_on_update_image_stats_callback mOnUpdateImageStatsCallback;      BOOL mBakeTextureEnabled; +    bool mLocalTextureEnabled;      static S32 sLastPickerMode;  }; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 77c28bd3f4..110aa61999 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2509,12 +2509,13 @@ LLTextureFetch::~LLTextureFetch()  }  S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, -                                   S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) +                                   S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http, S32& worker_discard)  {      LL_PROFILE_ZONE_SCOPED; +    worker_discard = -1;      if (mDebugPause)      { -        return -1; +        return FETCH_REQUEST_CREATION_FAILED;      }      if (f_type == FTT_SERVER_BAKE) @@ -2530,7 +2531,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L                                << host << " != " << worker->mHost << LL_ENDL;              removeRequest(worker, true);              worker = NULL; -            return -1; +            return FETCH_REQUEST_ABORTED;          }      } @@ -2583,13 +2584,14 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L      {          if (worker->wasAborted())          { -            return -1; // need to wait for previous aborted request to complete +            return FETCH_REQUEST_ABORTED; // need to wait for previous aborted request to complete          } +        worker_discard = desired_discard;          worker->lockWorkMutex();                                        // +Mw          if (worker->mState == LLTextureFetchWorker::DONE && worker->mDesiredSize == llmax(desired_size, TEXTURE_CACHE_ENTRY_SIZE) && worker->mDesiredDiscard == desired_discard) {              worker->unlockWorkMutex();                                  // -Mw -            return -1; // similar request has failed or is in a transitional state +            return FETCH_REQUEST_EXISTS; // similar request has failed or is in a transitional state          }          worker->mActiveCount++;          worker->mNeedsAux = needs_aux; @@ -2623,11 +2625,12 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L          worker->mNeedsAux = needs_aux;          worker->setCanUseHTTP(can_use_http) ;          worker->unlockWorkMutex();                                      // -Mw +        worker_discard = desired_discard;      }      LL_DEBUGS(LOG_TXT) << "REQUESTED: " << id << " f_type " << fttype_to_string(f_type)                         << " Discard: " << desired_discard << " size " << desired_size << LL_ENDL; -    return desired_discard; +    return FETCH_REQUEST_OK;  }  // Threads:  T*  // diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index b72ecc2a65..a2e038704d 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -76,9 +76,14 @@ public:      // Threads:  Tmain      void shutDownImageDecodeThread(); +    static constexpr S32 FETCH_REQUEST_OK = 0; +    static constexpr S32 FETCH_REQUEST_CREATION_FAILED = -1; +    static constexpr S32 FETCH_REQUEST_ABORTED = -2; +    static constexpr S32 FETCH_REQUEST_EXISTS = -3;      // Threads:  T* (but Tmain mostly) +    // returns discard on success, fail code otherwise      S32 createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, -                       S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http); +                      S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http, S32& worker_disacrd);      // Requests that a fetch operation be deleted from the queue.      // If @cancel is true, also stops any I/O operations pending. diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp index 8291b0b061..a151463f86 100644 --- a/indra/newview/llthumbnailctrl.cpp +++ b/indra/newview/llthumbnailctrl.cpp @@ -111,7 +111,9 @@ void LLThumbnailCtrl::draw()          gl_draw_scaled_image( draw_rect.mLeft, draw_rect.mBottom, draw_rect.getWidth(), draw_rect.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); -        mTexturep->setKnownDrawSize(draw_rect.getWidth(), draw_rect.getHeight()); +        // Thumbnails are usually 256x256 or smaller, either report that or +        // some high value to get image with higher priority +        mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);      }      else if( mImagep.notNull() )      { @@ -238,12 +240,8 @@ void LLThumbnailCtrl::initImage()          {              // Should it support baked textures?              mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_THUMBNAIL); -              mTexturep->forceToSaveRawImage(0); - -            S32 desired_draw_width = MAX_IMAGE_SIZE; -            S32 desired_draw_height = MAX_IMAGE_SIZE; -            mTexturep->setKnownDrawSize(desired_draw_width, desired_draw_height); +            mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);          }      }      else if (tvalue.isString()) diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 2e00b2c382..217bb8d7ef 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -421,7 +421,7 @@ void LLToast::setVisible(BOOL show)          if(mHideBtn)              mHideBtn->setVisible(show);      } -    LLFloater::setVisible(show); +    LLModalDialog::setVisible(show);      if (mPanel          && !mPanel->isDead()          && mWrapperPanel diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index abf9748db3..001530895d 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -2132,7 +2132,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(      {          if(mSource == SOURCE_LIBRARY)          { -            LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); +            LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, false));              copy_inventory_item(                  gAgent.getID(),                  item->getPermissions().getOwner(), @@ -2143,7 +2143,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(          }          else          { -            rez_attachment(item, 0); +            rez_attachment(item, 0, false);          }      }      return ACCEPT_YES_SINGLE; diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index a080e3dd9e..3f2df8f3fb 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -62,7 +62,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,          LLAssetType::EType assetType, std::string name, std::string description,          S32 compressionInfo, LLFolderType::EType destinationType,          LLInventoryType::EType inventoryType, U32 nextOWnerPerms, -        U32 groupPerms, U32 everyonePerms, S32 expectedCost, bool showInventory) : +        U32 groupPerms, U32 everyonePerms, S32 expectedCost, +        const LLUUID& destFolderId, bool showInventory) :      mTransactionId(transactId),      mAssetType(assetType),      mName(name), @@ -75,7 +76,7 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,      mEveryonePerms(everyonePerms),      mExpectedUploadCost(expectedCost),      mShowInventory(showInventory), -    mFolderId(LLUUID::null), +    mFolderId(destFolderId),      mItemId(LLUUID::null),      mAssetId(LLAssetID::null)  { } @@ -84,7 +85,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,  LLResourceUploadInfo::LLResourceUploadInfo(std::string name,          std::string description, S32 compressionInfo,          LLFolderType::EType destinationType, LLInventoryType::EType inventoryType, -        U32 nextOWnerPerms, U32 groupPerms, U32 everyonePerms, S32 expectedCost, bool showInventory) : +        U32 nextOWnerPerms, U32 groupPerms, U32 everyonePerms, S32 expectedCost, +        const LLUUID& destFolderId, bool showInventory) :      mName(name),      mDescription(description),      mCompressionInfo(compressionInfo), @@ -97,7 +99,7 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name,      mShowInventory(showInventory),      mTransactionId(),      mAssetType(LLAssetType::AT_NONE), -    mFolderId(LLUUID::null), +    mFolderId(destFolderId),      mItemId(LLUUID::null),      mAssetId(LLAssetID::null)  { @@ -299,9 +301,12 @@ void LLResourceUploadInfo::assignDefaults()          mDescription = "(No Description)";      } -    mFolderId = gInventory.findUserDefinedCategoryUUIDForType( -        (mDestinationFolderType == LLFolderType::FT_NONE) ? -        (LLFolderType::EType)mAssetType : mDestinationFolderType); +    if (mFolderId.isNull()) +    { +        mFolderId = gInventory.findUserDefinedCategoryUUIDForType( +            (mDestinationFolderType == LLFolderType::FT_NONE) ? +            (LLFolderType::EType)mAssetType : mDestinationFolderType); +    }  }  std::string LLResourceUploadInfo::getDisplayName() const @@ -358,10 +363,12 @@ LLNewFileResourceUploadInfo::LLNewFileResourceUploadInfo(      U32 groupPerms,      U32 everyonePerms,      S32 expectedCost, +    const LLUUID& destFolderId,      bool show_inventory) :      LLResourceUploadInfo(name, description, compressionInfo,      destinationType, inventoryType, -    nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory), +    nextOWnerPerms, groupPerms, everyonePerms, expectedCost, +    destFolderId, show_inventory),      mFileName(fileName)  {  } @@ -566,12 +573,13 @@ LLNewBufferedResourceUploadInfo::LLNewBufferedResourceUploadInfo(      U32 groupPerms,      U32 everyonePerms,      S32 expectedCost, +    const LLUUID& destFolderId,      bool show_inventory,      uploadFinish_f finish,      uploadFailure_f failure)      : LLResourceUploadInfo(name, description, compressionInfo,          destinationType, inventoryType, -        nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory) +        nextOWnerPerms, groupPerms, everyonePerms, expectedCost, destFolderId, show_inventory)      , mBuffer(buffer)      , mFinishFn(finish)      , mFailureFn(failure) diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h index 5a07fbf802..dbe2c7e7ea 100644 --- a/indra/newview/llviewerassetupload.h +++ b/indra/newview/llviewerassetupload.h @@ -54,6 +54,7 @@ public:          U32 groupPerms,          U32 everyonePerms,          S32 expectedCost, +        const LLUUID &destFolderId = LLUUID::null,          bool showInventory = true);      virtual ~LLResourceUploadInfo() @@ -104,6 +105,7 @@ protected:          U32 groupPerms,          U32 everyonePerms,          S32 expectedCost, +        const LLUUID& destFolderId = LLUUID::null,          bool showInventory = true);      LLResourceUploadInfo( @@ -155,6 +157,7 @@ public:          U32 groupPerms,          U32 everyonePerms,          S32 expectedCost, +        const LLUUID &destFolderId = LLUUID::null,          bool show_inventory = true);      virtual LLSD        prepareUpload(); @@ -191,6 +194,7 @@ public:          U32 groupPerms,          U32 everyonePerms,          S32 expectedCost, +        const LLUUID& destFolderId, // use null for default          bool show_inventory,          uploadFinish_f finish,          uploadFailure_f failure); @@ -217,6 +221,7 @@ public:      typedef std::function<void(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response)> taskUploadFinish_f;      typedef std::function<bool(LLUUID itemId, LLUUID taskId, LLSD response, std::string reason)> uploadFailed_f; +    // destFolderId is the folder to put the new item in, leave null for default      LLBufferedAssetUploadInfo(LLUUID itemId, LLAssetType::EType assetType, std::string buffer, invnUploadFinish_f finish, uploadFailed_f failed);      LLBufferedAssetUploadInfo(LLUUID itemId, LLPointer<LLImageFormatted> image, invnUploadFinish_f finish);      LLBufferedAssetUploadInfo(LLUUID taskId, LLUUID itemId, LLAssetType::EType assetType, std::string buffer, taskUploadFinish_f finish, uploadFailed_f failed); diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp index f2557e299c..9828ab1fdf 100644 --- a/indra/newview/llviewerattachmenu.cpp +++ b/indra/newview/llviewerattachmenu.cpp @@ -116,12 +116,12 @@ void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::strin          LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getLinkedItem(id);          if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))          { -            rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu +            rez_attachment(item, attachmentp, false); // don't replace if called from an "Attach To..." menu          }          else if(item && item->isFinished())          {              // must be in library. copy it to our inventory and put it on. -            LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp)); +            LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false));              copy_inventory_item(gAgent.getID(),                                  item->getPermissions().getOwner(),                                  item->getUUID(), diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 437f1239bf..3300d6f633 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -94,21 +94,25 @@ LLViewerCamera::LLViewerCamera() : LLCamera()      mZoomSubregion = 1;      mAverageSpeed = 0.f;      mAverageAngularSpeed = 0.f; -    gSavedSettings.getControl("CameraAngle")->getCommitSignal()->connect(boost::bind(&LLViewerCamera::updateCameraAngle, this, _2)); + +    mCameraAngleChangedSignal = gSavedSettings.getControl("CameraAngle")->getCommitSignal()->connect(boost::bind(&LLViewerCamera::updateCameraAngle, this, _2)); +} + +LLViewerCamera::~LLViewerCamera() +{ +    mCameraAngleChangedSignal.disconnect();  } -void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVector3 &up_direction, const LLVector3 &point_of_interest) +bool LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVector3 &up_direction, const LLVector3 &point_of_interest)  {      // do not update if avatar didn't move      if (!LLViewerJoystick::getInstance()->getCameraNeedsUpdate())      { -        return; +        return true;      } -    LLVector3 last_position; -    LLVector3 last_axis; -    last_position = getOrigin(); -    last_axis     = getAtAxis(); +    LLVector3 last_position = getOrigin(); +    LLVector3 last_axis = getAtAxis();      mLastPointOfInterest = point_of_interest; @@ -118,30 +122,49 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVecto          regp = gAgent.getRegion();      } -    F32 water_height = (NULL != regp) ? regp->getWaterHeight() : 0.f; +    F32 water_height = regp ? regp->getWaterHeight() : 0.f;      LLVector3 origin = center; +    // Move origin[VZ] far enough (up or down) from the water surface +    static const F32 MIN_DIST_TO_WATER = 0.2f; +    F32& zpos = origin.mV[VZ]; +    if (zpos < water_height + MIN_DIST_TO_WATER)      { -        if (origin.mV[2] > water_height) +        if (zpos >= water_height)          { -            origin.mV[2] = llmax(origin.mV[2], water_height + 0.20f); +            zpos = water_height + MIN_DIST_TO_WATER;          } -        else +        else if (zpos > water_height - MIN_DIST_TO_WATER)          { -            origin.mV[2] = llmin(origin.mV[2], water_height - 0.20f); +            zpos = water_height - MIN_DIST_TO_WATER;          }      } -    setOriginAndLookAt(origin, up_direction, point_of_interest); +    LLVector3 at(point_of_interest - origin); +    at.normalize(); +    if (at.isNull() || !at.isFinite()) +        return false; + +    LLVector3 left(up_direction % at); +    left.normalize(); +    if (left.isNull() || !left.isFinite()) +        return false; + +    LLVector3 up = at % left; +    up.normalize(); +    if (up.isNull() || !up.isFinite()) +        return false; -    mVelocityDir = origin - last_position ; -    F32 dpos = mVelocityDir.normVec() ; +    setOrigin(origin); +    setAxes(at, left, up); + +    mVelocityDir = origin - last_position; +    F32 dpos = mVelocityDir.normVec();      LLQuaternion rotation;      rotation.shortestArc(last_axis, getAtAxis()); -    F32 x, y, z; -    F32 drot; +    F32 drot, x, y, z;      rotation.getAngleAxis(&drot, &x, &y, &z);      add(sVelocityStat, dpos); @@ -152,16 +175,17 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVecto      mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect()));      // update pixel meter ratio using default fov, not modified one -    mPixelMeterRatio = getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5)); +    mPixelMeterRatio = getViewHeightInPixels() / (2.f * tanf(mCameraFOVDefault * 0.5));      // update screen pixel area -    mScreenPixelArea =(S32)((F32)getViewHeightInPixels() * ((F32)getViewHeightInPixels() * getAspect())); +    mScreenPixelArea = (S32)((F32)getViewHeightInPixels() * ((F32)getViewHeightInPixels() * getAspect())); + +    return true;  }  const LLMatrix4 &LLViewerCamera::getProjection() const  {      calcProjection(getFar());      return mProjectionMatrix; -  }  const LLMatrix4 &LLViewerCamera::getModelview() const @@ -174,19 +198,18 @@ const LLMatrix4 &LLViewerCamera::getModelview() const  void LLViewerCamera::calcProjection(const F32 far_distance) const  { -    F32 fov_y, z_far, z_near, aspect, f; -    fov_y = getView(); -    z_far = far_distance; -    z_near = getNear(); -    aspect = getAspect(); +    F32 fov_y = getView(); +    F32 z_far = far_distance; +    F32 z_near = getNear(); +    F32 aspect = getAspect(); -    f = 1/tan(fov_y*0.5f); +    F32 f = 1 / tan(fov_y * 0.5f);      mProjectionMatrix.setZero(); -    mProjectionMatrix.mMatrix[0][0] = f/aspect; +    mProjectionMatrix.mMatrix[0][0] = f / aspect;      mProjectionMatrix.mMatrix[1][1] = f; -    mProjectionMatrix.mMatrix[2][2] = (z_far + z_near)/(z_near - z_far); -    mProjectionMatrix.mMatrix[3][2] = (2*z_far*z_near)/(z_near - z_far); +    mProjectionMatrix.mMatrix[2][2] = (z_far + z_near) / (z_near - z_far); +    mProjectionMatrix.mMatrix[3][2] = (2 * z_far * z_near) / (z_near - z_far);      mProjectionMatrix.mMatrix[2][3] = -1;  } @@ -208,71 +231,71 @@ void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zfli          proj[i] = (F64) gGLProjection[i];      } -    GLdouble objX,objY,objZ; +    GLdouble objX, objY, objZ;      LLVector3 frust[8];      if (no_hacks)      { -        gluUnProject(viewport[0],viewport[1],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[0].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[1].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[2].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[3].setVec((F32)objX,(F32)objY,(F32)objZ); - -        gluUnProject(viewport[0],viewport[1],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[4].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[5].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1]+viewport[3],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[6].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0],viewport[1]+viewport[3],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[7].setVec((F32)objX,(F32)objY,(F32)objZ); +        gluUnProject(viewport[0], viewport[1], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[0].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[1].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1] + viewport[3], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[2].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0], viewport[1] + viewport[3], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[3].setVec((F32)objX, (F32)objY, (F32)objZ); + +        gluUnProject(viewport[0], viewport[1], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[4].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[5].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1] + viewport[3], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[6].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0], viewport[1] + viewport[3], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[7].setVec((F32)objX, (F32)objY, (F32)objZ);      }      else if (zflip)      { -        gluUnProject(viewport[0],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[0].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[1].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[2].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0],viewport[1],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[3].setVec((F32)objX,(F32)objY,(F32)objZ); - -        gluUnProject(viewport[0],viewport[1]+viewport[3],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[4].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1]+viewport[3],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[5].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[6].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0],viewport[1],1,model,proj,viewport,&objX,&objY,&objZ); -        frust[7].setVec((F32)objX,(F32)objY,(F32)objZ); +        gluUnProject(viewport[0], viewport[1] + viewport[3], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[0].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1] + viewport[3], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[1].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[2].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0], viewport[1], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[3].setVec((F32)objX, (F32)objY, (F32)objZ); + +        gluUnProject(viewport[0], viewport[1] + viewport[3], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[4].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1] + viewport[3], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[5].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[6].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0], viewport[1], 1, model, proj, viewport, &objX, &objY, &objZ); +        frust[7].setVec((F32)objX, (F32)objY, (F32)objZ);          for (U32 i = 0; i < 4; i++)          { -            frust[i+4] = frust[i+4]-frust[i]; -            frust[i+4].normVec(); -            frust[i+4] = frust[i] + frust[i+4]*camera.getFar(); +            frust[i + 4] = frust[i + 4] - frust[i]; +            frust[i + 4].normVec(); +            frust[i + 4] = frust[i] + frust[i + 4] * camera.getFar();          }      }      else      { -        gluUnProject(viewport[0],viewport[1],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[0].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[1].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0]+viewport[2],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[2].setVec((F32)objX,(F32)objY,(F32)objZ); -        gluUnProject(viewport[0],viewport[1]+viewport[3],0,model,proj,viewport,&objX,&objY,&objZ); -        frust[3].setVec((F32)objX,(F32)objY,(F32)objZ); +        gluUnProject(viewport[0], viewport[1], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[0].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[1].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0] + viewport[2], viewport[1] + viewport[3], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[2].setVec((F32)objX, (F32)objY, (F32)objZ); +        gluUnProject(viewport[0], viewport[1] + viewport[3], 0, model, proj, viewport, &objX, &objY, &objZ); +        frust[3].setVec((F32)objX, (F32)objY, (F32)objZ);          if (ortho)          { -            LLVector3 far_shift = camera.getAtAxis()*camera.getFar()*2.f; +            LLVector3 far_shift = camera.getAtAxis() * camera.getFar() * 2.f;              for (U32 i = 0; i < 4; i++)              {                  frust[i+4] = frust[i] + far_shift; @@ -284,7 +307,7 @@ void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zfli              {                  LLVector3 vec = frust[i] - camera.getOrigin();                  vec.normVec(); -                frust[i+4] = camera.getOrigin() + vec*camera.getFar(); +                frust[i + 4] = camera.getOrigin() + vec * camera.getFar();              }          }      } @@ -322,11 +345,13 @@ void LLViewerCamera::setPerspective(BOOL for_selection,          // make a tiny little viewport          // anything drawn into this viewport will be "selected" -        GLint viewport[4]; -        viewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; -        viewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; -        viewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth(); -        viewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); +        GLint viewport[] = +        { +            gViewerWindow->getWorldViewRectRaw().mLeft, +            gViewerWindow->getWorldViewRectRaw().mBottom, +            gViewerWindow->getWorldViewRectRaw().getWidth(), +            gViewerWindow->getWorldViewRectRaw().getHeight() +        };          proj_mat = gl_pick_matrix(x+width/2.f, y_from_bot+height/2.f, (GLfloat) width, (GLfloat) height, viewport); @@ -383,7 +408,7 @@ void LLViewerCamera::setPerspective(BOOL for_selection,      glh::matrix4f modelview((GLfloat*) OGL_TO_CFR_ROTATION); -    GLfloat         ogl_matrix[16]; +    GLfloat ogl_matrix[16];      getOpenGLTransform(ogl_matrix); @@ -396,11 +421,13 @@ void LLViewerCamera::setPerspective(BOOL for_selection,          // NB: as of this writing, i believe the code below is broken (doesn't take into account the world view, assumes entire window)          // however, it is also unused (the GL matricies are used for selection, (see LLCamera::sphereInFrustum())) and so i'm not          // comfortable hacking on it. -        calculateFrustumPlanesFromWindow((F32)(x - width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f, -                                (F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f, -                                (F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f, -                                (F32)(y_from_bot + height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f); - +        calculateFrustumPlanesFromWindow +        ( +            (F32)(x - width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f, +            (F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f, +            (F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f, +            (F32)(y_from_bot + height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f +        );      }      // if not picking and not doing a snapshot, cache various GL matrices @@ -896,9 +923,8 @@ BOOL LLViewerCamera::isDefaultFOVChanged()  }  // static -void LLViewerCamera::updateCameraAngle( void* user_data, const LLSD& value) +void LLViewerCamera::updateCameraAngle(const LLSD& value)  { -    LLViewerCamera* self=(LLViewerCamera*)user_data; -    self->setDefaultFOV(value.asReal()); +    setDefaultFOV(value.asReal());  } diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 3bbb33f82c..ce006b49cf 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -43,6 +43,7 @@ class alignas(16) LLViewerCamera : public LLCamera, public LLSimpleton<LLViewerC      LL_ALIGN_NEW  public:      LLViewerCamera(); +    ~LLViewerCamera();      typedef enum      { @@ -60,12 +61,12 @@ public:      static eCameraID sCurCameraID; -    void updateCameraLocation(const LLVector3 ¢er, +    bool updateCameraLocation(const LLVector3 ¢er,                                  const LLVector3 &up_direction,                                  const LLVector3 &point_of_interest);      static void updateFrustumPlanes(LLCamera& camera, BOOL ortho = FALSE, BOOL zflip = FALSE, BOOL no_hacks = FALSE); -    static void updateCameraAngle(void* user_data, const LLSD& value); +    void updateCameraAngle(const LLSD& value);      void setPerspective(BOOL for_selection, S32 x, S32 y_from_bot, S32 width, S32 height, BOOL limit_select_distance, F32 z_near = 0, F32 z_far = 0);      const LLMatrix4 &getProjection() const; @@ -76,12 +77,12 @@ public:      BOOL projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const BOOL clamp = TRUE) const;      BOOL projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const; -    LLVector3 getVelocityDir() const {return mVelocityDir;} -    static LLTrace::CountStatHandle<>* getVelocityStat()           {return &sVelocityStat; } -    static LLTrace::CountStatHandle<>* getAngularVelocityStat()  {return &sAngularVelocityStat; } -    F32     getCosHalfFov() {return mCosHalfCameraFOV;} -    F32     getAverageSpeed() {return mAverageSpeed ;} -    F32     getAverageAngularSpeed() {return mAverageAngularSpeed;} +    LLVector3 getVelocityDir() const { return mVelocityDir; } +    static LLTrace::CountStatHandle<>* getVelocityStat() { return &sVelocityStat; } +    static LLTrace::CountStatHandle<>* getAngularVelocityStat() { return &sAngularVelocityStat; } +    F32     getCosHalfFov() const { return mCosHalfCameraFOV; } +    F32     getAverageSpeed() const { return mAverageSpeed; } +    F32     getAverageAngularSpeed() const { return mAverageAngularSpeed; }      void getPixelVectors(const LLVector3 &pos_agent, LLVector3 &up, LLVector3 &right);      LLVector3 roundToPixel(const LLVector3 &pos_agent); @@ -89,21 +90,21 @@ public:      // Sets the current matrix      /* virtual */ void setView(F32 vertical_fov_rads); // NOTE: broadcasts to simulator      void setViewNoBroadcast(F32 vertical_fov_rads);  // set FOV without broadcasting to simulator (for temporary local cameras) -    void setDefaultFOV(F32 fov) ; -    F32 getDefaultFOV() { return mCameraFOVDefault; } +    void setDefaultFOV(F32 fov); +    F32 getDefaultFOV() const { return mCameraFOVDefault; }      BOOL isDefaultFOVChanged();      BOOL cameraUnderWater() const;      BOOL areVertsVisible(LLViewerObject* volumep, BOOL all_verts); -    const LLVector3 &getPointOfInterest() { return mLastPointOfInterest; } +    const LLVector3& getPointOfInterest() const { return mLastPointOfInterest; }      F32 getPixelMeterRatio() const              { return mPixelMeterRatio; }      S32 getScreenPixelArea() const              { return mScreenPixelArea; }      void setZoomParameters(F32 factor, S16 subregion) { mZoomFactor = factor; mZoomSubregion = subregion; } -    F32 getZoomFactor() { return mZoomFactor; } -    S16 getZoomSubRegion() { return mZoomSubregion; } +    F32 getZoomFactor() const { return mZoomFactor; } +    S16 getZoomSubRegion() const { return mZoomSubregion; }  protected:      void calcProjection(const F32 far_distance) const; @@ -125,6 +126,8 @@ protected:      F32                 mZoomFactor;      S16                 mZoomSubregion; +    boost::signals2::connection mCameraAngleChangedSignal; +  public:  }; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 2e920c43eb..425fc17aa9 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -966,7 +966,7 @@ void LLInventoryCallbackManager::fire(U32 callback_id, const LLUUID& item_id)      }  } -void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp) +void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace)  {      if (inv_item.isNull())          return; @@ -974,7 +974,7 @@ void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachme      LLViewerInventoryItem *item = gInventory.getItem(inv_item);      if (item)      { -        rez_attachment(item, attachmentp); +        rez_attachment(item, attachmentp, replace);      }  } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 158965fc88..7138bf2a95 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -264,7 +264,7 @@ public:  class LLViewerJointAttachment; -void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp); +void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace);  void activate_gesture_cb(const LLUUID& inv_item); diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 3a3f0b3d95..e5a8226720 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -413,10 +413,10 @@ void LLViewerJoystick::init(bool autoenable)                  {                      LL_INFOS("Joystick") << "Failed to gather input devices. Falling back to ndof's init" << LL_ENDL;                      // Failed to gather devices, init first suitable one -                    mLastDeviceUUID = LLSD(); -                    void *preffered_device = NULL; -                    initDevice(preffered_device); -                } +                mLastDeviceUUID = LLSD(); +                void *preffered_device = NULL; +                initDevice(preffered_device); +            }              }              if (mDriverState == JDS_INITIALIZING) @@ -510,10 +510,10 @@ void LLViewerJoystick::initDevice(LLSD &guid)          {              LL_INFOS("Joystick") << "Failed to gather input devices. Falling back to ndof's init" << LL_ENDL;              // Failed to gather devices from window, init first suitable one -            void *preffered_device = NULL; -            mLastDeviceUUID = LLSD(); -            initDevice(preffered_device); -        } +        void *preffered_device = NULL; +        mLastDeviceUUID = LLSD(); +        initDevice(preffered_device); +    }      }      if (mDriverState == JDS_INITIALIZING) @@ -881,6 +881,10 @@ void LLViewerJoystick::moveObjects(bool reset)          {              gAgent.clearAFK();          } +        else +        { +            gAwayTriggerTimer.reset(); +        }          if (sDelta[0] || sDelta[1] || sDelta[2])          { @@ -1055,6 +1059,10 @@ void LLViewerJoystick::moveAvatar(bool reset)          {              gAgent.clearAFK();          } +        else +        { +            gAwayTriggerTimer.reset(); +        }          setCameraNeedsUpdate(true);      } @@ -1267,9 +1275,16 @@ void LLViewerJoystick::moveFlycam(bool reset)      }      // Clear AFK state if moved beyond the deadzone -    if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) +    if (!is_zero)      { -        gAgent.clearAFK(); +        if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) +        { +            gAgent.clearAFK(); +        } +        else +        { +            gAwayTriggerTimer.reset(); +        }      }      sFlycamPosition += LLVector3(sDelta) * sFlycamRotation; @@ -1331,6 +1346,10 @@ bool LLViewerJoystick::toggleFlycam()      {          gAgent.clearAFK();      } +    else +    { +        gAwayTriggerTimer.reset(); +    }      mOverrideCamera = !mOverrideCamera;      if (mOverrideCamera) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4dcfb18b30..a5e1da89b7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -84,6 +84,7 @@  #include "lltoolface.h"  #include "llhints.h"  #include "llhudeffecttrail.h" +#include "llhudeffectresetskeleton.h"  #include "llhudmanager.h"  #include "llimview.h"  #include "llinventorybridge.h" @@ -1755,7 +1756,6 @@ class LLAdvancedAppearanceToXML : public view_listener_t  {      bool handleEvent(const LLSD& userdata)      { -        std::string emptyname;          LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();          LLVOAvatar *avatar = NULL;          if (obj) @@ -1782,7 +1782,7 @@ class LLAdvancedAppearanceToXML : public view_listener_t          }          if (avatar)          { -            avatar->dumpArchetypeXML(emptyname); +            avatar->dumpArchetypeXML(LLStringUtil::null);          }          return true;      } @@ -5547,6 +5547,38 @@ class LLToolsEnablePathfindingRebakeRegion : public view_listener_t      }  }; +class LLToolsCheckSelectionLODMode : public view_listener_t +{ +    bool handleEvent(const LLSD& userdata) +    { +        std::string param = userdata.asString(); +        static LLCachedControl<S32> debug_selection_lods(gSavedSettings, "DebugSelectionLODs", 0); +        if ("default" == param) +        { +            return debug_selection_lods() < 0; +        } +        else if ("high" == param) +        { +            return debug_selection_lods() == 3; +        } +        else if ("medium" == param) +        { +            return debug_selection_lods() == 2; +        } +        else if ("low" == param) +        { +            return debug_selection_lods() == 1; +        } +        else if ("lowest" == param) +        { +            return debug_selection_lods() == 0; +        } + +        return false; +    } +}; + +  // Round the position of all root objects to the grid  class LLToolsSnapObjectXY : public view_listener_t  { @@ -6568,7 +6600,17 @@ class LLAvatarResetSkeleton: public view_listener_t          }          if(avatar)          { -            avatar->resetSkeleton(false); +            if(avatar->getID() == gAgentID) +            { +                LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); +                effectp->setSourceObject(gAgentAvatarp); +                effectp->setTargetObject((LLViewerObject*)avatar); +                effectp->setResetAnimations(false); +            } +            else +            { +                avatar->resetSkeleton(false); +            }          }          return true;      } @@ -6595,7 +6637,17 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t          LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());          if (avatar)          { -            avatar->resetSkeleton(true); +            if(avatar->getID() == gAgentID) +            { +                LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); +                effectp->setSourceObject(gAgentAvatarp); +                effectp->setTargetObject((LLViewerObject*)avatar); +                effectp->setResetAnimations(true); +            } +            else +            { +                avatar->resetSkeleton(true); +            }          }          return true;      } @@ -6608,11 +6660,24 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t          LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());          if (avatar)          { -            avatar->resetSkeleton(true); +            if(avatar->getID() == gAgentID) +            { +                LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); +                effectp->setSourceObject(gAgentAvatarp); +                effectp->setTargetObject((LLViewerObject*)avatar); +                effectp->setResetAnimations(true); +            } +            else +            { +                avatar->resetSkeleton(true); +            }          }          else          { -            gAgentAvatarp->resetSkeleton(true); +            LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); +            effectp->setSourceObject(gAgentAvatarp); +            effectp->setTargetObject(gAgentAvatarp); +            effectp->setResetAnimations(true);          }          return true;      } @@ -7404,21 +7469,21 @@ class LLAttachmentDetach : public view_listener_t                  }                  LLViewerObject* parent = (LLViewerObject*)objectp->getParent(); -                while (parent) -                { -                    if (parent->isAvatar()) -                    { -                        break; -                    } +        while (parent) +        { +            if(parent->isAvatar()) +            { +                break; +            }                      objectp = parent; -                    parent = (LLViewerObject*)parent->getParent(); -                } +            parent = (LLViewerObject*)parent->getParent(); +        }                  // std::set to avoid dupplicate 'roots' from linksets                  mRemoveSet.insert(objectp->getAttachmentItemID()); -                return true; -            } +            return true; +        }              bool mAvatarsInSelection;              uuid_set_t mRemoveSet;          } func; @@ -8347,6 +8412,36 @@ class LLToolsSelectBySurrounding : public view_listener_t      }  }; +class LLToolsSelectionLODMode : public view_listener_t +{ +    bool handleEvent(const LLSD& userdata) +    { +        std::string param = userdata.asString(); +        if ("default" == param) +        { +            gSavedSettings.setS32("DebugSelectionLODs", -1); +        } +        else if ("high" == param) +        { +            gSavedSettings.setS32("DebugSelectionLODs", 3); +        } +        else if ("medium" == param) +        { +            gSavedSettings.setS32("DebugSelectionLODs", 2); +        } +        else if ("low" == param) +        { +            gSavedSettings.setS32("DebugSelectionLODs", 1); +        } +        else if ("lowest" == param) +        { +            gSavedSettings.setS32("DebugSelectionLODs", 0); +        } + +        return true; +    } +}; +  class LLToolsShowHiddenSelection : public view_listener_t  {      bool handleEvent(const LLSD& userdata) @@ -9593,6 +9688,7 @@ void initialize_menus()      view_listener_t::addMenu(new LLToolsSelectInvisibleObjects(), "Tools.SelectInvisibleObjects");      view_listener_t::addMenu(new LLToolsSelectReflectionProbes(), "Tools.SelectReflectionProbes");      view_listener_t::addMenu(new LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding"); +    view_listener_t::addMenu(new LLToolsSelectionLODMode(), "Tools.SelectionLODMode");      view_listener_t::addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection");      view_listener_t::addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius");      view_listener_t::addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts"); @@ -9624,6 +9720,7 @@ void initialize_menus()      view_listener_t::addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView");      view_listener_t::addMenu(new LLToolsDoPathfindingRebakeRegion(), "Tools.DoPathfindingRebakeRegion");      view_listener_t::addMenu(new LLToolsEnablePathfindingRebakeRegion(), "Tools.EnablePathfindingRebakeRegion"); +    view_listener_t::addMenu(new LLToolsCheckSelectionLODMode(), "Tools.ToolsCheckSelectionLODMode");      // Help menu      // most items use the ShowFloater method diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 192ebd1f39..ec72aa283f 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -478,13 +478,19 @@ const bool check_file_extension(const std::string& filename, LLFilePicker::ELoad      return true;  } -const void upload_single_file(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type) +void upload_single_file( +    const std::vector<std::string>& filenames, +    LLFilePicker::ELoadFilter type, +    const LLUUID& dest)  {      std::string filename = filenames[0];      if (!check_file_extension(filename, type)) return;      if (!filename.empty())      { +        LLSD args; +        args["filename"] = filename; +        args["dest"] = dest;          if (type == LLFilePicker::FFLOAD_WAV)          {              // pre-qualify wavs to make sure the format is acceptable @@ -499,12 +505,12 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP              }              else              { -                LLFloaterReg::showInstance("upload_sound", LLSD(filename)); +                LLFloaterReg::showInstance("upload_sound", args);              }          }          if (type == LLFilePicker::FFLOAD_IMAGE)          { -            LLFloaterReg::showInstance("upload_image", LLSD(filename)); +            LLFloaterReg::showInstance("upload_image", args);          }          if (type == LLFilePicker::FFLOAD_ANIM)          { @@ -512,18 +518,22 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP              LLStringUtil::toLower(filename_lc);              if (filename_lc.rfind(".anim") != std::string::npos)              { -                LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename)); +                LLFloaterReg::showInstance("upload_anim_anim", args);              }              else              { -                LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename)); +                LLFloaterReg::showInstance("upload_anim_bvh", args);              }          }      }      return;  } -void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification, const LLSD& response) +void do_bulk_upload( +    std::vector<std::string> filenames, +    const LLSD& notification, +    const LLSD& response, +    const LLUUID& dest)  {      S32 option = LLNotificationsUtil::getSelectedOption(notification, response);      if (option != 0) @@ -575,7 +585,8 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification                      LLFloaterPerms::getNextOwnerPerms("Uploads"),                      LLFloaterPerms::getGroupPerms("Uploads"),                      LLFloaterPerms::getEveryonePerms("Uploads"), -                    expected_upload_cost)); +                    expected_upload_cost, +                    dest));                  upload_new_resource(uploadInfo);              } @@ -594,7 +605,7 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification                      // Todo:                      // 1. Decouple bulk upload from material editor                      // 2. Take into account possiblity of identical textures -                    LLMaterialEditor::uploadMaterialFromModel(filename, model, i); +                    LLMaterialEditor::uploadMaterialFromModel(filename, model, i, dest);                  }              }          } @@ -682,7 +693,10 @@ bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S3      return file_count > 0;  } -const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type) +void upload_bulk( +    const std::vector<std::string>& filenames, +    LLFilePicker::ELoadFilter type, +    const LLUUID& dest)  {      // TODO:      // Check user balance for entire cost @@ -713,7 +727,7 @@ const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::          LLSD args;          args["COST"] = expected_upload_cost;          args["COUNT"] = expected_upload_count; -        LLNotificationsUtil::add("BulkUploadCostConfirmation",  args, LLSD(), boost::bind(do_bulk_upload, filtered_filenames, _1, _2)); +        LLNotificationsUtil::add("BulkUploadCostConfirmation",  args, LLSD(), boost::bind(do_bulk_upload, filtered_filenames, _1, _2, dest));          if (filtered_filenames.size() > expected_upload_count)          { @@ -746,7 +760,7 @@ class LLFileUploadImage : public view_listener_t          {              gAgentCamera.changeCameraToDefault();          } -        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_IMAGE, false); +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_IMAGE, false);          return true;      }  }; @@ -777,7 +791,7 @@ class LLFileUploadSound : public view_listener_t          {              gAgentCamera.changeCameraToDefault();          } -        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_WAV, false); +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_WAV, false);          return true;      }  }; @@ -790,7 +804,7 @@ class LLFileUploadAnim : public view_listener_t          {              gAgentCamera.changeCameraToDefault();          } -        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_ANIM, false); +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_ANIM, false);          return true;      }  }; @@ -803,7 +817,7 @@ class LLFileUploadBulk : public view_listener_t          {              gAgentCamera.changeCameraToDefault();          } -        LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2), LLFilePicker::FFLOAD_ALL, true); +        LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_ALL, true);          return true;      }  }; @@ -1091,7 +1105,7 @@ LLUUID upload_new_resource(          name, desc, compression_info,          destination_folder_type, inv_type,          next_owner_perms, group_perms, everyone_perms, -        expected_upload_cost, show_inventory)); +        expected_upload_cost, LLUUID::null, show_inventory));      upload_new_resource(uploadInfo, callback, userdata);      return LLUUID::null; diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 1acb701d50..f58b7b42c1 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -72,6 +72,16 @@ void assign_defaults_and_show_upload_message(      const std::string& display_name,      std::string& description); +void upload_single_file( +    const std::vector<std::string>& filenames, +    LLFilePicker::ELoadFilter type, +    const LLUUID& dest); + +void upload_bulk( +    const std::vector<std::string>& filenames, +    LLFilePicker::ELoadFilter type, +    const LLUUID& dest); +  //consider moving all file pickers below to more suitable place  class LLFilePickerThread : public LLThread  { //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index a01e0b435f..f80ff69599 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -258,6 +258,7 @@ public:      virtual BOOL isRiggedMesh() const               { return FALSE; }      virtual BOOL hasLightTexture() const            { return FALSE; }      virtual BOOL isReflectionProbe() const          { return FALSE; } +    virtual bool getReflectionProbeIsBox() const    { return false; };      // This method returns true if the object is over land owned by      // the agent, one of its groups, or it encroaches and diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 5c9dbcea76..b24ba17543 100755 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -538,7 +538,7 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3          };      // First part, only one vertex -    outside_z = land.resolveHeightRegion( outside_x, outside_y ); +    outside_z = land.resolveHeightRegion(outside_x, outside_y);      edge.vertices.emplace_back(outside_x, outside_y, outside_z); @@ -549,8 +549,8 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3      outside_y += dy * LINE_WIDTH;      // Then the "actual edge" -    inside_z = land.resolveHeightRegion( inside_x, inside_y ); -    outside_z = land.resolveHeightRegion( outside_x, outside_y ); +    inside_z = land.resolveHeightRegion(inside_x, inside_y); +    outside_z = land.resolveHeightRegion(outside_x, outside_y);      edge.vertices.emplace_back(inside_x, inside_y, inside_z);      edge.vertices.emplace_back(outside_x, outside_y, outside_z); @@ -562,11 +562,11 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3      outside_y += dy * (dy - LINE_WIDTH);      // Middle part, full width -    const S32 GRID_STEP = S32( PARCEL_GRID_STEP_METERS ); +    const S32 GRID_STEP = (S32)PARCEL_GRID_STEP_METERS;      for (S32 i = 1; i < GRID_STEP; i++)      { -        inside_z = land.resolveHeightRegion( inside_x, inside_y ); -        outside_z = land.resolveHeightRegion( outside_x, outside_y ); +        inside_z = land.resolveHeightRegion(inside_x, inside_y); +        outside_z = land.resolveHeightRegion(outside_x, outside_y);          checkForSplit(); @@ -587,8 +587,8 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3      outside_x -= dx * LINE_WIDTH;      outside_y -= dy * LINE_WIDTH; -    inside_z = land.resolveHeightRegion( inside_x, inside_y ); -    outside_z = land.resolveHeightRegion( outside_x, outside_y ); +    inside_z = land.resolveHeightRegion(inside_x, inside_y); +    outside_z = land.resolveHeightRegion(outside_x, outside_y);      checkForSplit(); @@ -599,7 +599,7 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3      outside_y += dy * LINE_WIDTH;      // Last edge is not drawn to the edge -    outside_z = land.resolveHeightRegion( outside_x, outside_y ); +    outside_z = land.resolveHeightRegion(outside_x, outside_y);      edge.vertices.emplace_back(outside_x, outside_y, outside_z);  } @@ -647,7 +647,9 @@ void LLViewerParcelOverlay::renderPropertyLines()          return;      LLSurface& land = mRegion->getLand(); -    F32 water_z = land.getWaterHeight() + 0.01f; + +    bool render_water = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_VOIDWATER); +    F32 water_z = render_water ? land.getWaterHeight() + 0.01f : 0;      LLGLSUIDefault gls_ui; // called from pipeline      gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index d24e15a7d3..c80a2dde32 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2841,7 +2841,11 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss              if(entry->isState(LLVOCacheEntry::ACTIVE))              { -                ((LLDrawable*)entry->getEntry()->getDrawable())->getVObj()->loadFlags(flags); +                LLDrawable* drawable = (LLDrawable*)entry->getEntry()->getDrawable(); +                if (drawable && drawable->getVObj()) +                { +                    drawable->getVObj()->loadFlags(flags); +                }                  return true;              } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9aee1c0caf..97f50cae62 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1032,6 +1032,7 @@ void LLViewerFetchedTexture::init(bool firstinit)      mOrigHeight = 0;      mHasAux = FALSE;      mNeedsAux = FALSE; +    mLastWorkerDiscardLevel = -1;      mRequestedDiscardLevel = -1;      mRequestedDownloadPriority = 0.f;      mFullyLoaded = FALSE; @@ -1193,12 +1194,11 @@ void LLViewerFetchedTexture::loadFromFastCache()              if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)              { -                S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; -                S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; -                if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) +                if (mRawImage && (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS))                  { -                    // scale oversized icon, no need to give more work to gl -                    mRawImage->scale(expected_width, expected_height); +                    // Scale oversized thumbnail +                    // thumbnails aren't supposed to go over DEFAULT_THUMBNAIL_DIMENSIONS +                    mRawImage->scale(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS);                  }              } @@ -1941,13 +1941,10 @@ bool LLViewerFetchedTexture::updateFetch()                  if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)                  { -                    S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; -                    S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; -                    if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) +                    if (mRawImage && (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS))                      { -                        // scale oversized icon, no need to give more work to gl -                        // since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy -                        mRawImage = mRawImage->scaled(expected_width, expected_height); +                        // Scale oversized thumbnail +                        mRawImage = mRawImage->scaled(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS);                      }                  } @@ -2088,18 +2085,26 @@ bool LLViewerFetchedTexture::updateFetch()          }          // bypass texturefetch directly by pulling from LLTextureCache -        S32 fetch_request_discard = -1; -        fetch_request_discard = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, -                                                                              w, h, c, desired_discard, needsAux(), mCanUseHTTP); - -        if (fetch_request_discard >= 0) +        S32 worker_discard = -1; +        S32 result = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, +                                                                              w, h, c, desired_discard, needsAux(), mCanUseHTTP, worker_discard); + + +        if ((result >= 0) // Worker created +            // scaled and standard images share requests, they just process the result differently +            // if mLastWorkerDiscardLevel doen't match worker, worker was requested by a different +            // image and current one needs to schedule an update +            || (result == LLTextureFetch::FETCH_REQUEST_EXISTS +                && mLastWorkerDiscardLevel != worker_discard) +            )          {              LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created");              mHasFetcher = TRUE;              mIsFetching = TRUE; +            mLastWorkerDiscardLevel = worker_discard;              // in some cases createRequest can modify discard, as an example              // bake textures are always at discard 0 -            mRequestedDiscardLevel = llmin(desired_discard, fetch_request_discard); +            mRequestedDiscardLevel = llmin(desired_discard, worker_discard);              mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority,                                                         mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);          } @@ -2797,11 +2802,9 @@ void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* im          }          else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)          { -            S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; -            S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; -            if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) +            if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS)              { -                mCachedRawImage = new LLImageRaw(expected_width, expected_height, imageraw->getComponents()); +                mCachedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, imageraw->getComponents());                  mCachedRawImage->copyScaled(imageraw);              }              else @@ -2919,11 +2922,9 @@ void LLViewerFetchedTexture::saveRawImage()      }      else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)      { -        S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS; -        S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS; -        if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) +        if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS)          { -            mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents()); +            mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents());              mSavedRawImage->copyScaled(mRawImage);          }          else diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b1983445a6..1f559fd78d 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -453,6 +453,7 @@ protected:      BOOL mKnownDrawSizeChanged ;      std::string mUrl; +    S32 mLastWorkerDiscardLevel;      S32 mRequestedDiscardLevel;      F32 mRequestedDownloadPriority;      S32 mFetchState; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b637bcbdac..be7324ede0 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -66,6 +66,7 @@  #include "llchatentry.h"  #include "indra_constants.h"  #include "llassetstorage.h" +#include "lldate.h"  #include "llerrorcontrol.h"  #include "llfontgl.h"  #include "llmousehandler.h" @@ -1427,10 +1428,16 @@ void LLViewerWindow::handleMouseMove(LLWindow *window,  LLCoordGL pos, MASK mask      mWindow->showCursorFromMouseMove(); -    if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME -        && !gDisconnected) +    if (!gDisconnected)      { -        gAgent.clearAFK(); +        if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) +        { +            gAgent.clearAFK(); +        } +        else +        { +            gAwayTriggerTimer.reset(); +        }      }  } @@ -1547,6 +1554,10 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key,  MASK mask, BOOL repeated)      {          gAgent.clearAFK();      } +    else +    { +        gAwayTriggerTimer.reset(); +    }      // *NOTE: We want to interpret KEY_RETURN later when it arrives as      // a Unicode char, not as a keydown.  Otherwise when client frame @@ -2999,7 +3010,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)      {          if ((focusedFloaterName == "nearby_chat") || (focusedFloaterName == "im_container") || (focusedFloaterName == "impanel"))          { -            if (gSavedSettings.getBOOL("ArrowKeysAlwaysMove")) +            LLCachedControl<bool> key_move(gSavedSettings, "ArrowKeysAlwaysMove"); +            if (key_move())              {                  // let Control-Up and Control-Down through for chat line history,                  if (!(key == KEY_UP && mask == MASK_CONTROL) @@ -3013,10 +3025,9 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)                      case KEY_RIGHT:                      case KEY_UP:                      case KEY_DOWN: -                    case KEY_PAGE_UP: -                    case KEY_PAGE_DOWN: -                    case KEY_HOME: -                    case KEY_END: +                    case KEY_PAGE_UP: //jump +                    case KEY_PAGE_DOWN: // down +                    case KEY_HOME: // toggle fly                          // when chatbar is empty or ArrowKeysAlwaysMove set,                          // pass arrow keys on to avatar...                          return FALSE; @@ -4781,22 +4792,19 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save      }      // Look for an unused file name -    BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); +    auto is_snapshot_name_loc_set = isSnapshotLocSet();      std::string filepath; -    S32 i = 1; -    S32 err = 0; -    std::string extension("." + image->getExtension()); +    auto i = 1; +    auto err = 0; +    auto extension("." + image->getExtension()); +    auto now = LLDate::now();      do      {          filepath = sSnapshotDir;          filepath += gDirUtilp->getDirDelimiter();          filepath += sSnapshotBaseName; - -        if (is_snapshot_name_loc_set) -        { -            filepath += llformat("_%.3d",i); -        } - +        filepath += now.toLocalDateString("_%Y-%m-%d_%H%M%S"); +        filepath += llformat("%.2d", i);          filepath += extension;          llstat stat_info; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e5d0eda766..848aca1390 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -574,7 +574,7 @@ private:      // joint states to be animated      //-------------------------------------------------------------------------      LLPointer<LLJointState> mPelvisState; -    LLCharacter*        mCharacter; +    LLCharacter* mCharacter;  };  /** @@ -677,15 +677,15 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,      mVisuallyMuteSetting(AV_RENDER_NORMALLY),      mMutedAVColor(LLColor4::white /* used for "uninitialize" */),      mFirstFullyVisible(TRUE), -    mFirstUseDelaySeconds(FIRST_APPEARANCE_CLOUD_MIN_DELAY),      mFullyLoaded(FALSE),      mPreviousFullyLoaded(FALSE),      mFullyLoadedInitialized(FALSE), +    mFullyLoadedFrameCounter(0),      mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),      mLoadedCallbacksPaused(FALSE),      mLoadedCallbackTextures(0),      mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)), -    mLastRezzedStatus(-1), +    mLastRezzedStatus(AV_REZZED_UNKNOWN),      mIsEditingAppearance(FALSE),      mUseLocalAppearance(FALSE),      mLastUpdateRequestCOFVersion(-1), @@ -772,11 +772,9 @@ std::string LLVOAvatar::avString() const      {          return getFullname();      } -    else -    { -        std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); -        return " Avatar '" + getFullname() + "' " + viz_string + " "; -    } + +    std::string status = LLVOAvatar::rezStatusToString(getRezzedStatus()); +    return " Avatar '" + getDebugName() + "' " + status + " ";  }  void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) @@ -799,10 +797,10 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c      if (gSavedSettings.getBOOL("DebugAvatarRezTime"))      {          LLSD args; -        args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); -        args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32()); +        args["EXISTENCE"] = llformat("%d", (U32)mDebugExistenceTimer.getElapsedTimeF32()); +        args["TIME"] = llformat("%d", (U32)mRuthDebugTimer.getElapsedTimeF32());          args["NAME"] = getFullname(); -        LLNotificationsUtil::add(notification_name,args); +        LLNotificationsUtil::add(notification_name, args);      }  } @@ -813,14 +811,14 @@ LLVOAvatar::~LLVOAvatar()  {      if (!mFullyLoaded)      { -        debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); +        debugAvatarRezTime("AvatarRezLeftCloudNotification", "left after ruth seconds as cloud");      }      else      { -        debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); +        debugAvatarRezTime("AvatarRezLeftNotification", "left sometime after declouding");      } -    if(mTuned) +    if (mTuned)      {          LLPerfStats::tunedAvatars--;          mTuned = false; @@ -917,14 +915,34 @@ BOOL LLVOAvatar::hasGray() const      return !getIsCloud() && !isFullyTextured();  } -S32 LLVOAvatar::getRezzedStatus() const +ERezzedStatus LLVOAvatar::getRezzedStatus() const  { -    if (getIsCloud()) return 0; -    bool textured = isFullyTextured(); -    if (textured && allBakedTexturesCompletelyDownloaded()) return 3; -    if (textured) return 2; -    llassert(hasGray()); -    return 1; // gray +    if (getIsCloud()) +        return AV_REZZED_CLOUD; +    if (!isFullyTextured()) +        return AV_REZZED_GRAY; +    if (!allBakedTexturesCompletelyDownloaded()) +        return AV_REZZED_TEXTURED; // "downloading" +    return AV_REZZED_FULL; +} + +// static +std::string LLVOAvatar::rezStatusToString(ERezzedStatus rez_status) +{ +    switch (rez_status) +    { +    case AV_REZZED_CLOUD: +        return "cloud"; +    case AV_REZZED_GRAY: +        return "gray"; +    case AV_REZZED_TEXTURED: +        return "downloading"; +    case AV_REZZED_FULL: +        return "full"; +    default: +        ; +    } +    return "unknown";  }  void LLVOAvatar::deleteLayerSetCaches(bool clearAll) @@ -953,15 +971,10 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)  {      BOOL res = TRUE;      grey_avatars = 0; -    for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); -         iter != LLCharacter::sInstances.end(); ++iter) +    for (LLCharacter* character : LLCharacter::sInstances)      { -        LLVOAvatar* inst = (LLVOAvatar*) *iter; -        if( inst->isDead() ) -        { -            continue; -        } -        else if( !inst->isFullyBaked() ) +        LLVOAvatar* inst = (LLVOAvatar*)character; +        if (!inst->isDead() && !inst->isFullyBaked())          {              res = FALSE;              if (inst->mHasGrey) @@ -974,33 +987,6 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)  }  // static -void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts) -{ -    counts.clear(); -    counts.resize(4); -    for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); -         iter != LLCharacter::sInstances.end(); ++iter) -    { -        LLVOAvatar* inst = (LLVOAvatar*) *iter; -        if (inst) -        { -            S32 rez_status = inst->getRezzedStatus(); -            counts[rez_status]++; -        } -    } -} - -// static -std::string LLVOAvatar::rezStatusToString(S32 rez_status) -{ -    if (rez_status==0) return "cloud"; -    if (rez_status==1) return "gray"; -    if (rez_status==2) return "downloading"; -    if (rez_status==3) return "full"; -    return "unknown"; -} - -// static  void LLVOAvatar::dumpBakedStatus()  {      LLVector3d camera_pos_global = gAgentCamera.getCameraPositionGlobal(); @@ -2587,7 +2573,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)          mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0);      } -    LLScopedContextString str("avatar_idle_update " + getFullname()); +    LLScopedContextString str("avatar_idle_update " + getDebugName());      checkTextureLoading() ; @@ -2679,7 +2665,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)          // no need for high frequency          compl_upd_freq = 100;      } -    else if (mLastRezzedStatus <= 0) //cloud or  init +    else if (mLastRezzedStatus <= AV_REZZED_CLOUD) // cloud or initial      {          compl_upd_freq = 60;      } @@ -2687,11 +2673,11 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)      {          compl_upd_freq = 5;      } -    else if (mLastRezzedStatus == 1) //'grey', not fully loaded +    else if (mLastRezzedStatus == AV_REZZED_GRAY) // 'gray', not fully loaded      {          compl_upd_freq = 40;      } -    else if (isInMuteList()) //cheap, buffers value from search +    else if (isInMuteList()) // cheap, buffers value from search      {          compl_upd_freq = 100;      } @@ -2813,7 +2799,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)      LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;      if (LLVOAvatar::sJointDebug)      { -        LL_INFOS() << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL; +        LL_INFOS() << getDebugName() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;      }      LLJoint::sNumUpdates = 0; @@ -3055,17 +3041,17 @@ F32 LLVOAvatar::calcMorphAmount()  void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)  {      // Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync -    if ( voice_enabled -        && mLastRezzedStatus > 0 // no point updating lip-sync for clouds +    if (voice_enabled +        && mLastRezzedStatus > AV_REZZED_CLOUD // no point updating lip-sync for clouds          && (LLVoiceClient::getInstance()->lipSyncEnabled()) -        && LLVoiceClient::getInstance()->getIsSpeaking( mID ) ) +        && LLVoiceClient::getInstance()->getIsSpeaking(mID))      {          F32 ooh_morph_amount = 0.0f;          F32 aah_morph_amount = 0.0f;          mVoiceVisualizer->lipSyncOohAah( ooh_morph_amount, aah_morph_amount ); -        if( mOohMorph ) +        if (mOohMorph)          {              F32 ooh_weight = mOohMorph->getMinWeight()                  + ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight()); @@ -3073,7 +3059,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)              mOohMorph->setWeight( ooh_weight);          } -        if( mAahMorph ) +        if (mAahMorph)          {              F32 aah_weight = mAahMorph->getMinWeight()                  + aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight()); @@ -4165,16 +4151,16 @@ void LLVOAvatar::computeUpdatePeriod()              // impostor camera near clip plane              mUpdatePeriod = 1;          } -        else if ( shouldImpostor(4.0) ) +        else if (shouldImpostor(4.0))          { //background avatars are REALLY slow updating impostors              mUpdatePeriod = UPDATE_RATE_SLOW;          } -        else if (mLastRezzedStatus <= 0) +        else if (mLastRezzedStatus <= AV_REZZED_CLOUD)          {              // Don't update cloud avatars too often              mUpdatePeriod = UPDATE_RATE_SLOW;          } -        else if ( shouldImpostor(3.0) ) +        else if (shouldImpostor(3.0))          { //back 25% of max visible avatars are slow updating impostors              mUpdatePeriod = UPDATE_RATE_MED;          } @@ -4614,7 +4600,7 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent)          is_attachment = cav && cav->mRootVolp && cav->mRootVolp->isAttachment(); // For attached animated objects      } -    LLScopedContextString str("updateCharacter " + getFullname() + " is_control_avatar " +    LLScopedContextString str("updateCharacter " + getDebugName() + " is_control_avatar "                                + boost::lexical_cast<std::string>(is_control_avatar)                                + " is_attachment " + boost::lexical_cast<std::string>(is_attachment)); @@ -6030,8 +6016,11 @@ void LLVOAvatar::resetAnimations()      flushAllMotions();  } -// Override selectively based on avatar sex and whether we're using new -// animations. +//----------------------------------------------------------------------------- +// remapMotionID() +// Override selectively based on avatar sex and whether we're using new animations. +//----------------------------------------------------------------------------- +// virtual  LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)  {      static LLCachedControl<bool> use_new_walk_run(gSavedSettings, "UseNewWalkRun"); @@ -6081,7 +6070,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)      }      return result; -  }  //----------------------------------------------------------------------------- @@ -6089,6 +6077,7 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)  // id is the asset if of the animation to start  // time_offset is the offset into the animation at which to start playing  //----------------------------------------------------------------------------- +// virtual  BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)  {      LL_DEBUGS("Motion") << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; @@ -6111,6 +6100,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)  //-----------------------------------------------------------------------------  // stopMotion()  //----------------------------------------------------------------------------- +// virtual  BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)  {      LL_DEBUGS("Motion") << "Motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; @@ -6150,6 +6140,7 @@ void LLVOAvatar::stopMotionFromSource(const LLUUID& source_id)  //-----------------------------------------------------------------------------  // addDebugText()  //----------------------------------------------------------------------------- +// virtual  void LLVOAvatar::addDebugText(const std::string& text)  {      mDebugText.append(1, '\n'); @@ -6157,8 +6148,22 @@ void LLVOAvatar::addDebugText(const std::string& text)  }  //----------------------------------------------------------------------------- +// getDebugName() +//----------------------------------------------------------------------------- +// virtual +std::string LLVOAvatar::getDebugName() const +{ +#if LL_RELEASE_WITH_DEBUG_INFO +    return getFullname(); +#else +    return getID().asString(); +#endif // LL_RELEASE_WITH_DEBUG_INFO +} + +//-----------------------------------------------------------------------------  // getID()  //----------------------------------------------------------------------------- +// virtual  const LLUUID& LLVOAvatar::getID() const  {      return mID; @@ -6168,6 +6173,7 @@ const LLUUID& LLVOAvatar::getID() const  // getJoint()  //-----------------------------------------------------------------------------  // RN: avatar joints are multi-rooted to include screen-based attachments +// virtual  LLJoint *LLVOAvatar::getJoint( const std::string &name )  {      joint_map_t::iterator iter = mJointMap.find(name); @@ -6283,7 +6289,7 @@ bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const  void LLVOAvatar::clearAttachmentOverrides()  { -    LLScopedContextString str("clearAttachmentOverrides " + getFullname()); +    LLScopedContextString str("clearAttachmentOverrides " + getDebugName());      for (S32 i=0; i<LL_CHARACTER_MAX_ANIMATED_JOINTS; i++)      { @@ -6315,7 +6321,7 @@ void LLVOAvatar::clearAttachmentOverrides()  //-----------------------------------------------------------------------------  void LLVOAvatar::rebuildAttachmentOverrides()  { -    LLScopedContextString str("rebuildAttachmentOverrides " + getFullname()); +    LLScopedContextString str("rebuildAttachmentOverrides " + getDebugName());      LL_DEBUGS("AnimatedObjects") << "rebuilding" << LL_ENDL;      dumpStack("AnimatedObjectsStack"); @@ -6366,7 +6372,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()  // -----------------------------------------------------------------------------  void LLVOAvatar::updateAttachmentOverrides()  { -    LLScopedContextString str("updateAttachmentOverrides " + getFullname()); +    LLScopedContextString str("updateAttachmentOverrides " + getDebugName());      LL_DEBUGS("AnimatedObjects") << "updating" << LL_ENDL;      dumpStack("AnimatedObjectsStack"); @@ -6444,11 +6450,11 @@ void LLVOAvatar::updateAttachmentOverrides()              }          }          pelvis_fixups = mPelvisFixups; -        //dumpArchetypeXML(getFullname() + "_paranoid_updated"); +        //dumpArchetypeXML(getDebugName() + "_paranoid_updated");          // Rebuild and compare          rebuildAttachmentOverrides(); -        //dumpArchetypeXML(getFullname() + "_paranoid_rebuilt"); +        //dumpArchetypeXML(getDebugName() + "_paranoid_rebuilt");          bool mismatched = false;          for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++)          { @@ -6498,7 +6504,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL          return;      } -    LLScopedContextString str("addAttachmentOverridesForObject " + getFullname()); +    LLScopedContextString str("addAttachmentOverridesForObject " + getDebugName());      if (getOverallAppearance() != AOA_NORMAL)      { @@ -6680,21 +6686,21 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const      {          std::stringstream ss;          std::copy(pos_names.begin(), pos_names.end(), std::ostream_iterator<std::string>(ss, ",")); -        LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; +        LL_INFOS() << avString() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL;      }      else      { -        LL_DEBUGS("Avatar") << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; +        LL_DEBUGS("Avatar") << avString() << " no attachment positions defined for any joints" << "\n" << LL_ENDL;      }      if (scale_names.size())      {          std::stringstream ss;          std::copy(scale_names.begin(), scale_names.end(), std::ostream_iterator<std::string>(ss, ",")); -        LL_INFOS() << getFullname() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL; +        LL_INFOS() << getDebugName() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL;      }      else      { -        LL_INFOS() << getFullname() << " no attachment scales defined for any joints" << "\n" << LL_ENDL; +        LL_INFOS() << getDebugName() << " no attachment scales defined for any joints" << "\n" << LL_ENDL;      }      if (!verbose) @@ -8053,10 +8059,10 @@ bool LLVOAvatar::getIsCloud() const              );  } -void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) +void LLVOAvatar::updateRezzedStatusTimers(ERezzedStatus rez_status)  { -    // State machine for rezzed status. Statuses are -1 on startup, 0 -    // = cloud, 1 = gray, 2 = downloading, 3 = full. +    // State machine for rezzed status. +    // Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = full.      // Purpose is to collect time data for each it takes avatar to reach      // various loading landmarks: gray, textured (partial), textured fully. @@ -8064,10 +8070,10 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)      {          LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL; -        if (mLastRezzedStatus == -1 && rez_status != -1) +        if (mLastRezzedStatus == AV_REZZED_UNKNOWN && rez_status != AV_REZZED_UNKNOWN)          {              // First time initialization, start all timers. -            for (S32 i = 1; i < 4; i++) +            for (ERezzedStatus i = AV_REZZED_GRAY; i <= AV_REZZED_FULL; ++(S32&)i)              {                  startPhase("load_" + LLVOAvatar::rezStatusToString(i));                  startPhase("first_load_" + LLVOAvatar::rezStatusToString(i)); @@ -8076,7 +8082,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)          if (rez_status < mLastRezzedStatus)          {              // load level has decreased. start phase timers for higher load levels. -            for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) +            for (ERezzedStatus i = next(rez_status); i <= mLastRezzedStatus; ++(S32&)i)              {                  startPhase("load_" + LLVOAvatar::rezStatusToString(i));              } @@ -8084,12 +8090,12 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)          else if (rez_status > mLastRezzedStatus)          {              // load level has increased. stop phase timers for lower and equal load levels. -            for (S32 i = llmax(mLastRezzedStatus+1,1); i <= rez_status; i++) +            for (ERezzedStatus i = llmax(next(mLastRezzedStatus), AV_REZZED_GRAY); i <= rez_status; ++(S32&)i)              {                  stopPhase("load_" + LLVOAvatar::rezStatusToString(i));                  stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false);              } -            if (rez_status == 3) +            if (rez_status == AV_REZZED_FULL)              {                  // "fully loaded", mark any pending appearance change complete.                  selfStopPhase("update_appearance_from_cof"); @@ -8099,6 +8105,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)                  updateVisualComplexity();              }          } +          mLastRezzedStatus = rez_status;      }  } @@ -8229,18 +8236,18 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse  // returns true if the value has changed.  BOOL LLVOAvatar::updateIsFullyLoaded()  { -    S32 rez_status = getRezzedStatus(); +    ERezzedStatus rez_status = getRezzedStatus();      bool loading = getIsCloud();      if (mFirstFullyVisible && !mIsControlAvatar)      { -        loading = ((rez_status < 2) +        loading = ((rez_status < AV_REZZED_TEXTURED)                     // Wait at least 60s for unfinished textures to finish on first load,                     // don't wait forever, it might fail. Even if it will eventually load by                     // itself and update mLoadedCallbackTextures (or fail and clean the list),                     // avatars are more time-sensitive than textures and can't wait that long.                     || (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)                     || !mPendingAttachment.empty() -                   || (rez_status < 3 && !isFullyBaked()) +                   || (rez_status < AV_REZZED_FULL && !isFullyBaked())                     || hasPendingAttachedMeshes()                    );      } @@ -8280,56 +8287,53 @@ void LLVOAvatar::updateRuthTimer(bool loading)  BOOL LLVOAvatar::processFullyLoadedChange(bool loading)  { -    // We wait a little bit before giving the 'all clear', to let things to -    // settle down (models to snap into place, textures to get first packets). -    // And if viewer isn't aware of some parts yet, this gives them a chance -    // to arrive. -    const F32 LOADED_DELAY = 1.f; -      if (loading)      {          mFullyLoadedTimer.reset(); +        mFullyLoaded = false;      } - -    if (mFirstFullyVisible) +    else if (!mFullyLoaded)      { -        if (!isSelf() && loading) +        // We wait a little bit before giving the 'all clear', to let things to settle down: +        // models to snap into place, textures to get first packets, LODs to load. +        const F32 LOADED_DELAY = 1.f; + +        F32 delay = LOADED_DELAY; +        if (mFirstFullyVisible && !isSelf() && loading)          { -                // Note that textures can causes 60s delay on thier own -                // so this delay might end up on top of textures' delay -                mFirstUseDelaySeconds = llclamp( -                    mFirstAppearanceMessageTimer.getElapsedTimeF32(), -                    FIRST_APPEARANCE_CLOUD_MIN_DELAY, -                    FIRST_APPEARANCE_CLOUD_MAX_DELAY); +            delay = mFirstAppearanceMessageTimer.getElapsedTimeF32(); +            // Note that textures can causes 60s delay on thier own +            // so this delay might end up on top of textures' delay +            delay = llclamp( +                mFirstAppearanceMessageTimer.getElapsedTimeF32(), +                FIRST_APPEARANCE_CLOUD_MIN_DELAY, +                FIRST_APPEARANCE_CLOUD_MAX_DELAY); -                if (shouldImpostor()) -                { -                    // Impostors are less of a priority, -                    // let them stay cloud longer -                    mFirstUseDelaySeconds *= 1.25; -                } +            if (shouldImpostor()) +            { +                // Impostors are less of a priority, +                // let them stay cloud longer +                delay *= 1.25; +            }          } -        mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > mFirstUseDelaySeconds); -    } -    else -    { -        mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY); -    } -    if (!mPreviousFullyLoaded && !loading && mFullyLoaded) -    { -        debugAvatarRezTime("AvatarRezNotification","fully loaded"); +        mFullyLoaded = mFullyLoadedTimer.getElapsedTimeF32() > delay; + +        if (!mPreviousFullyLoaded && !loading && mFullyLoaded) +        { +            debugAvatarRezTime("AvatarRezNotification", "fully loaded"); +        }      }      // did our loading state "change" from last call?      // FIXME runway - why are we updating every 30 calls even if nothing has changed?      // This causes updateLOD() to run every 30 frames, among other things. +    BOOL fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded);      const S32 UPDATE_RATE = 30;      BOOL changed = -        ((mFullyLoaded != mPreviousFullyLoaded) ||         // if the value is different from the previous call -         (!mFullyLoadedInitialized) ||                     // if we've never been called before -         (mFullyLoadedFrameCounter % UPDATE_RATE == 0));   // every now and then issue a change -    BOOL fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded); +        (fully_loaded_changed ||         // if the value is different from the previous call +        !mFullyLoadedInitialized ||                     // if we've never been called before +        (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change      mPreviousFullyLoaded = mFullyLoaded;      mFullyLoadedInitialized = TRUE; @@ -8347,6 +8351,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)          mNeedsImpostorUpdate = TRUE;          mLastImpostorUpdateReason = 6;      } +      return changed;  } @@ -9219,12 +9224,12 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value)  void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,      const LLAppearanceMessageContents& contents)  { -    std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml"); +    std::string outfilename = get_sequential_numbered_file_name(dump_prefix, ".xml");      const std::vector<F32>& params_for_dump = contents.mParamWeights;      const LLTEContents& tec = contents.mTEContents;      LLAPRFile outfile; -    std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); +    std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename);      outfile.open(fullpath, LL_APR_WB );      apr_file_t* file = outfile.getFileHandle();      if (!file) @@ -9341,8 +9346,8 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe      }      else      { -        LL_DEBUGS("Avatar") << "AvatarAppearance msg received without any parameters, object: " << getID() << LL_ENDL; -    } +            LL_DEBUGS("Avatar") << "AvatarAppearance msg received without any parameters, object: " << getID() << LL_ENDL; +        }      LLVisualParam* appearance_version_param = getVisualParam(11000);      if (appearance_version_param) @@ -9397,7 +9402,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )      static LLCachedControl<bool> enable_verbose_dumps(gSavedSettings, "DebugAvatarAppearanceMessage");      static LLCachedControl<bool> block_avatar_appearance_messages(gSavedSettings, "BlockAvatarAppearanceMessages"); -    std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; +    std::string dump_prefix = getDebugName() + (isSelf() ? "_s_" : "_o_");      if (block_avatar_appearance_messages)      {          LL_WARNS() << "Blocking AvatarAppearance message" << LL_ENDL; @@ -10029,17 +10034,13 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara      std::string outprefix(prefix);      if (outprefix.empty())      { -        outprefix = getFullname() + (isSelf()?"_s":"_o"); +        outprefix = getDebugName() + (isSelf() ? "_s" : "_o");      } -    if (outprefix.empty()) -    { -        outprefix = std::string("new_archetype"); -    } -    std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); +    std::string outfilename = get_sequential_numbered_file_name(outprefix, ".xml");      LLAPRFile outfile;      LLWearableType *wr_inst = LLWearableType::getInstance(); -    std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); +    std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename);      if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB ))      {          apr_file_t* file = outfile.getFileHandle(); @@ -10538,7 +10539,7 @@ void LLVOAvatar::updateRiggingInfo()  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; -    LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL; +    LL_DEBUGS("RigSpammish") << getDebugName() << " updating rig tab" << LL_ENDL;      std::vector<LLVOVolume*> volumes; @@ -10576,7 +10577,7 @@ void LLVOAvatar::updateRiggingInfo()      }      //LL_INFOS() << "done update rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; -    LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL; +    LL_DEBUGS("RigSpammish") << getDebugName() << " after update rig tab:" << LL_ENDL;      S32 joint_count, box_count;      showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count);      LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c14784cc6d..bf899dc7d6 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -80,6 +80,15 @@ const F32 MAX_AVATAR_LOD_FACTOR = 1.0f;  extern U32 gFrameCount; +enum ERezzedStatus : S32 +{ +    AV_REZZED_UNKNOWN = -1, +    AV_REZZED_CLOUD = 0, +    AV_REZZED_GRAY = 1, +    AV_REZZED_TEXTURED = 2, // "downloading" +    AV_REZZED_FULL = 3 +}; +  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  // LLVOAvatar  // @@ -231,6 +240,7 @@ public:      virtual void            onActiveOverrideMeshesChanged();      /*virtual*/ const LLUUID&   getID() const; +    /*virtual*/ std::string     getDebugName() const;      /*virtual*/ void            addDebugText(const std::string& text);      /*virtual*/ F32             getTimeDilation();      /*virtual*/ void            getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); @@ -327,22 +337,24 @@ public:      // avatar render cost -    U32             getVisualComplexity()           { return mVisualComplexity;             }; +    U32             getVisualComplexity()           { return mVisualComplexity; };      // surface area calculation -    F32             getAttachmentSurfaceArea()      { return mAttachmentSurfaceArea;        }; +    F32             getAttachmentSurfaceArea()      { return mAttachmentSurfaceArea; }; -    U32             getReportedVisualComplexity()                   { return mReportedVisualComplexity;             };  // Numbers as reported by the SL server -    void            setReportedVisualComplexity(U32 value)          { mReportedVisualComplexity = value;            }; +    U32             getReportedVisualComplexity()   { return mReportedVisualComplexity; };  // Numbers as reported by the SL server +    void            setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; -    S32             getUpdatePeriod()               { return mUpdatePeriod;         }; -    const LLColor4 &  getMutedAVColor()             { return mMutedAVColor;         }; +    S32             getUpdatePeriod()               { return mUpdatePeriod; }; +    const LLColor4 &  getMutedAVColor()             { return mMutedAVColor; };      static void     updateImpostorRendering(U32 newMaxNonImpostorsValue);      void            idleUpdateBelowWater();      static void updateNearbyAvatarCount(); +    static ERezzedStatus next(ERezzedStatus status) { return (ERezzedStatus)++(S32&)status; } +      LLVector3 idleCalcNameTagPosition(const LLVector3 &root_pos_last);      //-------------------------------------------------------------------- @@ -398,11 +410,10 @@ public:      virtual bool    getIsCloud() const;      BOOL            isFullyTextured() const;      BOOL            hasGray() const; -    S32             getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded. -    void            updateRezzedStatusTimers(S32 status); - -    S32             mLastRezzedStatus; +    ERezzedStatus   getRezzedStatus() const; +    void            updateRezzedStatusTimers(ERezzedStatus status); +    ERezzedStatus   mLastRezzedStatus;      void            startPhase(const std::string& phase_name);      void            stopPhase(const std::string& phase_name, bool err_check = true); @@ -422,7 +433,6 @@ protected:  private:      BOOL            mFirstFullyVisible; -    F32             mFirstUseDelaySeconds;      LLFrameTimer    mFirstAppearanceMessageTimer;      BOOL            mFullyLoaded; @@ -708,8 +718,7 @@ public:      BOOL            isFullyBaked();      static BOOL     areAllNearbyInstancesBaked(S32& grey_avatars); -    static void     getNearbyRezzedStats(std::vector<S32>& counts); -    static std::string rezStatusToString(S32 status); +    static std::string rezStatusToString(ERezzedStatus status);      //--------------------------------------------------------------------      // Baked textures @@ -727,7 +736,7 @@ protected:      LLViewerTexLayerSet*  getTexLayerSet(const U32 index) const { return dynamic_cast<LLViewerTexLayerSet*>(mBakedTextureDatas[index].mTexLayerSet);    } -    LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; +    LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList;      BOOL mLoadedCallbacksPaused;      S32 mLoadedCallbackTextures; // count of 'loaded' baked textures, filled from mCallbackTextureList      LLFrameTimer mLastTexCallbackAddedTime; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0a13b7d309..19e2152052 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2233,12 +2233,17 @@ void LLVOAvatarSelf::appearanceChangeMetricsCoro(std::string url)      // Status of all nearby avs including ourself.      msg["nearby"] = LLSD::emptyArray(); -    std::vector<S32> rez_counts; -    LLVOAvatar::getNearbyRezzedStats(rez_counts); -    for (S32 rez_stat = 0; rez_stat < rez_counts.size(); ++rez_stat) + +    S32 status_counts[AV_REZZED_FULL - AV_REZZED_CLOUD + 1] = { 0 }; +    for (LLCharacter* character : LLCharacter::sInstances) +    { +        ERezzedStatus status = ((LLVOAvatar*)character)->getRezzedStatus(); +        ++status_counts[status - AV_REZZED_CLOUD]; +    } +    for (ERezzedStatus status = AV_REZZED_CLOUD; status <= AV_REZZED_FULL; ++(S32&)status)      { -        std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); -        msg["nearby"][rez_status_name] = rez_counts[rez_stat]; +        std::string status_name = LLVOAvatar::rezStatusToString(status); +        msg["nearby"][status_name] = status_counts[status - AV_REZZED_CLOUD];      }      //  std::vector<std::string> bucket_fields("timer_name","is_self","grid_x","grid_y","is_using_server_bake"); diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp index 82a8d48f30..5dafaca031 100644 --- a/indra/newview/llvoicecallhandler.cpp +++ b/indra/newview/llvoicecallhandler.cpp @@ -38,6 +38,11 @@ public:      {      } +    virtual bool canHandleUntrusted(const LLSD ¶ms, const LLSD &query_map, LLMediaCtrl *web, const std::string &nav_type) +    { +        return (nav_type == NAV_TYPE_CLICKED || nav_type == NAV_TYPE_EXTERNAL); +    } +      bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web)      {          //Make sure we have some parameters diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 7ca73a24bf..c1e6becf8d 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -383,6 +383,12 @@ void LLVoiceChannel::resume()          {              if (sSuspendedVoiceChannel)              { +                if (sSuspendedVoiceChannel->callStarted()) +                { +                    // should have channel data already, restart +                    sSuspendedVoiceChannel->setState(STATE_READY); +                } +                // won't do anything if call is already started                  sSuspendedVoiceChannel->activate();              }              else diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 2459f8cd58..0c93331804 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1430,7 +1430,7 @@ BOOL LLVOVolume::calcLOD()              const LLVector3* box = avatar->getLastAnimExtents();              LLVector3 diag = box[1] - box[0];              radius = diag.magVec() * 0.5f; -            LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; +            LL_DEBUGS("DynamicBox") << avatar->getDebugName() << " diag " << diag << " radius " << radius << LL_ENDL;          }          else          { @@ -1441,7 +1441,7 @@ BOOL LLVOVolume::calcLOD()              const LLVector3* box = avatar->getLastAnimExtents();              LLVector3 diag = box[1] - box[0];              radius = diag.magVec(); // preserve old BinRadius behavior - 2x off -            LL_DEBUGS("DynamicBox") << avatar->getFullname() << " diag " << diag << " radius " << radius << LL_ENDL; +            LL_DEBUGS("DynamicBox") << avatar->getDebugName() << " diag " << diag << " radius " << radius << LL_ENDL;          }          if (distance <= 0.f || radius <= 0.f)          { @@ -1508,11 +1508,16 @@ BOOL LLVOVolume::calcLOD()      mLODAdjustedDistance = distance; +    static LLCachedControl<S32> debug_selection_lods(gSavedSettings, "DebugSelectionLODs", 0);      if (isHUDAttachment())      {          // HUDs always show at highest detail          cur_detail = 3;      } +    else if (isSelected() && debug_selection_lods() >= 0) +    { +        cur_detail = llmin(debug_selection_lods(), 3); +    }      else      {          cur_detail = computeLODDetail(ll_round(distance, 0.01f), ll_round(radius, 0.01f), lod_factor); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 44a964a363..ee1e3cda73 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -306,7 +306,7 @@ public:      BOOL isReflectionProbe() const override;      F32 getReflectionProbeAmbiance() const;      F32 getReflectionProbeNearClip() const; -    bool getReflectionProbeIsBox() const; +    bool getReflectionProbeIsBox() const override;      bool getReflectionProbeIsDynamic() const;      bool getReflectionProbeIsMirror() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d22206ca98..bc713c4457 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -10237,7 +10237,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar, bool      result.clear();      grabReferences(result); -    if (!avatar || !avatar->mDrawable) +    if (!avatar || avatar->isDead() || !avatar->mDrawable)      {          LL_WARNS_ONCE("AvatarRenderPipeline") << "Avatar is " << (avatar ? "not drawable" : "null") << LL_ENDL;          return; diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index a9e7626dc5..486d604e9f 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -31,7 +31,6 @@ Sichtweite: [DRAW_DISTANCE] m  Bandbreite: [NET_BANDWITH] kbit/s  LOD-Faktor: [LOD_FACTOR]  Darstellungsqualität: [RENDER_QUALITY] -Erweitertes Beleuchtungsmodell: [GPU_SHADERS]  Texturspeicher: [TEXTURE_MEMORY] MB</string>  	<string name="AboutOSXHiDPI">HiDPI-Anzeigemodus: [HIDPI]</string>  	<string name="AboutLibs">J2C-Decoderversion: [J2C_VERSION] diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml deleted file mode 100644 index 6c3214a76d..0000000000 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ /dev/null @@ -1,421 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater - legacy_header_height="18" - height="340" - layout="topleft" - name="item properties" - help_topic="item_properties" - save_rect="true" - title="INVENTORY ITEM PROPERTIES" - width="350"> -    <floater.string -     name="unknown"> -        (unknown) -    </floater.string> -    <floater.string -     name="public"> -        (public) -    </floater.string> -    <floater.string -     name="you_can"> -        You can: -    </floater.string> -    <floater.string -     name="owner_can"> -        Owner can: -    </floater.string> -    <floater.string -     name="acquiredDate"> -        [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] -    </floater.string> -    <icon -     follows="top|right" -     height="18" -     image_name="Lock" -     layout="topleft" -     left="276" -     mouse_opaque="true" -     name="IconLocked" -     top="4" -     width="18" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left="10" -     name="LabelItemNameTitle" -     top="25" -     width="78"> -        Name: -    </text> -    <line_editor -     border_style="line" -     border_thickness="1" -     follows="left|top|right" -     height="16" -     layout="topleft" -     left_delta="78" -     max_length_bytes="63" -     name="LabelItemName" -     top_delta="0" -     width="252" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left="10" -     name="LabelItemDescTitle" -     top="45" -     width="78"> -        Description: -    </text> -    <line_editor -     border_style="line" -     border_thickness="1" -     follows="left|top|right" -     height="16" -     layout="topleft" -     left_delta="78" -     max_length_bytes="127" -     name="LabelItemDesc" -     top_delta="0" -     width="252" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="16" -     layout="topleft" -     left="10" -     name="LabelCreatorTitle" -     top="65" -     width="78"> -        Creator: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="16" -     layout="topleft" -     left_delta="78" -     name="LabelCreatorName" -     top_delta="0" -     translate="false" -     use_ellipses="true"  -     width="170"> -        TestString PleaseIgnore -    </text> -    <button -     follows="top|right" -     height="16" -     label="Profile..." -     layout="topleft" -     left_delta="174" -     name="BtnCreator" -     top_delta="0" -     width="78" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="16" -     layout="topleft" -     left="10" -     name="LabelOwnerTitle" -     top="85" -     width="78"> -        Owner: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="16" -     layout="topleft" -     left_delta="78" -     name="LabelOwnerName" -     top_delta="0" -     translate="false" -     use_ellipses="true" -     width="170"> -      TestString PleaseIgnore -    </text> -    <button -     follows="top|right" -     height="16" -     label="Profile..." -     layout="topleft" -     left_delta="174" -     name="BtnOwner" -     top_delta="0" -     width="78" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="16" -     layout="topleft" -     left="10" -     name="LabelAcquiredTitle" -     top="105" -     width="78"> -        Acquired: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="16" -     layout="topleft" -     left_delta="78" -     name="LabelAcquiredDate" -     top_delta="0" -     width="252"> -        Wed May 24 12:50:46 2006 -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left="10" -     name="OwnerLabel" -     top="125" -     width="78"> -        You: -    </text> -    <check_box -     height="16" -     label="Edit" -     layout="topleft" -     left_pad="5" -     name="CheckOwnerModify" -     top_delta="0" -     width="78" /> -    <check_box -     height="16" -     label="Copy" -     layout="topleft" -     left_delta="0" -     name="CheckOwnerCopy" -     top_pad="5" -     width="88" /> -    <check_box -     height="16" -     label="Resell" -     layout="topleft" -     left_delta="0" -     name="CheckOwnerTransfer" -     top_pad="5" -     width="106" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left="10" -     name="AnyoneLabel" -     top_pad="5" -     width="78"> -        Anyone: -    </text> -    <check_box -     height="16" -     label="Copy" -     layout="topleft" -     left_pad="5" -     name="CheckEveryoneCopy" -     top_delta="0" -     width="130" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left="10" -     name="GroupLabel" -     top_pad="5" -     width="78"> -        Group: -    </text> -    <check_box -     height="16" -     label="Share" -     layout="topleft" -     left_pad="5" -     name="CheckShareWithGroup" -     top_delta="5" -     width="106" /> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="25" -     layout="topleft" -     left="10" -     name="NextOwnerLabel" -     top_pad="5" -     width="78" -     word_wrap="true"> -        Next owner: -    </text> -    <check_box -     height="16" -     label="Edit" -     layout="topleft" -     left_pad="5" -     name="CheckNextOwnerModify" -     top_delta="0" -     width="78" /> -    <check_box -     height="16" -     label="Copy" -     layout="topleft" -     left_delta="0" -     name="CheckNextOwnerCopy" -     top_pad="5" -     width="88" /> -    <check_box -     height="16" -     label="Resell" -     layout="topleft" -     left_delta="0" -     name="CheckNextOwnerTransfer" -     top_pad="5" -     width="106" /> -    <check_box -     height="16" -     label="For Sale" -     layout="topleft" -     left="10" -     name="CheckPurchase" -     top_pad="5" -     width="78" /> -     <combo_box -     height="19" -     left_pad="5" -     layout="topleft" -     follows="left|top" -     name="ComboBoxSaleType" -     width="110"> -       <combo_box.item -         name="Copy" -         label="Copy" -         value="2" /> -       <combo_box.item -         name="Contents" -         label="Contents" -         value="3" /> -       <combo_box.item -         name="Original" -         label="Original" -         value="1" /> -    </combo_box> -    <spinner -        follows="left|top" -        decimal_digits="0" -        increment="1" -        name="Edit Cost" -        label="Price:" -        label_width="100" -        left="10" -        width="192" -        min_val="1" -        height="19" -        max_val="999999999" -        top_pad="5"/> -    <text -        type="string" -        length="1" -        height="15" -        follows="left|top" -        layout="topleft" -        left_delta="82" -        name="CurrencySymbol" -        top_delta="1" -        width="18"> -      L$ -    </text> - -    <!--line_editor -     border_style="line" -     border_thickness="1" -     follows="left|top|right" -     height="16" -     layout="topleft" -     left_pad="5" -     max_length_bytes="25" -     name="EditPrice" -     top_delta="0" -     width="242" /--> - -    <!--text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left="10" -     name="BaseMaskDebug" -     top="155" -     width="330"> -        B: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left_delta="60" -     name="OwnerMaskDebug" -     top_delta="0" -     width="270"> -        O: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left_delta="60" -     name="GroupMaskDebug" -     top_delta="0" -     width="210"> -        G: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left_delta="60" -     name="EveryoneMaskDebug" -     top_delta="0" -     width="150"> -        E: -    </text> -    <text -     type="string" -     length="1" -     follows="left|top" -     height="10" -     layout="topleft" -     left_delta="60" -     name="NextMaskDebug" -     top_delta="0" -     width="90"> -        N: -    </text--> - -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_object_weights.xml b/indra/newview/skins/default/xui/en/floater_object_weights.xml index 5e4b017590..709fbdd27e 100644 --- a/indra/newview/skins/default/xui/en/floater_object_weights.xml +++ b/indra/newview/skins/default/xui/en/floater_object_weights.xml @@ -2,7 +2,7 @@  <floater   can_close="true"   can_tear_off="false" - height="289" + height="372"   help_topic="object_weights"   layout="topleft"   name="object_weights" @@ -13,6 +13,21 @@      <floater.string       name="nothing_selected"       value="--"/> +    <floater.string +     name="lowest_lod" +     value="Lowest"/> +    <floater.string +     name="low_lod" +     value="Low"/> +    <floater.string +     name="medium_lod" +     value="Medium"/> +    <floater.string +     name="high_lod" +     value="High"/> +    <floater.string +     name="multiple_lods" +     value="Multiple"/>      <text       follows="left|top" @@ -320,4 +335,97 @@       top_delta="0"       value="Total capacity"       width="130" /> + + +    <text +     follows="left|top" +     height="16" +     layout="topleft" +     left="10" +     name="rendering_info_text" +     text_color="EmphasisColor" +     top_pad="10" +     value="RENDERING INFO" +     width="180" /> +    <text +     follows="left|top" +     halign="right" +     height="16" +     layout="topleft" +     left="10" +     name="lod_level" +     top_pad="3" +     value="--" +     width="40" /> +    <loading_indicator +     follows="left|top" +     height="16" +     layout="topleft" +     left="34" +     name="lod_level_loading_indicator" +     top_delta="0" +     width="16" /> +    <text +     follows="left|top" +     height="16" +     layout="topleft" +     left_pad="10" +     name="lod_level_label" +     top_delta="0" +     value="LOD (Level of detail)" +     width="130" /> +    <text +     follows="left|top" +     halign="right" +     height="16" +     layout="topleft" +     left="10" +     name="triangles_shown" +     top_pad="3" +     value="--" +     width="40" /> +    <loading_indicator +     follows="left|top" +     height="16" +     layout="topleft" +     left="34" +     name="triangles_shown_loading_indicator" +     top_delta="0" +     width="16" /> +    <text +     follows="left|top" +     height="16" +     layout="topleft" +     left_pad="10" +     name="triangles_shown_label" +     top_delta="0" +     value="Triangles Shown" +     width="130" /> +    <text +     follows="left|top" +     halign="right" +     height="16" +     layout="topleft" +     left="10" +     name="pixel_area" +     top_pad="3" +     value="--" +     width="40" /> +    <loading_indicator +     follows="left|top" +     height="16" +     layout="topleft" +     left="34" +     name="pixel_area_loading_indicator" +     top_delta="0" +     width="16" /> +    <text +     follows="left|top" +     height="16" +     layout="topleft" +     left_pad="10" +     name="pixel_area_label" +     top_delta="0" +     value="Pixel Area" +     width="130" />  </floater> diff --git a/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml b/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml index 51809793d3..c0d260ef59 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml @@ -22,7 +22,7 @@  		increment="0.025"  		initial_value="0.5"  		label="Voice Chat" -		label_width="50" +		label_width="60"  		layout="topleft"  		left="15"  		top="50" diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml index 929c626947..3c2c581d2c 100644 --- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml @@ -503,6 +503,136 @@         function="Inventory.CanSetUploadLocation" />      </menu_item_call>    </menu> +  <menu +   label="Upload to folder" +   layout="topleft" +   name="upload_options"> +    <menu_item_call +     label="Image..." +     layout="topleft" +     name="Upload Image"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_texture" /> +       <menu_item_call.on_enable +        function="File.EnableUpload" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Upload Image,texture" /> +    </menu_item_call> +    <menu_item_call +     label="Sound (L$[COST])..." +     layout="topleft" +     name="Upload Sound"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_sound" /> +       <menu_item_call.on_enable +        function="File.EnableUpload" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Upload Sound,sound" /> +    </menu_item_call> +    <menu_item_call +     label="Animation (L$[COST])..." +     layout="topleft" +     name="Upload Animation"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_animation" /> +       <menu_item_call.on_enable +        function="File.EnableUpload" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Upload Animation,animation" /> +    </menu_item_call> +    <menu_item_call +     label="Model..." +     layout="topleft" +     name="Upload Model"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_model" /> +       <menu_item_call.on_enable +        function="File.EnableUploadModel" /> +       <menu_item_call.on_visible +        function="File.VisibleUploadModel"/> +    </menu_item_call> +    <menu_item_call +     label="Material..." +     layout="topleft" +     name="Upload Material"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_pbr_material" /> +       <menu_item_call.on_enable +        function="File.EnableUploadMaterial" /> +    </menu_item_call> +    <menu_item_call +     label="Bulk..." +     layout="topleft" +     name="Bulk Upload"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_bulk" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Bulk Upload,texture" /> +    </menu_item_call> +  </menu> +  <menu +   label="Use as default for" +   layout="topleft" +   name="upload_def"> +    <menu_item_call +     label="Image uploads" +     layout="topleft" +     name="Image uploads"> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +        parameter="def_texture" /> +      <menu_item_call.on_visible +       function="Inventory.CanSetUploadLocation" /> +    </menu_item_call> +    <menu_item_call +     label="Sound uploads" +     layout="topleft" +     name="Sound uploads"> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_sound" /> +      <menu_item_call.on_visible +       function="Inventory.CanSetUploadLocation" /> +    </menu_item_call> +    <menu_item_call +     label="Animation uploads" +     layout="topleft" +     name="Animation uploads"> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_animation" /> +      <menu_item_call.on_visible +       function="Inventory.CanSetUploadLocation" /> +    </menu_item_call> +    <menu_item_call +     label="Model uploads" +     layout="topleft" +     name="Model uploads"> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_model" /> +      <menu_item_call.on_visible +       function="Inventory.CanSetUploadLocation" /> +    </menu_item_call> +    <menu_item_call +     label="PBR material uploads" +     layout="topleft" +     name="PBR uploads"> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_pbr_material" /> +    </menu_item_call> +  </menu>  	<menu_item_separator  	 layout="topleft"  	 name="Marketplace Separator" /> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 47de849522..de2326165e 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -968,6 +968,83 @@       parameter="remove_from_favorites" />    </menu_item_call>    <menu +   label="Upload to folder" +   layout="topleft" +   name="upload_options"> +    <menu_item_call +     label="Image..." +     layout="topleft" +     name="Upload Image"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_texture" /> +       <menu_item_call.on_enable +        function="File.EnableUpload" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Upload Image,texture" /> +    </menu_item_call> +    <menu_item_call +     label="Sound (L$[COST])..." +     layout="topleft" +     name="Upload Sound"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_sound" /> +       <menu_item_call.on_enable +        function="File.EnableUpload" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Upload Sound,sound" /> +    </menu_item_call> +    <menu_item_call +     label="Animation (L$[COST])..." +     layout="topleft" +     name="Upload Animation"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_animation" /> +       <menu_item_call.on_enable +        function="File.EnableUpload" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Upload Animation,animation" /> +    </menu_item_call> +    <menu_item_call +     label="Model..." +     layout="topleft" +     name="Upload Model"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_model" /> +       <menu_item_call.on_enable +        function="File.EnableUploadModel" /> +       <menu_item_call.on_visible +        function="File.VisibleUploadModel"/> +    </menu_item_call> +    <menu_item_call +     label="Material..." +     layout="topleft" +     name="Upload Material"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_pbr_material" /> +       <menu_item_call.on_enable +        function="File.EnableUploadMaterial" /> +    </menu_item_call> +    <menu_item_call +     label="Bulk..." +     layout="topleft" +     name="Bulk Upload"> +       <menu_item_call.on_click +        function="Inventory.FileUploadLocation" +        parameter="upload_bulk" /> +       <menu_item_call.on_visible +        function="Upload.CalculateCosts" +        parameter="Bulk Upload,texture" /> +    </menu_item_call> +  </menu> +  <menu     label="Use as default for"     layout="topleft"     name="upload_def"> @@ -977,39 +1054,39 @@       name="Image uploads">        <menu_item_call.on_click         function="Inventory.FileUploadLocation" -        parameter="texture" /> +       parameter="def_texture" />      </menu_item_call>      <menu_item_call       label="Sound uploads"       layout="topleft"       name="Sound uploads"> -    <menu_item_call.on_click -     function="Inventory.FileUploadLocation" -     parameter="sound" /> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_sound" />      </menu_item_call>      <menu_item_call       label="Animation uploads"       layout="topleft"       name="Animation uploads"> -    <menu_item_call.on_click -     function="Inventory.FileUploadLocation" -     parameter="animation" /> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_animation" />      </menu_item_call>      <menu_item_call       label="Model uploads"       layout="topleft"       name="Model uploads"> -    <menu_item_call.on_click -     function="Inventory.FileUploadLocation" -     parameter="model" /> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_model" />      </menu_item_call>      <menu_item_call       label="PBR material uploads"       layout="topleft"       name="PBR uploads"> -        <menu_item_call.on_click -         function="Inventory.FileUploadLocation" -         parameter="pbr_material" /> +      <menu_item_call.on_click +       function="Inventory.FileUploadLocation" +       parameter="def_pbr_material" />      </menu_item_call>    </menu>  	<menu_item_separator diff --git a/indra/newview/skins/default/xui/en/menu_settings_gear.xml b/indra/newview/skins/default/xui/en/menu_settings_gear.xml index 57f4aa8655..96cbac4478 100644 --- a/indra/newview/skins/default/xui/en/menu_settings_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_settings_gear.xml @@ -24,6 +24,9 @@          <menu_item_call.on_click                   function="MyEnvironments.DoApply"                  parameter="local" /> +      <menu_item_call.on_enable +              function="MyEnvironments.CanApply" +              parameter="local"/>      </menu_item_call>      <menu_item_call              name="Settings Apply Parcel" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index f3d44cf647..bc1fed3af8 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1598,7 +1598,65 @@ function="World.EnvPreset"               function="ToggleControl"               parameter="RenderDisablePostProcessing" />            </menu_item_check> -           + + +          <menu +           create_jump_keys="true" +           label="Selection level of detail" +           name="Selection level of detail" +           tear_off="true"> + +              <menu_item_check +                label="Default" +                name="Default lod setting"> +                  <menu_item_check.on_check +                   function="Tools.ToolsCheckSelectionLODMode" +                   parameter="default" /> +                  <menu_item_check.on_click +                   function="Tools.SelectionLODMode" +                   parameter="default" /> +              </menu_item_check> +              <menu_item_check +                label="High" +                name="High lod setting"> +                  <menu_item_check.on_check +                   function="Tools.ToolsCheckSelectionLODMode" +                   parameter="high" /> +                  <menu_item_check.on_click +                   function="Tools.SelectionLODMode" +                   parameter="high" /> +              </menu_item_check> +              <menu_item_check +                label="Medium" +                name="Medium lod setting"> +                  <menu_item_check.on_check +                   function="Tools.ToolsCheckSelectionLODMode" +                   parameter="medium" /> +                  <menu_item_check.on_click +                   function="Tools.SelectionLODMode" +                   parameter="medium" /> +              </menu_item_check> +              <menu_item_check +                label="Low" +                name="Low lod setting"> +                  <menu_item_check.on_check +                   function="Tools.ToolsCheckSelectionLODMode" +                   parameter="low" /> +                  <menu_item_check.on_click +                   function="Tools.SelectionLODMode" +                   parameter="low" /> +              </menu_item_check> +              <menu_item_check +                label="Lowest" +                name="Lowest lod setting"> +                  <menu_item_check.on_check +                   function="Tools.ToolsCheckSelectionLODMode" +                   parameter="lowest" /> +                  <menu_item_check.on_click +                   function="Tools.SelectionLODMode" +                   parameter="lowest" /> +              </menu_item_check> +          </menu>          <menu_item_separator/>                  <menu_item_check diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b9d0ef0cc7..2691bbcbe4 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3100,9 +3100,13 @@ Would you be my friend?        <input name="listname" type="text"/>        <button         default="true" -       index="0" +       index="1"         name="SetName"         text="OK"/> +      <button +       index="0" +       name="Cancel" +       text="Cancel"/>      </form>    </notification> @@ -3131,6 +3135,29 @@ Would you be my friend?    <notification     icon="alertmodal.tga" +   label="Rename Auto-Replace List" +   name="RemoveAutoReplaceList" +   type="alertmodal"> +'[LIST_NAME]' contains [MAP_SIZE] entries. +     +Are you sure you want to delete this list? +      <tag>confirm</tag> +    <form name="form"> +      <button +       default="true" +       index="1" +       name="DeleteList" +       text="Delete"/> +      <button +       default="false" +       index="0" +       name="Cancel" +       text="Cancel"/> +    </form> +  </notification> + +    <notification +   icon="alertmodal.tga"     name="InvalidAutoReplaceEntry"     type="alertmodal">      The keyword must be a single word, and the replacement may not be empty. @@ -4575,13 +4602,12 @@ You already have blocked this name.    <notification     icon="alert.tga" -   name="RemoveItemWarn" +   name="CantModifyContentInNoModTask"     type="alert"> -Though permitted, deleting contents may damage the object. Do you want to delete that item? -    <tag>confirm</tag> +You don't have permission to modify content of this object +      <tag>confirm</tag>      <usetemplate -     name="okcancelbuttons" -     notext="Cancel" +     name="okbutton"       yestext="OK"/>    </notification> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml index a8a306bea9..9586957694 100644 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml @@ -21,5 +21,5 @@      border="false"      bevel_style="none"      show_item_link_overlays="true"> -    <item allow_wear="false"/> +    <item marketplace_item="true"/>   </inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml index 0c665fb07e..5f64a5d47a 100644 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml @@ -20,5 +20,5 @@      border="false"      bevel_style="none"      show_item_link_overlays="true"> -    <item allow_wear="false"/> +    <item marketplace_item="true"/>  </inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml index 0be405c5b8..ab4d836ba9 100644 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml @@ -19,5 +19,5 @@      border="false"      bevel_style="none"      show_item_link_overlays="true"> -    <item allow_wear="false"/> +    <item marketplace_item="true"/>  </inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml index 58122db7f4..303601e65b 100644 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml @@ -20,5 +20,5 @@      border="false"      bevel_style="none"      show_item_link_overlays="true"> -    <item allow_wear="false"/> +    <item marketplace_item="true"/>  </inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml index 0412466b4f..4aafceb112 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -113,7 +113,7 @@     control_name="ArrowKeysAlwaysMove"     follows="left|top"     height="20" -   label="Arrow keys always move me" +   label="Arrow keys always move me while in chat"     layout="topleft"     left_delta="5"     name="arrow_keys_move_avatar_check" diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml index bd68434aab..34b48574d5 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml @@ -248,29 +248,13 @@          </layout_panel>          <layout_panel -                name="moon_layout" -                border="false" +                border="true"                  bevel_style="in" +                name="moon_layout"                  auto_resize="true"                  user_resize="false"                  visible="true"                  height="400"> -            <layout_stack  -                    name="moon_stack" -                    left="5" -                    top="5" -                    right="-5" -                    bottom="-5" -                    follows="left|top|right|bottom" -                    orientation="vertical"> -                <layout_panel -                        border="true" -                        bevel_style="in" -                        auto_resize="true" -                        user_resize="false" -                        visible="true" -                        name="moon_layout" -                        height="220">                      <text                              name="moon_label"                              follows="left|top" @@ -423,9 +407,7 @@                          name="moonbeacon"                           top_pad="5"                          left_delta="-8"/> -                             -                </layout_panel> -            </layout_stack> +          </layout_panel>      </layout_stack>  </panel>                 diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml index 5e65b0e8a2..36ec0cb3ea 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_water.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml @@ -247,7 +247,7 @@                          Reflection Wavelet Scale                      </text>                      <slider -                            decimal_digits="1" +                            decimal_digits="2"                              follows="left|top"                              increment="0.01"                              height="16" @@ -261,7 +261,7 @@                              width="150"                              can_edit_text="true"/>                      <slider -                            decimal_digits="1" +                            decimal_digits="2"                              follows="left|top"                              increment="0.01"                              initial_value="0.7" @@ -274,7 +274,7 @@                              width="150"                              can_edit_text="true"/>                      <slider -                            decimal_digits="1" +                            decimal_digits="2"                              follows="left|top"                              increment="0.01"                              initial_value="0.7" diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index cd8e7687ae..9fcfc2daa5 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -29,7 +29,6 @@ Distancia de dibujo: [DRAW_DISTANCE]m  Ancho de banda: [NET_BANDWITH]kbit/s  Factor LOD: [LOD_FACTOR]  Calidad de renderización: [RENDER_QUALITY] -Modelo de iluminación avanzado: [GPU_SHADERS]  Memoria de textura: [TEXTURE_MEMORY]MB</string>  	<string name="AboutOSXHiDPI">Modo de visualización HiDPi: [HIDPI]</string>  	<string name="AboutLibs">Versión de descodificador J2C: [J2C_VERSION]  diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 0a3fbeb603..55f6209fe1 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -32,7 +32,6 @@ Distance de dessin : [DRAW_DISTANCE]m  Bande passante : [NET_BANDWITH] kbit/s  Facteur LOD (niveau de détail) : [LOD_FACTOR]  Qualité de rendu : [RENDER_QUALITY] -Modèle d’éclairage avancé : [GPU_SHADERS]  Mémoire textures : [TEXTURE_MEMORY] Mo</string>  	<string name="AboutOSXHiDPI">Mode d'affichage HiDPI : [HIDPI]</string>  	<string name="AboutLibs">J2C Decoder Version: [J2C_VERSION]  diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index 178bb90ca6..f77ab1062a 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -31,7 +31,6 @@ Distanza visualizzazione: [DRAW_DISTANCE]m  Larghezza banda: [NET_BANDWITH]kbit/s  Fattore livello di dettaglio: [LOD_FACTOR]  Qualità di rendering: [RENDER_QUALITY] -Modello illuminazione avanzato: [GPU_SHADERS]  Memoria texture: [TEXTURE_MEMORY]MB</string>  	<string name="AboutOSXHiDPI">Modalità display HiDPI: [HIDPI]</string>  	<string name="AboutLibs">J2C Versione decoder: [J2C_VERSION]  diff --git a/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml index f8837c40a7..844a556af1 100644 --- a/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml +++ b/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml @@ -44,8 +44,6 @@  			<check_box label="ビーコンを表示" name="sunbeacon"/>  		</layout_panel>  		<layout_panel name="moon_layout"> -			<layout_stack name="moon_stack"> -				<layout_panel name="moon_layout">  					<text name="moon_label">  						月  					</text> @@ -74,8 +72,6 @@  					</text>  					<slider name="moon_brightness"/>  					<check_box label="ビーコンを表示" name="moonbeacon"/> -				</layout_panel> -			</layout_stack>  		</layout_panel>  	</layout_stack>  </panel> diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index fa6c329fe7..71f7c1a034 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -66,7 +66,6 @@ SLURL:<nolink>[SLURL]</nolink>  帯域幅:[NET_BANDWITH]kbit/秒  LOD係数:[LOD_FACTOR]  描画の質:[RENDER_QUALITY] -高度な光源モデル:[GPU_SHADERS]  テクスチャメモリ:[TEXTURE_MEMORY]㎆  	</string>  	<string name="AboutOSXHiDPI"> diff --git a/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml index f807148617..7f9dee2369 100644 --- a/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml +++ b/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml @@ -35,8 +35,6 @@  			<check_box label="Pokaż emiter" name="sunbeacon" />  		</layout_panel>  		<layout_panel name="moon_layout"> -			<layout_stack name="moon_stack"> -				<layout_panel name="moon_layout">  					<text name="moon_label">  						Księżyc  					</text> @@ -59,8 +57,6 @@  						Jasność:  					</text>  					<check_box label="Pokaż emiter" name="moonbeacon" /> -				</layout_panel> -			</layout_stack>  		</layout_panel>  	</layout_stack>  </panel>                 diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 26ec6cc9dc..8032443020 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -49,7 +49,6 @@ Pole widzenia (Draw Distance): [DRAW_DISTANCE]m  Przepustowość (Bandwidth): [NET_BANDWITH]kbit/s  Mnożnik poziomu detali (LOD Factor): [LOD_FACTOR]  Jakość wyświetlania (Render quality): [RENDER_QUALITY] -Zaawansowane oświetlenie (Advanced Lighting Model): [GPU_SHADERS]  Pamięć tekstur (Texture memory): [TEXTURE_MEMORY]MB  Pamięć podręczna dysku (Disk cache): [DISK_CACHE_INFO]  	</string> diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 6db5da2e89..4ce1e6d2ec 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -29,7 +29,6 @@ Estabelecer a distância: [DRAW_DISTANCE]m  Largura da banda: [NET_BANDWITH]kbit/s  LOD fator: [LOD_FACTOR]  Qualidade de renderização: [RENDER_QUALITY] -Modelo avançado de luzes: [GPU_SHADERS]  Memória de textura: [TEXTURE_MEMORY]MB</string>  	<string name="AboutOSXHiDPI">HiDPI modo de exibição: [HIDPI]</string>  	<string name="AboutLibs">Versão do J2C Decoder: [J2C_VERSION]  diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 61d836a2d1..0079309ba2 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -69,7 +69,6 @@ SLURL: <nolink>[SLURL]</nolink>  Ширина канала: [NET_BANDWITH] кбит/с  Коэффициент детализации: [LOD_FACTOR]  Качество визуализации: [RENDER_QUALITY] -Расширенная модель освещения: [GPU_SHADERS]  Память текстур: [TEXTURE_MEMORY] МБ  	</string>  	<string name="AboutOSXHiDPI"> diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index e709a4c5d6..fa2fd3a802 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -69,7 +69,6 @@ UI Ölçeklendirme: [UI_SCALE]  Bant genişliği: [NET_BANDWITH]kbit/s  LOD faktörü: [LOD_FACTOR]  İşleme kalitesi: [RENDER_QUALITY] -Gelişmiş Aydınlatma Modeli: [GPU_SHADERS]  Doku belleği: [TEXTURE_MEMORY]MB  	</string>  	<string name="AboutOSXHiDPI"> diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml index bdb16c9bf1..d053d2b30d 100644 --- a/indra/newview/skins/default/xui/zh/strings.xml +++ b/indra/newview/skins/default/xui/zh/strings.xml @@ -69,7 +69,6 @@  頻寬:[NET_BANDWITH]千位元/秒  細節層次率:[LOD_FACTOR]  呈像品質:[RENDER_QUALITY] -進階照明模型:[GPU_SHADERS]  材質記憶體:[TEXTURE_MEMORY]MB  	</string>  	<string name="AboutOSXHiDPI"> diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 278de5f31c..8dfba05d15 100644 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -43,23 +43,6 @@ namespace LLStatViewer      LLTrace::SampleStatHandle<>     FPS_SAMPLE("fpssample");  } -void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts) -{ -    counts.resize(3); -    counts[0] = 0; -    counts[1] = 0; -    counts[2] = 1; -} - -// static -std::string LLVOAvatar::rezStatusToString(S32 rez_status) -{ -    if (rez_status==0) return "cloud"; -    if (rez_status==1) return "gray"; -    if (rez_status==2) return "textured"; -    return "unknown"; -} -  // static  LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name)  { | 
