diff --git a/autobuild.xml b/autobuild.xml index 9c93704b6..b3f547659 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1866,11 +1866,11 @@ archive hash - 6d832d5ed191e61c7aec6d8a10bb3062 + 0e7613b2e038e18488452c2a9882144d hash_algorithm md5 url - http://depot.alchemyviewer.org/pub/linux64/lib-trusty/llceflib-3.2623.1395.g3034273-linux64-201603262117.tar.bz2 + http://depot.alchemyviewer.org/pub/linux64/lib-trusty/llceflib-3.2526.1373.gb660893-linux64-201603281900.tar.bz2 name linux64 @@ -1905,7 +1905,7 @@ version - 3.2623.1395.g3034273 + 3.2526.1373.gb660893 llphysicsextensions_stub diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 517462941..4e1e6cb49 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -308,11 +308,13 @@ if (STANDALONE) else (STANDALONE) set(${ARCH}_linux_INCLUDES atk-1.0 + cairo glib-2.0 gdk-pixbuf-2.0 gstreamer-0.10 gtk-2.0 pango-1.0 + pixman-1 ) endif (STANDALONE) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 7f27a03d9..20c1e9787 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -19,7 +19,11 @@ else (STANDALONE) set(NDOF_LIBRARY ndofdev) endif (WINDOWS) - set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev) + if (WINDOWS) + set(NDOF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) + else (WINDOWS) + set(NDOF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/ndofdev) + endif (WINDOWS) set(NDOF_FOUND 1) endif (STANDALONE) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index f58915934..a6ee77d7f 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -58,8 +58,6 @@ else (STANDALONE) include_directories ( ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include/cairo - ${LIBS_PREBUILT_DIR}/include/pixman-1 ) foreach(include ${${LL_ARCH}_INCLUDES}) include_directories(${LIBS_PREBUILT_DIR}/include/${include}) diff --git a/indra/llcommon/llavatarconstants.h b/indra/llcommon/llavatarconstants.h index 867d6bdbf..6e7a49245 100644 --- a/indra/llcommon/llavatarconstants.h +++ b/indra/llcommon/llavatarconstants.h @@ -44,14 +44,6 @@ const char* const BLACKLIST_PROFILE_WEB_URL = "http://secondlife.com/app/webdisa // Maximum number of avatar picks const S32 MAX_AVATAR_PICKS = 10; -// For Flags in AvatarPropertiesReply -const U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not -const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature" -const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info -const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info -const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known. -const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified - char const* const VISIBILITY_DEFAULT = "default"; char const* const VISIBILITY_HIDDEN = "hidden"; char const* const VISIBILITY_VISIBLE = "visible"; diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index f034909da..a8de77067 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -1155,7 +1155,7 @@ bool LLImageTGA::loadFile( const std::string& path ) return false; } - S32 file_size = 0; + size_t file_size = 0; if (!fseek(file, 0, SEEK_END)) { file_size = ftell(file); diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index ae4197331..c829e1f8d 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -48,34 +48,34 @@ #define tanf(x) ((F32)tan((F64)(x))) #endif*/ -const F32 GRAVITY = -9.8f; +constexpr F32 GRAVITY = -9.8f; // mathematical constants -const F32 F_PI = 3.1415926535897932384626433832795f; -const F32 F_TWO_PI = 6.283185307179586476925286766559f; -const F32 F_PI_BY_TWO = 1.5707963267948966192313216916398f; -const F32 F_SQRT_TWO_PI = 2.506628274631000502415765284811f; -const F32 F_E = 2.71828182845904523536f; -const F32 F_SQRT2 = 1.4142135623730950488016887242097f; -const F32 F_SQRT3 = 1.73205080756888288657986402541f; -const F32 OO_SQRT2 = 0.7071067811865475244008443621049f; -const F32 OO_SQRT3 = 0.577350269189625764509f; -const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f; -const F32 RAD_TO_DEG = 57.295779513082320876798154814105f; -const F32 F_APPROXIMATELY_ZERO = 0.00001f; -const F32 F_LN10 = 2.3025850929940456840179914546844f; -const F32 OO_LN10 = 0.43429448190325182765112891891661f; -const F32 F_LN2 = 0.69314718056f; -const F32 OO_LN2 = 1.4426950408889634073599246810019f; +constexpr F32 F_PI = 3.1415926535897932384626433832795f; +constexpr F32 F_TWO_PI = 6.283185307179586476925286766559f; +constexpr F32 F_PI_BY_TWO = 1.5707963267948966192313216916398f; +constexpr F32 F_SQRT_TWO_PI = 2.506628274631000502415765284811f; +constexpr F32 F_E = 2.71828182845904523536f; +constexpr F32 F_SQRT2 = 1.4142135623730950488016887242097f; +constexpr F32 F_SQRT3 = 1.73205080756888288657986402541f; +constexpr F32 OO_SQRT2 = 0.7071067811865475244008443621049f; +constexpr F32 OO_SQRT3 = 0.577350269189625764509f; +constexpr F32 DEG_TO_RAD = 0.017453292519943295769236907684886f; +constexpr F32 RAD_TO_DEG = 57.295779513082320876798154814105f; +constexpr F32 F_APPROXIMATELY_ZERO = 0.00001f; +constexpr F32 F_LN10 = 2.3025850929940456840179914546844f; +constexpr F32 OO_LN10 = 0.43429448190325182765112891891661f; +constexpr F32 F_LN2 = 0.69314718056f; +constexpr F32 OO_LN2 = 1.4426950408889634073599246810019f; -const F32 F_ALMOST_ZERO = 0.0001f; -const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO; +constexpr F32 F_ALMOST_ZERO = 0.0001f; +constexpr F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO; -const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees +constexpr F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees // formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle); // BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above? -const F32 FP_MAG_THRESHOLD = 0.0000001f; +constexpr F32 FP_MAG_THRESHOLD = 0.0000001f; // TODO: Replace with logic like is_approx_equal inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); } @@ -112,13 +112,13 @@ inline bool is_zero(F32 x) inline bool is_approx_equal(F32 x, F32 y) { - const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02; + constexpr S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02; return (std::abs((S32) ((U32&)x - (U32&)y) ) < COMPARE_MANTISSA_UP_TO_BIT); } inline bool is_approx_equal(F64 x, F64 y) { - const S64 COMPARE_MANTISSA_UP_TO_BIT = 0x02; + constexpr S64 COMPARE_MANTISSA_UP_TO_BIT = 0x02; return (std::abs((S32) ((U64&)x - (U64&)y) ) < COMPARE_MANTISSA_UP_TO_BIT); } @@ -195,8 +195,8 @@ inline F64 ll_round(F64 val, F64 nearest) // peak error = -31.4 dB // RMS error = -28.1 dB -const F32 FAST_MAG_ALPHA = 0.960433870103f; -const F32 FAST_MAG_BETA = 0.397824734759f; +constexpr F32 FAST_MAG_ALPHA = 0.960433870103f; +constexpr F32 FAST_MAG_BETA = 0.397824734759f; // these provide minimum RMS error // @@ -204,8 +204,8 @@ const F32 FAST_MAG_BETA = 0.397824734759f; // peak error = -32.6 dB // RMS error = -25.7 dB // -//const F32 FAST_MAG_ALPHA = 0.948059448969f; -//const F32 FAST_MAG_BETA = 0.392699081699f; +//constexpr F32 FAST_MAG_ALPHA = 0.948059448969f; +//constexpr F32 FAST_MAG_BETA = 0.392699081699f; inline F32 fastMagnitude(F32 a, F32 b) { @@ -222,8 +222,8 @@ inline F32 fastMagnitude(F32 a, F32 b) // // Culled from www.stereopsis.com/FPU.html -const F64 LL_DOUBLE_TO_FIX_MAGIC = 68719476736.0*1.5; //2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor -const S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point representation, +constexpr F64 LL_DOUBLE_TO_FIX_MAGIC = 68719476736.0*1.5; //2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor +constexpr S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point representation, // Endian dependent code #ifdef LL_LITTLE_ENDIAN diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 3fc0a9390..cf3c685b1 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -53,8 +53,6 @@ # include "zlib/zlib.h" #endif - - std::string model_names[] = { "lowest_lod", @@ -68,7 +66,7 @@ const int MODEL_NAMES_LENGTH = sizeof(model_names) / sizeof(std::string); LLModel::LLModel(LLVolumeParams& params, F32 detail) : LLVolume(params, detail), mNormalizedScale(1,1,1), mNormalizedTranslation(0,0,0) - , mPelvisOffset( 0.0f ), mStatus(NO_ERRORS) + , mPelvisOffset( 0.0f ), mStatus(NO_ERRORS), mSubmodelID(0) { mDecompID = -1; mLocalID = -1; @@ -1909,7 +1907,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) weight_map::iterator best = iter_up; - F32 min_dist = (iter->first - pos).magVec(); + F32 min_dist = (iter_up->first - pos).magVec(); bool done = false; while (!done) @@ -2015,21 +2013,20 @@ bool LLModel::loadModel(std::istream& is) } } - std::string nm[] = - { + mSubmodelID = header.has("submodel_id") ? header["submodel_id"].asInteger() : false; + + static const std::array lod_name = {{ "lowest_lod", "low_lod", "medium_lod", "high_lod", "physics_mesh", - }; + }}; - const S32 MODEL_LODS = 5; + S32 lod = llclamp((S32) mDetail, 0, (S32)lod_name.size() - 1); - S32 lod = llclamp((S32) mDetail, 0, MODEL_LODS); - - if (header[nm[lod]]["offset"].asInteger() == -1 || - header[nm[lod]]["size"].asInteger() == 0 ) + if (header[lod_name[lod]]["offset"].asInteger() == -1 || + header[lod_name[lod]]["size"].asInteger() == 0 ) { //cannot load requested LOD LL_WARNS() << "LoD data is invalid!" << LL_ENDL; return false; @@ -2038,23 +2035,23 @@ bool LLModel::loadModel(std::istream& is) bool has_skin = header["skin"]["offset"].asInteger() >=0 && header["skin"]["size"].asInteger() > 0; - if (lod == LLModel::LOD_HIGH) + if ((lod == LLModel::LOD_HIGH) && !mSubmodelID) { //try to load skin info and decomp info std::ios::pos_type cur_pos = is.tellg(); loadSkinInfo(header, is); is.seekg(cur_pos); } - if (lod == LLModel::LOD_HIGH || lod == LLModel::LOD_PHYSICS) + if ((lod == LLModel::LOD_HIGH || lod == LLModel::LOD_PHYSICS) && !mSubmodelID) { std::ios::pos_type cur_pos = is.tellg(); loadDecomposition(header, is); is.seekg(cur_pos); } - is.seekg(header[nm[lod]]["offset"].asInteger(), std::ios_base::cur); + is.seekg(header[lod_name[lod]]["offset"].asInteger(), std::ios_base::cur); - if (unpackVolumeFaces(is, header[nm[lod]]["size"].asInteger())) + if (unpackVolumeFaces(is, header[lod_name[lod]]["size"].asInteger())) { if (has_skin) { @@ -2112,7 +2109,7 @@ bool LLModel::isMaterialListSubset( LLModel* ref ) for (S32 dst = 0; dst < refCnt; ++dst) { - //LL_INFOS() <mMaterialList[dst]<mMaterialList[dst]<mMaterialList[dst]; if ( foundRef ) @@ -2120,8 +2117,10 @@ bool LLModel::isMaterialListSubset( LLModel* ref ) break; } } + if (!foundRef) { + LL_INFOS() << "Could not find material " << mMaterialList[src] << " in reference model " << ref->mLabel << LL_ENDL; return false; } } @@ -2157,7 +2156,7 @@ bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCn bool isASubset = isMaterialListSubset( ref ); if ( !isASubset ) { - LL_INFOS() <<"Material of model is not a subset of reference."<mMaterialList[i]] = i; - if (!reorder) - { //if any material name does not match reference, we need to reorder - reorder = ref->mMaterialList[i] != mMaterialList[i]; - } + //if any material name does not match reference, we need to reorder + reorder |= ref->mMaterialList[i] != mMaterialList[i]; base_mat.insert(ref->mMaterialList[i]); cur_mat.insert(mMaterialList[i]); } - if (reorder && - base_mat == cur_mat) //don't reorder if material name sets don't match + if (reorder && (base_mat == cur_mat)) //don't reorder if material name sets don't match { std::vector new_face_list; - new_face_list.resize(mVolumeFaces.size()); + new_face_list.resize(mMaterialList.size()); std::vector new_material_list; - new_material_list.resize(mVolumeFaces.size()); + new_material_list.resize(mMaterialList.size()); //rebuild face list so materials have the same order //as the reference model for (U32 i = 0; i < mMaterialList.size(); ++i) { U32 ref_idx = index_map[mMaterialList[i]]; - new_face_list[ref_idx] = mVolumeFaces[i]; + if (i < mVolumeFaces.size()) + { + new_face_list[ref_idx] = mVolumeFaces[i]; + } new_material_list[ref_idx] = mMaterialList[i]; } llassert(new_material_list == ref->mMaterialList); mVolumeFaces = new_face_list; - } - //override material list with reference model ordering - mMaterialList = ref->mMaterialList; + //override material list with reference model ordering + mMaterialList = ref->mMaterialList; + } + return true; } @@ -2237,7 +2237,7 @@ bool LLModel::loadDecomposition(LLSD& header, std::istream& is) S32 offset = header["physics_convex"]["offset"].asInteger(); S32 size = header["physics_convex"]["size"].asInteger(); - if (offset >= 0 && size > 0) + if (offset >= 0 && size > 0 && !mSubmodelID) { is.seekg(offset, std::ios_base::cur); diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index f6063165d..33086bab9 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -181,7 +181,11 @@ public: bool isMaterialListSubset( LLModel* ref ); bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); - std::vector mMaterialList; + typedef std::vector material_list; + + material_list mMaterialList; + + material_list& getMaterialList() { return mMaterialList; } //data used for skin weights class JointWeight @@ -274,6 +278,8 @@ public: Decomposition mPhysics; EModelStatus mStatus ; + + int mSubmodelID; protected: void addVolumeFacesFromDomMesh(domMesh* mesh); virtual BOOL createVolumeFacesFromDomMesh(domMesh *mesh); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 40e2af265..1254c8265 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -371,7 +371,7 @@ void LLView::removeChild(LLView* child) // if we are removing an item we are currently iterating over, that would be bad llassert(child->mInDraw == false); mChildList.remove( child ); - for(boost::unordered_map::iterator it=mChildHashMap.begin(); it != mChildHashMap.end(); ++it) + for(boost::container::flat_map::iterator it=mChildHashMap.begin(); it != mChildHashMap.end(); ++it) { if(it->second == child) { @@ -1618,7 +1618,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_ return childp; } }*/ - boost::unordered_map::const_iterator it = mChildHashMap.find(name); + boost::container::flat_map::const_iterator it = mChildHashMap.find(name); if(it != mChildHashMap.end()) { return it->second; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 9a3f477ea..3fd5d44b3 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -57,7 +57,7 @@ #include "llinitparam.h" #include "lltreeiterators.h" #include "llfocusmgr.h" -#include +#include // #include "ailist.h" const U32 FOLLOWS_NONE = 0x00; @@ -518,7 +518,7 @@ public: const child_list_t* getChildList() const { return &mChildList; } child_list_const_iter_t beginChild() const { return mChildList.begin(); } child_list_const_iter_t endChild() const { return mChildList.end(); } - boost::unordered_map mChildHashMap; + boost::container::flat_map mChildHashMap; // // LLMouseHandler functions // Default behavior is to pass events to children diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 9cf5bb03e..5330d5f18 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -1353,9 +1353,9 @@ struct ScopedFile { if (!isOpen()) return 0; - S32 cur_pos = ftell(mFile); + size_t cur_pos = ftell(mFile); fseek(mFile, 0L, SEEK_END); - S32 file_size = ftell(mFile); + size_t file_size = ftell(mFile); fseek(mFile, cur_pos, SEEK_SET); return file_size - cur_pos; } diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index f3c207aa6..1b8b5a42e 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -756,7 +756,7 @@ bool LLXMLNode::parseFile(const std::string& filename, LLXMLNodePtr& node, LLXML return false; } fseek(fp, 0, SEEK_END); - U32 length = ftell(fp); + size_t length = ftell(fp); fseek(fp, 0, SEEK_SET); U8* buffer = new U8[length+1]; diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp index 67993065e..cc5399efe 100644 --- a/indra/llxml/llxmlparser.cpp +++ b/indra/llxml/llxmlparser.cpp @@ -89,7 +89,7 @@ BOOL LLXmlParser::parseFile(const std::string &path) S32 bytes_read = 0; fseek(file, 0L, SEEK_END); - S32 buffer_size = ftell(file); + size_t buffer_size = ftell(file); fseek(file, 0L, SEEK_SET); void* buffer = XML_GetBuffer(mParser, buffer_size); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2e085c54e..f0ba1dbc7 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -430,7 +430,8 @@ LLAgent::LLAgent() : mMouselookModeInSignal(NULL), mMouselookModeOutSignal(NULL), - mPendingLure(NULL) + mPendingLure(NULL), + mFriendObserver(nullptr) { for (U32 i = 0; i < TOTAL_CONTROLS; i++) { diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index d12d592cc..dce3d22f6 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -267,21 +267,16 @@ void LLInitialWearablesFetch::processWearablesMessage() for (U8 i = 0; i < mAgentInitialWearables.size(); ++i) { // Populate the current outfit folder with links to the wearables passed in the message -// InitialWearableData *wearable_data = new InitialWearableData(mAgentInitialWearables[i]); // This will be deleted in the callback. -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-02 (Catznip-3.0.0a) | Added: Catznip-2.0.0f - // Fixes minor leak: since COF is used onInitialWearableAssetArrived() will never get called and "wearable_data" leaks - InitialWearableData* wearable_data = &mAgentInitialWearables[i]; -// [/SL:KB] + const InitialWearableData& wearable_data = mAgentInitialWearables[i]; - if (wearable_data->mAssetID.notNull()) + if (wearable_data.mAssetID.notNull()) { - ids.push_back(wearable_data->mItemID); + ids.push_back(wearable_data.mItemID); } else { - LL_INFOS() << "Invalid wearable, type " << wearable_data->mType << " itemID " - << wearable_data->mItemID << " assetID " << wearable_data->mAssetID << LL_ENDL; -// delete wearable_data; + LL_INFOS() << "Invalid wearable, type " << wearable_data.mType << " itemID " + << wearable_data.mItemID << " assetID " << wearable_data.mAssetID << LL_ENDL; } } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9ab4cabef..74e55f09a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3347,16 +3347,16 @@ bool LLAppViewer::initCache() // Init the texture cache // Allocate 80% of the cache size for textures - const S32 MB = 1024 * 1024; - const S64 MIN_CACHE_SIZE = 64 * MB; - const S64 MAX_CACHE_SIZE = 9984ll * MB; - const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB + const U32 MB = 1024 * 1024; + const U64 MIN_CACHE_SIZE = 64 * MB; + const U64 MAX_CACHE_SIZE = 9984ll * MB; + const U64 MAX_VFS_SIZE = 1024 * MB; // 1 GB - S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; + U64 cache_size = (U64)(gSavedSettings.getU32("CacheSize")) * MB; cache_size = llclamp(cache_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); - S64 texture_cache_size = ((cache_size * 8) / 10); - S64 vfs_size = cache_size - texture_cache_size; + U64 texture_cache_size = ((cache_size * 8) / 10); + U64 vfs_size = cache_size - texture_cache_size; if (vfs_size > MAX_VFS_SIZE) { @@ -3366,7 +3366,7 @@ bool LLAppViewer::initCache() texture_cache_size = cache_size - MAX_VFS_SIZE; } - S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); + U64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()) ; diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 162fd05c4..64846dcd0 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -33,6 +33,14 @@ #include #include +// For Flags in AvatarPropertiesReply +constexpr U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not +constexpr U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature" +constexpr U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info +constexpr U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info +constexpr U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known. +constexpr U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified + /* *TODO Vadim: This needs some refactoring: - Remove EAvatarProcessorType in favor of separate observers, derived from a common parent (to get rid of void*). diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 81db452f8..0589cb546 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -96,7 +96,11 @@ LLFloaterScriptQueue::LLFloaterScriptQueue(const std::string& name, const std::string& start_string) : LLFloater(name, rect, title, RESIZE_YES, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, - DRAG_ON_TOP, MINIMIZE_YES, CLOSE_YES) + DRAG_ON_TOP, MINIMIZE_YES, CLOSE_YES), + mMessages(nullptr), + mCloseBtn(nullptr), + mDone(false), + mMono(false) { mID.generate(); @@ -111,7 +115,6 @@ LLFloaterScriptQueue::LLFloaterScriptQueue(const std::string& name, translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); mStartString = start_string; - mDone = FALSE; sInstances.addData(mID, this); } diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 7030356f0..2eb683290 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -61,7 +61,7 @@ class LLVOVolume; class LLViewerTexture; // Can have multiple silhouettes for each object -const U32 SILHOUETTE_HIGHLIGHT = 0; +constexpr U32 SILHOUETTE_HIGHLIGHT = 0; // All data for new renderer goes into this class. LL_ALIGN_PREFIX(16) diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index bf4a14754..dba3c1633 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -42,7 +42,7 @@ class LLMeshSkinInfo; class LLVolume; class LLVolumeFace; -const U32 JOINT_COUNT = 52; +constexpr U32 JOINT_COUNT = 52; class LLDrawPoolAvatar : public LLFacePool { diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 5308501a8..79c6d72b8 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -46,6 +46,10 @@ LLFloaterAvatarTextures::LLFloaterAvatarTextures(const LLUUID& id) : LLFloater(std::string("avatar_texture_debug")), mID(id) { + for (U32 i = 0; i < TEX_NUM_INDICES; i++) + { + mTextures[i] = nullptr; + } } LLFloaterAvatarTextures::~LLFloaterAvatarTextures() diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 1ebbb0aec..a890cba38 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -157,7 +157,8 @@ private: { TransactionPreflight, TransactionCurrency, - TransactionBuy + TransactionBuy, + TransactionNone }; boost::intrusive_ptr mResponder; TransactionType mTransactionType; @@ -281,11 +282,34 @@ void LLFloaterBuyLand::updateEstateOwnerName(const std::string& name) LLFloaterBuyLandUI::LLFloaterBuyLandUI() : LLFloater(std::string("Buy Land")), mParcelSelectionObserver(this), + mRegion(nullptr), mParcel(0), + mIsClaim(false), + mIsForGroup(false), + mCanBuy(false), + mCannotBuyIsError(false), mBought(false), - mParcelValid(false), mSiteValid(false), - mChildren(*this), mCurrency(*this), - mParcelBuyInfo(0) + mAgentCommittedTier(0), + mAgentHasNeverOwnedLand(true), + mParcelValid(false), + mParcelIsForSale(false), + mParcelIsGroupLand(false), + mParcelGroupContribution(0), + mParcelPrice(0), + mParcelActualArea(0), + mParcelBillableArea(0), + mParcelSupportedObjects(0), + mParcelSoldWithObjects(false), + mUserPlanChoice(0), + mSiteValid(false), + mSiteMembershipUpgrade(false), + mSiteLandUseUpgrade(false), + mPreflightAskBillableArea(0), + mPreflightAskCurrencyBuy(0), + mChildren(*this), + mCurrency(*this), + mParcelBuyInfo(nullptr), + mTransactionType(TransactionNone) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_land.xml"); LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver); @@ -347,8 +371,6 @@ void LLFloaterBuyLandUI::updateParcelInfo() mParcelSnapshot.setNull(); mParcelSellerName = ""; - mCanBuy = false; - mCannotBuyIsError = false; if (!mParcelValid) { diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 9d988dcb5..131786afd 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -144,14 +144,13 @@ std::string STATUS[] = // LLFloaterBvhPreview() //----------------------------------------------------------------------------- LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename, void* item) : - LLFloaterNameDesc(filename, item) + LLFloaterNameDesc(filename, item), + mItem(item), // + mLastMouseX(0), + mLastMouseY(0), + mPlayButton(nullptr), + mStopButton(nullptr) { - // - mItem = item; - // - mLastMouseX = 0; - mLastMouseY = 0; - mIDList["Standing"] = ANIM_AGENT_STAND; mIDList["Walking"] = ANIM_AGENT_FEMALE_WALK; mIDList["Sitting"] = ANIM_AGENT_SIT_FEMALE; diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 18826f961..b23883816 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -51,6 +51,9 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f; LLFloaterCamera::LLFloaterCamera(const LLSD& val) : LLFloater("camera floater") // uses "FloaterCameraRect3" + mRotate(nullptr), + mZoom(nullptr), + mTrack(nullptr) { setIsChrome(TRUE); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index fb2ab184c..11d51fe18 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -78,6 +78,15 @@ const F32 CONTEXT_FADE_TIME = 0.08f; LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) : LLFloater (std::string("Color Picker Floater")), + origR(1.f), + origG(1.f), + origB(1.f), + curR(1.f), + curG(1.f), + curB(1.f), + curH(0.f), + curS(0.f), + curL(1.f), mComponents ( 3 ), mMouseDownInLumRegion ( FALSE ), mMouseDownInHueRegion ( FALSE ), @@ -108,7 +117,11 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show mPaletteRegionHeight ( 40 ), mSwatch ( swatch ), mActive ( TRUE ), + mApplyImmediateCheck(nullptr), mCanApplyImmediately ( show_apply_immediate ), + mSelectBtn(nullptr), + mCancelBtn(nullptr), + mPipetteBtn(nullptr), mContextConeOpacity ( 0.f ) { // build the majority of the gui using the factory builder diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index c06a89ae7..b024b0eee 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -118,6 +118,8 @@ void LLFloaterGodTools::refreshAll() LLFloaterGodTools::LLFloaterGodTools() : LLFloater(std::string("godtools floater")), + mPanelRegionTools(nullptr), + mPanelObjectTools(nullptr), mCurrentHost(LLHost::invalid), mUpdateTimer() { diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 6b8a18ed8..f6c24f2fb 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -54,6 +54,7 @@ LLFloaterInspect::LLFloaterInspect(const LLSD&) : LLFloater(std::string("Inspect Object")), + mObjectList(nullptr), mDirty(FALSE) { mCommitCallbackRegistrar.add("Inspect.OwnerProfile", boost::bind(&LLFloaterInspect::onClickOwnerProfile, this)); diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index 2795ce016..b2d1d63fa 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -49,6 +49,9 @@ LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) : LLFloater("floater_joystick") + , mCheckJoystickEnabled(nullptr) + , mCheckFlycamEnabled(nullptr) + , mAxisStatsBar({ {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr} }) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_joystick.xml"); center(); diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h index 07b4b49c7..1104b604f 100644 --- a/indra/newview/llfloaterjoystick.h +++ b/indra/newview/llfloaterjoystick.h @@ -85,7 +85,7 @@ private: // stats view LLStatView* mAxisStatsView; LLStat* mAxisStats[6]; - LLStatBar* mAxisStatsBar[6]; + std::array mAxisStatsBar; }; #endif diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 80a84820c..4b1ccacb6 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -235,7 +235,15 @@ void LLFloaterLand::onClose(bool app_quitting) LLFloaterLand::LLFloaterLand(const LLSD& seed) -: LLFloater(std::string("floaterland"), std::string("FloaterLandRect5"), std::string("About Land")) + : LLFloater(std::string("floaterland"), std::string("FloaterLandRect5"), std::string("About Land")) + , mTabLand(nullptr) + , mPanelGeneral(nullptr) + , mPanelObjects(nullptr) + , mPanelOptions(nullptr) + , mPanelMedia(nullptr) + , mPanelAccess(nullptr) + , mPanelCovenant(nullptr) + , mPanelExperiences(nullptr) { mFactoryMap["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); mFactoryMap["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); @@ -354,9 +362,38 @@ void* LLFloaterLand::createPanelLandAccess(void* data) LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_general_panel")), - mUncheckedSell(FALSE), - mParcel(parcel) + : LLPanel(std::string("land_general_panel")) + , mEditName(nullptr) + , mEditDesc(nullptr) + , mTextSalePending(nullptr) + , mBtnDeedToGroup(nullptr) + , mBtnSetGroup(nullptr) + , mTextOwner(nullptr) + , mBtnProfile(nullptr) + , mContentRating(nullptr) + , mLandType(nullptr) + , mTextGroup(nullptr) + , mTextClaimDate(nullptr) + , mTextPriceLabel(nullptr) + , mTextPrice(nullptr) + , mCheckDeedToGroup(nullptr) + , mCheckContributeWithDeed(nullptr) + , mSaleInfoForSale1(nullptr) + , mSaleInfoForSale2(nullptr) + , mSaleInfoForSaleObjects(nullptr) + , mSaleInfoForSaleNoObjects(nullptr) + , mSaleInfoNotForSale(nullptr) + , mBtnSellLand(nullptr) + , mBtnStopSellLand(nullptr) + , mTextDwell(nullptr) + , mBtnBuyLand(nullptr) + , mBtnScriptLimits(nullptr) + , mBtnBuyGroupLand(nullptr) + , mBtnReleaseLand(nullptr) + , mBtnReclaimLand(nullptr) + , mBtnBuyPass(nullptr) + , mBtnStartAuction(nullptr) + , mParcel(parcel) { } @@ -374,7 +411,6 @@ BOOL LLPanelLandGeneral::postBuild() // preserve that ability. mTextSalePending = getChild("SalePending"); - mTextOwnerLabel = getChild("Owner:"); mTextOwner = getChild("OwnerText"); mContentRating = getChild("ContentRatingText"); @@ -384,7 +420,6 @@ BOOL LLPanelLandGeneral::postBuild() mBtnProfile->setClickedCallback(boost::bind(&LLPanelLandGeneral::onClickProfile, this)); - mTextGroupLabel = getChild("Group:"); mTextGroup = getChild("GroupText"); @@ -425,7 +460,6 @@ BOOL LLPanelLandGeneral::postBuild() mBtnStopSellLand->setClickedCallback(onClickStopSellLand, this); - mTextClaimDateLabel = getChild("Claimed:"); mTextClaimDate = getChild("DateClaimText"); @@ -2412,8 +2446,10 @@ void LLPanelLandOptions::onClickPublishHelp(void*) //--------------------------------------------------------------------------- LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) - : LLPanel(std::string("land_access_panel")), - mParcel(parcel) + : LLPanel(std::string("land_access_panel")) + , mListAccess(nullptr) + , mListBanned(nullptr) + , mParcel(parcel) { } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 72e906a65..168dcc4f1 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -183,11 +183,7 @@ public: virtual BOOL postBuild(); protected: - BOOL mUncheckedSell; // True only when verifying land information when land is for sale on sale info change - - LLTextBox* mLabelName; LLLineEditor* mEditName; - LLTextBox* mLabelDesc; LLTextEditor* mEditDesc; LLTextBox* mTextSalePending; @@ -195,7 +191,6 @@ protected: LLButton* mBtnDeedToGroup; LLButton* mBtnSetGroup; - LLTextBox* mTextOwnerLabel; LLTextBox* mTextOwner; LLButton* mBtnProfile; @@ -203,8 +198,6 @@ protected: LLTextBox* mLandType; LLTextBox* mTextGroup; - LLTextBox* mTextGroupLabel; - LLTextBox* mTextClaimDateLabel; LLTextBox* mTextClaimDate; LLTextBox* mTextPriceLabel; diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index f0f1f3869..53e405af8 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -43,10 +43,13 @@ LLFloaterMediaSettings* LLFloaterMediaSettings::sInstance = NULL; // LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key) : LLFloater(key), - mTabContainer(NULL), - mPanelMediaSettingsGeneral(NULL), - mPanelMediaSettingsSecurity(NULL), - mPanelMediaSettingsPermissions(NULL), + mOKBtn(nullptr), + mCancelBtn(nullptr), + mApplyBtn(nullptr), + mTabContainer(nullptr), + mPanelMediaSettingsGeneral(nullptr), + mPanelMediaSettingsSecurity(nullptr), + mPanelMediaSettingsPermissions(nullptr), mWaitingToClose( false ), mIdenticalHasMediaInfo( true ), mMultipleMedia(false), diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 327a37cdd..b9539444d 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -4177,17 +4177,17 @@ void LLModelPreview::updateStatusMessages() { for (LLModelLoader::model_instance_list::iterator instance = iter->second.begin(), end_instance = iter->second.end(); instance != end_instance; ++instance) { - LLModel* model = instance->mModel; - if (model) + LLModel* lod_model = instance->mModel; + if (lod_model) { //for each model in the lod S32 cur_tris = 0; S32 cur_verts = 0; - S32 cur_submeshes = model->getNumVolumeFaces(); + S32 cur_submeshes = lod_model->getNumVolumeFaces(); for (S32 j = 0; j < cur_submeshes; ++j) { //for each submesh (face), add triangles and vertices to current total - const LLVolumeFace& face = model->getVolumeFace(j); + const LLVolumeFace& face = lod_model->getVolumeFace(j); cur_tris += face.mNumIndices/3; cur_verts += face.mNumVertices; } @@ -4202,6 +4202,11 @@ void LLModelPreview::updateStatusMessages() verts[lod].push_back(cur_verts); submeshes[lod].push_back(cur_submeshes); } + else // !lod_model + { + setLoadState( LLModelLoader::ERROR_MATERIALS ); + mFMP->childDisable( "calculate_btn" ); + } } } } diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 35f6b9c1f..8352d140c 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -77,6 +77,7 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) mFilterByDescription(NULL), mFilterByLinksetUse(NULL), mEditLinksetUse(NULL), + mEditLinksetUseUnset(nullptr), mEditLinksetUseWalkable(NULL), mEditLinksetUseStaticObstacle(NULL), mEditLinksetUseDynamicObstacle(NULL), diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 5f6f149c3..64c6cc50e 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -204,6 +204,9 @@ LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) + : LLFloater() + , mTab(nullptr) + , mInfoPanels() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); } @@ -2463,8 +2466,13 @@ bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& re } LLPanelEstateCovenant::LLPanelEstateCovenant() - : - mCovenantID(LLUUID::null) + : LLPanelRegionInfo() + , mEstateNameText(nullptr) + , mEstateOwnerText(nullptr) + , mLastModifiedText(nullptr) + , mCovenantID(LLUUID::null) + , mEditor(nullptr) + , mAssetStatus(ASSET_ERROR) { } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 71f478e52..5e9d9ebf8 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -48,9 +48,9 @@ class LLMeanCollisionData; struct LLResourceData; // these flags are used to label info requests to the server -//const U32 BUG_REPORT_REQUEST = 0x01 << 0; // DEPRECATED -const U32 COMPLAINT_REPORT_REQUEST = 0x01 << 1; -const U32 OBJECT_PAY_REQUEST = 0x01 << 2; +//constexpr U32 BUG_REPORT_REQUEST = 0x01 << 0; // DEPRECATED +constexpr U32 COMPLAINT_REPORT_REQUEST = 0x01 << 1; +constexpr U32 OBJECT_PAY_REQUEST = 0x01 << 2; // ************************************************************ diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index df9ff37eb..7fe24895c 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -162,7 +162,8 @@ LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput() } LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLUUID& object_id) -: LLFloater(std::string("script instance floater"), LLRect(0, 200, 200, 0), std::string("Script"), TRUE), mObjectID(object_id) +: LLFloater(std::string("script instance floater"), LLRect(0, 200, 200, 0), std::string("Script"), TRUE), mObjectID(object_id), + mHistoryEditor(nullptr) { S32 y = getRect().getHeight() - LLFLOATER_HEADER_SIZE - LLFLOATER_VPAD; S32 x = LLFLOATER_HPAD; diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 0f6b6b78b..a0a6184aa 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -84,6 +84,8 @@ const S32 SIZE_OF_ONE_KB = 1024; LLFloaterScriptLimits::LLFloaterScriptLimits(const LLSD& seed) : LLFloater(/*seed*/) + , mTab(nullptr) + , mInfoPanels() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_limits.xml"); } diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 9c0fcf159..46f45b1e2 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -55,6 +55,7 @@ LLFloaterSettingsDebug::LLFloaterSettingsDebug() , mCurrentControlVariable(NULL) , mOldControlVariable(NULL) , mOldSearchTerm(std::string("---")) +, mComment(nullptr) { mCommitCallbackRegistrar.add("SettingSelect", boost::bind(&LLFloaterSettingsDebug::onSettingSelect, this)); mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this)); diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 3c526a1ac..727a89b3c 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -103,6 +103,7 @@ public: LLFloaterURLEntry::LLFloaterURLEntry(LLHandle parent) : LLFloater(), + mMediaURLEdit(nullptr), mPanelLandMediaHandle(parent) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_url_entry.xml"); diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index fc74c9e87..a60ca1ca7 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -38,6 +38,7 @@ LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key) : LLFloater(/*key*/) + , mVoiceEffectList(nullptr) { mCommitCallbackRegistrar.add("VoiceEffect.Record", boost::bind(&LLFloaterVoiceEffect::onClickRecord, this)); mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this)); diff --git a/indra/newview/llfloatervoiceeffect.h b/indra/newview/llfloatervoiceeffect.h index 9bee8937c..e7c0af852 100644 --- a/indra/newview/llfloatervoiceeffect.h +++ b/indra/newview/llfloatervoiceeffect.h @@ -67,7 +67,6 @@ private: void onClickStop(); void onClickActivate(); - LLUUID mSelectedID; LLScrollListCtrl* mVoiceEffectList; }; diff --git a/indra/newview/llfloaterwhitelistentry.cpp b/indra/newview/llfloaterwhitelistentry.cpp index f930e0940..c7a17f136 100644 --- a/indra/newview/llfloaterwhitelistentry.cpp +++ b/indra/newview/llfloaterwhitelistentry.cpp @@ -37,8 +37,9 @@ /////////////////////////////////////////////////////////////////////////////// // -LLFloaterWhiteListEntry::LLFloaterWhiteListEntry() : - LLFloater() +LLFloaterWhiteListEntry::LLFloaterWhiteListEntry() + : LLFloater() + , mWhiteListEdit(nullptr) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_whitelist_entry.xml"); } diff --git a/indra/newview/llgivemoney.cpp b/indra/newview/llgivemoney.cpp index bd9243827..ea1502973 100644 --- a/indra/newview/llgivemoney.cpp +++ b/indra/newview/llgivemoney.cpp @@ -76,16 +76,13 @@ LLFloaterPay::LLFloaterPay(const std::string& name, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES), mCallback(callback), - mObjectNameText(NULL), mTargetUUID(uuid), mTargetIsObject(target_is_object), mTargetIsGroup(FALSE), - mDefaultValue(0) + mDefaultValue(0), + mQuickPayButton({ {nullptr,nullptr,nullptr,nullptr} }), + mQuickPayInfo({ {PAY_BUTTON_DEFAULT_0, PAY_BUTTON_DEFAULT_1, PAY_BUTTON_DEFAULT_2, PAY_BUTTON_DEFAULT_3} }) { - mQuickPayInfo[0] = PAY_BUTTON_DEFAULT_0; - mQuickPayInfo[1] = PAY_BUTTON_DEFAULT_1; - mQuickPayInfo[2] = PAY_BUTTON_DEFAULT_2; - mQuickPayInfo[3] = PAY_BUTTON_DEFAULT_3; BOOST_STATIC_ASSERT(MAX_PAY_BUTTONS == 4); if (target_is_object) diff --git a/indra/newview/llgivemoney.h b/indra/newview/llgivemoney.h index 540d0dade..26abf3450 100644 --- a/indra/newview/llgivemoney.h +++ b/indra/newview/llgivemoney.h @@ -81,14 +81,12 @@ private: protected: money_callback mCallback; - LLTextBox* mObjectNameText; LLUUID mTargetUUID; BOOL mTargetIsObject; BOOL mTargetIsGroup; - BOOL mHaveName; - LLButton* mQuickPayButton[MAX_PAY_BUTTONS]; - S32 mQuickPayInfo[MAX_PAY_BUTTONS]; + std::array mQuickPayButton; + std::array mQuickPayInfo; S32 mDefaultValue; LLSafeHandle mObjectSelection; diff --git a/indra/newview/llhudeffecttrail.h b/indra/newview/llhudeffecttrail.h index 033fbeb06..15daa80db 100644 --- a/indra/newview/llhudeffecttrail.h +++ b/indra/newview/llhudeffecttrail.h @@ -42,7 +42,7 @@ class LLViewerObject; -const U32 NUM_TRAIL_POINTS = 40; +constexpr U32 NUM_TRAIL_POINTS = 40; class LLHUDEffectSpiral : public LLHUDEffect diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 319e9a7e8..df956b2e0 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -747,6 +747,8 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol static const LLCachedControl ding("LiruNewMessageSound"); static const LLCachedControl dong("LiruNewMessageSoundForSystemMessages"); LLUI::sAudioCallback(LLUUID(from_user ? ding : dong)); + void flash_viewer_window(S32); + flash_viewer_window(2); } // start tab flashing when receiving im for background session from user diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 45b18ae2f..53c18d214 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -488,7 +488,7 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); // have permission to move and object is root of selection or individually selected - if (object->permMove() && !object->isPermanentEnforced() && + if (object && object->permMove() && !object->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { @@ -578,7 +578,7 @@ void LLManipRotate::drag( S32 x, S32 y ) LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); // have permission to move and object is root of selection or individually selected - if (object->permMove() && !object->isPermanentEnforced() && + if (object && object->permMove() && !object->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index a3e2561af..b3d46fb56 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -704,7 +704,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); - if (object->permMove() && !object->isPermanentEnforced() && + if (object && object->permMove() && !object->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced())) { // handle attachments in local space @@ -2317,7 +2317,7 @@ BOOL LLManipTranslate::canAffectSelection() virtual bool apply(LLViewerObject* objectp) { LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); - return objectp->permMove() && !objectp->isPermanentEnforced() && + return object && objectp->permMove() && !objectp->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 70bfef427..3b7dadf17 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2137,7 +2137,8 @@ void LLMeshHeaderResponder::completedRaw(LLChannelDescriptors const& channels, LLMeshRepository::LLMeshRepository() : mMeshMutex(NULL), mMeshThreadCount(0), - mThread(NULL) + mThread(NULL), + mDecompThread(nullptr) { } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index d9fe32e4e..88fe06ff9 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -351,9 +351,9 @@ void LLNetMap::draw() { const LLViewerRegion::tex_matrix_t& tiles(regionp->getWorldMapTiles()); - for (S32 i(0), scaled_width(real_width/region_width), square_width(scaled_width*scaled_width); i < square_width; ++i) + for (S32 i(0), scaled_width((S32)real_width/region_width), square_width(scaled_width*scaled_width); i < square_width; ++i) { - const F32 y(i/scaled_width); + const F32 y(i / (F32)scaled_width); const F32 x(i - y*scaled_width); const F32 local_left(left + x*mScale); const F32 local_right(local_left + mScale); diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index af7855ca3..e9f394b31 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -100,7 +100,7 @@ void LLPanelContents::getState(LLViewerObject *objectp ) } LLUUID group_id; // used for SL-23488 - LLSelectMgr::getInstance()->selectGetGroup(group_id); // sets group_id as a side effect SL-23488 + (void)LLSelectMgr::getInstance()->selectGetGroup(group_id); // sets group_id as a side effect SL-23488 // BUG? Check for all objects being editable? bool editable = gAgent.isGodlike() diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 70037243d..ed6c3225c 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -195,7 +195,7 @@ public: void requestGroupLandInfo(); - int getStoredContribution(); + S32 getStoredContribution(); void setYourContributionTextField(int contrib); void setYourMaxContributionTextBox(int max); @@ -341,14 +341,14 @@ bool LLPanelGroupLandMoney::impl::applyContribution() // Retrieves the land contribution for this agent that is currently // stored in the database, NOT what is currently entered in the text field -int LLPanelGroupLandMoney::impl::getStoredContribution() +S32 LLPanelGroupLandMoney::impl::getStoredContribution() { LLGroupData group_data; group_data.mContribution = 0; - gAgent.getGroupData(mPanel.mGroupID, group_data); + bool found_group = gAgent.getGroupData(mPanel.mGroupID, group_data); - return group_data.mContribution; + return found_group ? group_data.mContribution : 0; } // Fills in the text field with the contribution, contrib diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 02f3eedf0..7439d80ae 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -95,7 +95,12 @@ LLInventoryView::LLInventoryView(const std::string& name, LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES), - mActivePanel(NULL) + mFilterEditor(nullptr), + mFilterTabs(nullptr), + mActivePanel(nullptr), + mResortActivePanel(true), + mSavedFolderState(nullptr), + mFilterText("") //LLHandle mFinderHandle takes care of its own initialization { init(inventory); @@ -107,7 +112,12 @@ LLInventoryView::LLInventoryView(const std::string& name, LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES), - mActivePanel(NULL) + mFilterEditor(nullptr), + mFilterTabs(nullptr), + mActivePanel(nullptr), + mResortActivePanel(true), + mSavedFolderState(nullptr), + mFilterText("") //LLHandle mFinderHandle takes care of its own initialization { init(inventory); diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index f8ede13ba..7372064c4 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -467,7 +467,7 @@ bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace(bool only_if_current_ bool all_face_media_navigated = false; LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection(); - selected_objects->getSelectedTEValue( &functor_navigate_media, all_face_media_navigated ); + (void)selected_objects->getSelectedTEValue( &functor_navigate_media, all_face_media_navigated ); // Note: we don't update the 'current URL' field until the media data itself changes diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index c578c9a8d..55d07a021 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -76,13 +76,23 @@ static const LLUUID PARCEL_AUDIO_LIST_ITEM_UUID = LLUUID("DF4B020D-8A24-4B95-AB5 LLPanelNearByMedia::LLPanelNearByMedia(bool standalone_panel) -: mMediaList(NULL), - mEnableAllCtrl(NULL), - mAllMediaDisabled(false), - mDebugInfoVisible(false), - mParcelMediaItem(NULL), - mParcelAudioItem(NULL), - mStandalonePanel(standalone_panel) + : mNearbyMediaPanel(nullptr) + , mMediaList(nullptr) + , mEnableAllCtrl(nullptr) + , mDisableAllCtrl(nullptr) + , mShowCtrl(nullptr) + , mStopCtrl(nullptr) + , mPlayCtrl(nullptr) + , mPauseCtrl(nullptr) + , mMuteCtrl(nullptr) + , mVolumeSliderCtrl(nullptr) + , mZoomCtrl(nullptr) + , mUnzoomCtrl(nullptr) + , mVolumeSlider(nullptr) + , mMuteBtn(nullptr) + , mDebugInfoVisible(false) + , mParcelMediaItem(nullptr) + , mParcelAudioItem(nullptr) { mHoverTimer.stop(); diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index 410dfb48c..8b5bbdc35 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -165,7 +165,6 @@ private: LLSlider* mVolumeSlider; LLButton* mMuteBtn; - bool mAllMediaDisabled; bool mDebugInfoVisible; bool mParcelAudioAutoStart; std::string mEmptyNameString; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 577e1cd64..60f6c55f5 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -318,10 +318,11 @@ void LLPanelPrimMediaControls::updateShape() { bool mini_controls = false; LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); - if (media_data && NULL != dynamic_cast(objectp)) + LLVOVolume *vol = dynamic_cast(objectp); + if (media_data && vol) { // Don't show the media controls if we do not have permissions - enabled = dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); + enabled = vol->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); mini_controls = (LLMediaEntry::MINI == media_data->getControls()); } const bool is_hud = objectp->isHUDAttachment(); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 6d804e651..75ead67ca 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -438,19 +438,27 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename) // read in the whole file fseek(file, 0L, SEEK_END); - size_t file_length = (size_t) ftell(file); + long file_length = ftell(file); fseek(file, 0L, SEEK_SET); - char* buffer = new char[file_length+1]; - size_t nread = fread(buffer, 1, file_length, file); - if (nread < file_length) + if (file_length > 0) { - LL_WARNS() << "Short read" << LL_ENDL; - } - buffer[nread] = '\0'; - fclose(file); + char* buffer = new char[file_length+1]; + size_t nread = fread(buffer, 1, file_length, file); + if (nread < file_length) + { + LL_WARNS() << "Short read" << LL_ENDL; + } + buffer[nread] = '\0'; + fclose(file); - mEditor->setText(LLStringExplicit(buffer)); - delete[] buffer; + mEditor->setText(LLStringExplicit(buffer)); + delete[] buffer; + } + else + { + LL_WARNS() << "Error opening " << filename << LL_ENDL; + return false; + } return true; } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 7d66f75fc..e16a5ca7f 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3576,6 +3576,7 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mOffset(offset), mFullbright(fullbright), mBump(bump), + mShiny(0), mParticle(particle), mPartSize(part_size), mVSize(0.f), diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 97a4f67f1..2dc2031bd 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -127,9 +127,7 @@ public: U32 mBlendFuncDst; BOOL mHasGlow; LLPointer mSpecularMap; - const LLMatrix4* mSpecularMapMatrix; LLPointer mNormalMap; - const LLMatrix4* mNormalMapMatrix; LLVector4 mSpecColor; // XYZ = Specular RGB, W = Specular Exponent F32 mEnvIntensity; F32 mAlphaMaskCutoff; diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 0817aa9fd..7e4ed1ad3 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -931,17 +931,17 @@ void LLTextureCache::setReadOnly(BOOL read_only) } //called in the main thread. -S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache_mismatch) +U64 LLTextureCache::initCache(ELLPath location, U64 max_size, BOOL texture_cache_mismatch) { llassert_always(getPending() == 0); //should not start accessing the texture cache before initialized. - S64 header_size = (max_size * 2) / 10; - S64 max_entries = header_size / TEXTURE_CACHE_ENTRY_SIZE; - sCacheMaxEntries = (S32)(llmin((S64)sCacheMaxEntries, max_entries)); + U64 header_size = (max_size * 2) / 10; + U32 max_entries = header_size / TEXTURE_CACHE_ENTRY_SIZE; + sCacheMaxEntries = (llmin(sCacheMaxEntries, max_entries)); header_size = sCacheMaxEntries * TEXTURE_CACHE_ENTRY_SIZE; max_size -= header_size; if (sCacheMaxTexturesSize > 0) - sCacheMaxTexturesSize = llmin(sCacheMaxTexturesSize, max_size); + sCacheMaxTexturesSize = (U32)llmin((U64)sCacheMaxTexturesSize, max_size); else sCacheMaxTexturesSize = max_size; max_size -= sCacheMaxTexturesSize; diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 2715ef2c4..0a35767ec 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -105,7 +105,7 @@ public: void purgeCache(ELLPath location); void setReadOnly(BOOL read_only) ; - S64 initCache(ELLPath location, S64 maxsize, BOOL texture_cache_mismatch); + U64 initCache(ELLPath location, U64 maxsize, BOOL texture_cache_mismatch); handle_t readFromCache(const std::string& local_filename, const LLUUID& id, U32 priority, S32 offset, S32 size, ReadResponder* responder); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 5a0711b91..4f5bb691e 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1199,7 +1199,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, break; } } - else + else if (hit_obj) { //hit_obj->setTEImage(hit_face, image); hit_obj->setTETexture(hit_face, asset_id); //Singu note: setTETexture will allow the real id to be passed to LLPrimitive::setTETexture, diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 6d3dafe58..ab3c9b3ac 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -48,15 +48,15 @@ class LLCamera; class LLNetMap; class LLDebugBeacon; -const U32 CLOSE_BIN_SIZE = 10; -const U32 NUM_BINS = 128; +constexpr U32 CLOSE_BIN_SIZE = 10; +constexpr U32 NUM_BINS = 128; // GL name = position in object list + GL_NAME_INDEX_OFFSET so that // we can have special numbers like zero. -const U32 GL_NAME_LAND = 0; -const U32 GL_NAME_PARCEL_WALL = 1; +constexpr U32 GL_NAME_LAND = 0; +constexpr U32 GL_NAME_PARCEL_WALL = 1; -const U32 GL_NAME_INDEX_OFFSET = 10; +constexpr U32 GL_NAME_INDEX_OFFSET = 10; class LLViewerObjectList { diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 2a150eccb..b2ed8f42f 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -42,28 +42,28 @@ // Will clean these up at some point... // -const F32 HORIZON_DIST = 1024.0f; -const F32 SKY_BOX_MULT = 16.0f; -const F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 10.f; -const F32 HEAVENLY_BODY_FACTOR = 0.1f; -const F32 HEAVENLY_BODY_SCALE = HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR; -const F32 EARTH_RADIUS = 6.4e6f; // exact radius = 6.37 x 10^6 m -const F32 ATM_EXP_FALLOFF = 0.000126f; -const F32 ATM_SEA_LEVEL_NDENS = 2.55e25f; +constexpr F32 HORIZON_DIST = 1024.0f; +constexpr F32 SKY_BOX_MULT = 16.0f; +constexpr F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 10.f; +constexpr F32 HEAVENLY_BODY_FACTOR = 0.1f; +constexpr F32 HEAVENLY_BODY_SCALE = HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR; +constexpr F32 EARTH_RADIUS = 6.4e6f; // exact radius = 6.37 x 10^6 m +constexpr F32 ATM_EXP_FALLOFF = 0.000126f; +constexpr F32 ATM_SEA_LEVEL_NDENS = 2.55e25f; // Somewhat arbitrary: -const F32 ATM_HEIGHT = 100000.f; +constexpr F32 ATM_HEIGHT = 100000.f; -const F32 FIRST_STEP = 5000.f; -const F32 INV_FIRST_STEP = 1.f/FIRST_STEP; -const S32 NO_STEPS = 15; -const F32 INV_NO_STEPS = 1.f/NO_STEPS; +constexpr F32 FIRST_STEP = 5000.f; +constexpr F32 INV_FIRST_STEP = 1.f/FIRST_STEP; +constexpr S32 NO_STEPS = 15; +constexpr F32 INV_NO_STEPS = 1.f/NO_STEPS; // constants used in calculation of scattering coeff of clear air -const F32 sigma = 0.035f; -const F32 fsigma = (6.f + 3.f * sigma) / (6.f-7.f*sigma); -const F64 Ndens = 2.55e25; -const F64 Ndens2 = Ndens*Ndens; +constexpr F32 sigma = 0.035f; +constexpr F32 fsigma = (6.f + 3.f * sigma) / (6.f-7.f*sigma); +constexpr F64 Ndens = 2.55e25; +constexpr F64 Ndens2 = Ndens*Ndens; // HACK: Allow server to change sun and moon IDs. // I can't figure out how to pass the appropriate