Merge branch 'DRTVWR-600-maint-A' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/llappearance/llavatarappearance.cpp
#	indra/llmath/llvolume.cpp
#	indra/llmessage/llcorehttputil.cpp
#	indra/llrender/llgl.cpp
#	indra/newview/installers/darwin/apple-notarize.sh
#	indra/newview/llappviewer.cpp
#	indra/newview/llface.cpp
#	indra/newview/llfloater360capture.cpp
#	indra/newview/llfloateremojipicker.cpp
#	indra/newview/llpanelpeople.cpp
#	indra/newview/llviewertexture.cpp
#	indra/newview/viewer_manifest.py
master
Ansariel 2024-06-10 21:53:31 +02:00
commit 591c75ebaf
164 changed files with 1340 additions and 1329 deletions

8
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,8 @@
# Replace tabs with spaces
1b68f71348ecf3983b76b40d7940da8377f049b7
# Trim trailing whitespace
a0b3021bdcf76859054fda8e30abb3ed47749e83
# Wrong line endings
1b67dd855c41f5a0cda7ec2a68d98071986ca703
6cc7dd09d5e69cf57e6de7fb568a0ad2693f9c9a
e2e37cced861b98de8c1a7c9c0d3a50d2d90e433

View File

@ -1,6 +1,6 @@
llappearance:
- indra/llappearance/**/*
llaudio:
- indra/llaudio/**/*

View File

@ -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

View File

@ -1,4 +1,4 @@
name: Stale PRs
name: Stale PRs
on:
workflow_dispatch:
schedule:

View File

@ -1,5 +1,5 @@
repos:
- repo: https://github.com/secondlife/git-hooks.git
- repo: https://github.com/secondlife/git-hooks.git
rev: v1.0.2
hooks:
- id: opensource-license
@ -16,3 +16,5 @@ repos:
hooks:
- id: check-xml
- id: mixed-line-ending
- id: trailing-whitespace
files: \.(cpp|c|h|inl|py|glsl|cmake|yaml|sh)$

View File

@ -1695,11 +1695,11 @@
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>24256fab0ccf6c0f70dcb536240e7e556f592ebe</string>
<string>755a3de464149ae88b048f976828a8c0c46e3bdb</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617692</string>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966323</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -1711,11 +1711,11 @@
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>7d218e641c66a63bb6722b4605d6bcbf78c51c85</string>
<string>813e7b5e294d7958e3d69e2252752ff346953b0c</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617691</string>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966322</string>
</map>
<key>name</key>
<string>linux64</string>
@ -1727,18 +1727,18 @@
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>56b94c0d0f0b2f221fd13648e99e9569b0490d76</string>
<string>67f647538b1b49d0152fd9d03cfb9bdf978e33d1</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/171617694</string>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966328</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.0.b6dc588</string>
<string>1.0.b8b1f73</string>
</map>
<key>llphysicsextensions_stub</key>
<map>

View File

@ -199,14 +199,14 @@ package_llphysicsextensions_tpv()
tpv_status=0
# nat 2016-12-21: without HAVOK, can't build PhysicsExtensions_TPV.
if [ "$variant" = "Release" -a "${HAVOK:-}" != "OFF" ]
then
then
tpvconfig="$build_dir/packages/llphysicsextensions/autobuild-tpv.xml"
test -r "$tpvconfig" || fatal "No llphysicsextensions_tpv autobuild configuration found"
# SL-19942: autobuild ignores -c switch if AUTOBUILD_CONFIGURATION set
unset AUTOBUILD_CONFIGURATION
"$autobuild" build --quiet --config-file "$(native_path "$tpvconfig")" -c Tpv \
|| fatal "failed to build llphysicsextensions_tpv"
# capture the package file name for use in upload later...
PKGTMP=`mktemp -t pgktpv.XXXXXX`
cleanup="$cleanup ; rm $PKGTMP* 2>/dev/null"
@ -239,7 +239,7 @@ build()
|| fatal "failed building $variant"
echo true >"$build_dir"/build_ok
end_section "autobuild $variant"
begin_section "extensions $variant"
# Run build extensions
if [ -d ${build_dir}/packages/build-extensions ]
@ -312,7 +312,7 @@ begin_section "select viewer channel"
# Look for a branch-specific viewer_channel setting
# changeset_branch is set in the sling-buildscripts
viewer_build_branch=$(echo -n "${changeset_branch:-$(repo_branch ${BUILDSCRIPTS_SRC:-$(pwd)})}" | tr -Cs 'A-Za-z0-9_' '_' | sed -E 's/^_+//; s/_+$//')
if [ -n "$viewer_build_branch" ]
if [ -n "$viewer_build_branch" ]
then
branch_viewer_channel_var="${viewer_build_branch}_viewer_channel"
if [ -n "${!branch_viewer_channel_var}" ]
@ -434,7 +434,7 @@ do
record_event "configure for $variant failed: build skipped"
fi
if ! $succeeded
if ! $succeeded
then
record_event "remaining variants skipped due to $variant failure"
break
@ -496,7 +496,7 @@ then
fi
done
end_section "Upload Debian Repository"
else
record_event "debian build not enabled"
fi

View File

@ -117,7 +117,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(FIND_LIBRARY_USE_LIB64_PATHS ON)
endif (ADDRESS_SIZE EQUAL 32)
execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
RESULT_VARIABLE DPKG_RESULT
OUTPUT_VARIABLE DPKG_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)

View File

@ -537,8 +537,8 @@ class LLManifest(object, metaclass=LLManifestRegistry):
return path
def run_command(self, command, **kwds):
"""
Runs an external command.
"""
Runs an external command.
Raises ManifestError exception if the command returns a nonzero status.
"""
print("Running command:", shlex.join(command))

View File

@ -1442,12 +1442,12 @@ void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_
if( teToColorParams( te, param_name ) )
{
// <FS:Ansariel> [Legacy Bake]
//setVisualParamWeight( param_name[0], new_color.mV[VX]);
//setVisualParamWeight( param_name[1], new_color.mV[VY]);
//setVisualParamWeight( param_name[2], new_color.mV[VZ]);
setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake);
setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake);
setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake);
//setVisualParamWeight( param_name[0], new_color.mV[VRED]);
//setVisualParamWeight( param_name[1], new_color.mV[VGREEN]);
//setVisualParamWeight( param_name[2], new_color.mV[VBLUE]);
setVisualParamWeight( param_name[0], new_color.mV[VRED], upload_bake);
setVisualParamWeight( param_name[1], new_color.mV[VGREEN], upload_bake);
setVisualParamWeight( param_name[2], new_color.mV[VBLUE], upload_bake);
// </FS:Ansariel> [Legacy Bake]
}
}
@ -1458,9 +1458,9 @@ LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te )
U32 param_name[3];
if( teToColorParams( te, param_name ) )
{
color.mV[VX] = getVisualParamWeight( param_name[0] );
color.mV[VY] = getVisualParamWeight( param_name[1] );
color.mV[VZ] = getVisualParamWeight( param_name[2] );
color.mV[VRED] = getVisualParamWeight( param_name[0] );
color.mV[VGREEN] = getVisualParamWeight( param_name[1] );
color.mV[VBLUE] = getVisualParamWeight( param_name[2] );
}
return color;
}

View File

@ -983,7 +983,7 @@ void LLPolyMesh::initializeForMorph()
LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices);
LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2));
for (U32 i = 0; i < mSharedData->mNumVertices; ++i)
for (S32 i = 0; i < mSharedData->mNumVertices; ++i)
{
mClothingWeights[i].clear();
}

View File

@ -1045,7 +1045,7 @@ bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
bool success = true;
// If you can't see the layer, don't render it.
if( is_approx_zero( net_color.mV[VW] ) )
if( is_approx_zero( net_color.mV[VALPHA] ) )
{
return success;
}
@ -1220,7 +1220,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const
{
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) );
}
else if (getInfo()->mFixedColor.mV[VW])
else if (getInfo()->mFixedColor.mV[VALPHA])
{
net_color->setVec( getInfo()->mFixedColor );
}
@ -1239,7 +1239,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const
return true;
}
if( getInfo()->mFixedColor.mV[VW] )
if( getInfo()->mFixedColor.mV[VALPHA] )
{
net_color->setVec( getInfo()->mFixedColor );
return true;
@ -1380,7 +1380,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
// Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
// Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO );
if ( !is_approx_equal(layer_color.mV[VW], 1.f) )
if ( !is_approx_equal(layer_color.mV[VALPHA], 1.f) )
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4fv(layer_color.mV);
@ -1486,8 +1486,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
// <FS:ND> Check invariants and allocate memory
llassert_always(textureH > 0);
llassert_always(textureW > 0);
llassert_always(textureH >= height);
llassert_always(textureW >= width);
llassert_always(textureH >= (U32)height);
llassert_always(textureW >= (U32)width);
llassert_always(x == 0);
llassert_always(y == 0);

View File

@ -482,10 +482,10 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
F32 weight = scaled_weight - index_start;
const LLColor4 *start = &info->mColors[ index_start ];
const LLColor4 *end = &info->mColors[ index_end ];
return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX],
(1.f - weight) * start->mV[VY] + weight * end->mV[VY],
(1.f - weight) * start->mV[VZ] + weight * end->mV[VZ],
(1.f - weight) * start->mV[VW] + weight * end->mV[VW]);
return LLColor4((1.f - weight) * start->mV[VRED] + weight * end->mV[VRED],
(1.f - weight) * start->mV[VGREEN] + weight * end->mV[VGREEN],
(1.f - weight) * start->mV[VBLUE] + weight * end->mV[VBLUE],
(1.f - weight) * start->mV[VALPHA] + weight * end->mV[VALPHA]);
}
}

View File

@ -1,5 +1,5 @@
/**********************************************************************
*
*
* StackWalker.cpp
* http://stackwalker.codeplex.com/
*
@ -13,14 +13,14 @@
* http://www.codeproject.com/threads/StackWalker.asp
* 2005-07-28 v2 - Changed the params of the constructor and ShowCallstack
* (to simplify the usage)
* 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL
* 2005-08-01 v3 - Changed to use 'CONTEXT_FULL' instead of CONTEXT_ALL
* (should also be enough)
* - Changed to compile correctly with the PSDK of VC7.0
* (GetFileVersionInfoSizeA and GetFileVersionInfoA is wrongly defined:
* it uses LPSTR instead of LPCSTR as first paremeter)
* - Added declarations to support VC5/6 without using 'dbghelp.h'
* - Added a 'pUserData' member to the ShowCallstack function and the
* PReadProcessMemoryRoutine declaration (to pass some user-defined data,
* - Added a 'pUserData' member to the ShowCallstack function and the
* PReadProcessMemoryRoutine declaration (to pass some user-defined data,
* which can be used in the readMemoryFunction-callback)
* 2005-08-02 v4 - OnSymInit now also outputs the OS-Version by default
* - Added example for doing an exception-callstack-walking in main.cpp
@ -60,26 +60,26 @@
* Copyright (c) 2005-2013, Jochen Kalmbach
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Jochen Kalmbach nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Jochen Kalmbach nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
**********************************************************************/
@ -234,7 +234,7 @@ DWORD64
// Some missing defines (for VC5/6):
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif
#endif
// secure-CRT_functions are only available starting with VC8
@ -396,7 +396,7 @@ public:
m_szSymPath = _strdup(szSymPath);
if (this->pSI(m_hProcess, m_szSymPath, FALSE) == FALSE)
this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0);
DWORD symOptions = this->pSGO(); // SymGetOptions
symOptions |= SYMOPT_LOAD_LINES;
symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS;
@ -512,11 +512,11 @@ struct IMAGEHLP_MODULE64_V2 {
tSSO pSSO;
// StackWalk64()
typedef BOOL (__stdcall *tSW)(
DWORD MachineType,
typedef BOOL (__stdcall *tSW)(
DWORD MachineType,
HANDLE hProcess,
HANDLE hThread,
LPSTACKFRAME64 StackFrame,
HANDLE hThread,
LPSTACKFRAME64 StackFrame,
PVOID ContextRecord,
PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine,
PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine,
@ -1012,7 +1012,7 @@ bool StackWalker::LoadModules()
// The following is used to pass the "userData"-Pointer to the user-provided readMemoryFunction
// This has to be done due to a problem with the "hProcess"-parameter in x64...
// Because this class is in no case multi-threading-enabled (because of the limitations
// Because this class is in no case multi-threading-enabled (because of the limitations
// of dbghelp.dll) it is "safe" to use a static-variable
static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL;
static LPVOID s_readMemoryFunction_UserData = NULL;
@ -1222,7 +1222,7 @@ bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
csEntry.symTypeString = NULL;
break;
}
MyStrCpy(csEntry.moduleName, STACKWALK_MAX_NAMELEN, Module.ModuleName);
csEntry.baseOfImage = Module.BaseOfImage;
MyStrCpy(csEntry.loadedImageName, STACKWALK_MAX_NAMELEN, Module.LoadedImageName);
@ -1243,7 +1243,7 @@ bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con
et = firstEntry;
bLastEntryCalled = false;
this->OnCallstackEntry(et, csEntry);
if (s.AddrReturn.Offset == 0)
{
bLastEntryCalled = true;
@ -1358,7 +1358,7 @@ void StackWalker::OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUser
ver.dwOSVersionInfoSize = sizeof(ver);
if (GetVersionExA(&ver) != FALSE)
{
_snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s)\n",
_snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s)\n",
ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,
ver.szCSDVersion);
if (m_verbose)
@ -1372,7 +1372,7 @@ void StackWalker::OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUser
ver.dwOSVersionInfoSize = sizeof(ver);
if (GetVersionExA( (OSVERSIONINFOA*) &ver) != FALSE)
{
_snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s) 0x%x-0x%x\n",
_snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "OS-Version: %d.%d.%d (%s) 0x%x-0x%x\n",
ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,
ver.szCSDVersion, ver.wSuiteMask, ver.wProductType);
if (m_verbose)

View File

@ -5,25 +5,25 @@
* @brief lltut.h uses is_approx_equal_fraction(). Moved to this header
* file in llcommon so we can use lltut.h for llcommon tests without
* making llcommon depend on llmath.
*
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/

View File

@ -116,7 +116,7 @@ void LLAlignedArray<T, alignment>::resize(U32 size)
template <class T, U32 alignment>
T& LLAlignedArray<T, alignment>::operator[](int idx)
{
if(idx >= mElementCount || idx < 0)
if (idx < 0 || unsigned(idx) >= mElementCount)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}
@ -126,7 +126,7 @@ T& LLAlignedArray<T, alignment>::operator[](int idx)
template <class T, U32 alignment>
const T& LLAlignedArray<T, alignment>::operator[](int idx) const
{
if (idx >= mElementCount || idx < 0)
if (idx < 0 || unsigned(idx) >= mElementCount)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}

View File

@ -31,64 +31,64 @@
#include <type_traits>
// Often used array indices
const U32 VX = 0;
const U32 VY = 1;
const U32 VZ = 2;
const U32 VW = 3;
const U32 VS = 3;
constexpr U32 VX = 0;
constexpr U32 VY = 1;
constexpr U32 VZ = 2;
constexpr U32 VW = 3;
constexpr U32 VS = 3;
const U32 VRED = 0;
const U32 VGREEN = 1;
const U32 VBLUE = 2;
const U32 VALPHA = 3;
constexpr U32 VRED = 0;
constexpr U32 VGREEN = 1;
constexpr U32 VBLUE = 2;
constexpr U32 VALPHA = 3;
const U32 INVALID_DIRECTION = 0xFFFFFFFF;
const U32 EAST = 0;
const U32 NORTH = 1;
const U32 WEST = 2;
const U32 SOUTH = 3;
constexpr U32 INVALID_DIRECTION = 0xFFFFFFFF;
constexpr U32 EAST = 0;
constexpr U32 NORTH = 1;
constexpr U32 WEST = 2;
constexpr U32 SOUTH = 3;
const U32 NORTHEAST = 4;
const U32 NORTHWEST = 5;
const U32 SOUTHWEST = 6;
const U32 SOUTHEAST = 7;
const U32 MIDDLE = 8;
constexpr U32 NORTHEAST = 4;
constexpr U32 NORTHWEST = 5;
constexpr U32 SOUTHWEST = 6;
constexpr U32 SOUTHEAST = 7;
constexpr U32 MIDDLE = 8;
const U8 EAST_MASK = 0x1<<EAST;
const U8 NORTH_MASK = 0x1<<NORTH;
const U8 WEST_MASK = 0x1<<WEST;
const U8 SOUTH_MASK = 0x1<<SOUTH;
constexpr U8 EAST_MASK = 0x1<<EAST;
constexpr U8 NORTH_MASK = 0x1<<NORTH;
constexpr U8 WEST_MASK = 0x1<<WEST;
constexpr U8 SOUTH_MASK = 0x1<<SOUTH;
const U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
const U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
const U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
const U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
constexpr U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
constexpr U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
constexpr U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
constexpr U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
const U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
const U32 gDirAdjacent[8][2] = {
{4, 7},
{4, 5},
{5, 6},
{6, 7},
{0, 1},
{1, 2},
{2, 3},
{0, 3}
};
constexpr U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
constexpr U32 gDirAdjacent[8][2] = {
{4, 7},
{4, 5},
{5, 6},
{6, 7},
{0, 1},
{1, 2},
{2, 3},
{0, 3}
};
// Magnitude along the x and y axis
const S32 gDirAxes[8][2] = {
{ 1, 0}, // east
{ 0, 1}, // north
{-1, 0}, // west
{ 0,-1}, // south
{ 1, 1}, // ne
{-1, 1}, // nw
{-1,-1}, // sw
{ 1,-1}, // se
};
constexpr S32 gDirAxes[8][2] = {
{ 1, 0}, // east
{ 0, 1}, // north
{-1, 0}, // west
{ 0,-1}, // south
{ 1, 1}, // ne
{-1, 1}, // nw
{-1,-1}, // sw
{ 1,-1}, // se
};
const S32 gDirMasks[8] = {
constexpr S32 gDirMasks[8] = {
EAST_MASK,
NORTH_MASK,
WEST_MASK,
@ -117,22 +117,22 @@ const S32 gDirMasks[8] = {
// | / -6- | /
// |/ / |/
// +------------------+
const U32 NO_SIDE = 0;
const U32 FRONT_SIDE = 1;
const U32 BACK_SIDE = 2;
const U32 LEFT_SIDE = 3;
const U32 RIGHT_SIDE = 4;
const U32 TOP_SIDE = 5;
const U32 BOTTOM_SIDE = 6;
constexpr U32 NO_SIDE = 0;
constexpr U32 FRONT_SIDE = 1;
constexpr U32 BACK_SIDE = 2;
constexpr U32 LEFT_SIDE = 3;
constexpr U32 RIGHT_SIDE = 4;
constexpr U32 TOP_SIDE = 5;
constexpr U32 BOTTOM_SIDE = 6;
const U8 LL_SOUND_FLAG_NONE = 0x0;
const U8 LL_SOUND_FLAG_LOOP = 1<<0;
const U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
const U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
const U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
const U8 LL_SOUND_FLAG_QUEUE = 1<<4;
const U8 LL_SOUND_FLAG_STOP = 1<<5;
const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
constexpr U8 LL_SOUND_FLAG_NONE = 0x0;
constexpr U8 LL_SOUND_FLAG_LOOP = 1<<0;
constexpr U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
constexpr U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
constexpr U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
constexpr U8 LL_SOUND_FLAG_QUEUE = 1<<4;
constexpr U8 LL_SOUND_FLAG_STOP = 1<<5;
constexpr U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
//
// *NOTE: These values may be used as hard-coded numbers in scanf() variants.
@ -141,17 +141,17 @@ const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYN
// DO NOT CHANGE.
// --------------
//
const U32 LL_MAX_PATH = 1024; // buffer size of maximum path + filename string length
constexpr U32 LL_MAX_PATH = 1024; // buffer size of maximum path + filename string length
// For strings we send in messages
const U32 STD_STRING_BUF_SIZE = 255; // Buffer size
const U32 STD_STRING_STR_LEN = 254; // Length of the string (not including \0)
constexpr U32 STD_STRING_BUF_SIZE = 255; // Buffer size
constexpr U32 STD_STRING_STR_LEN = 254; // Length of the string (not including \0)
// *NOTE: This value is used as hard-coded numbers in scanf() variants.
// DO NOT CHANGE.
const U32 MAX_STRING = STD_STRING_BUF_SIZE; // Buffer size
constexpr U32 MAX_STRING = STD_STRING_BUF_SIZE; // Buffer size
const U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + 1 for good luck
constexpr U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + 1 for good luck
// C++ is our friend. . . use template functions to make life easier!

View File

@ -233,7 +233,7 @@ public:
LL_DEBUGS("EventHost") << "Sending: "
<< static_cast<U64>(buffer.tellp()) << ':';
std::string::size_type truncate(80);
llssize truncate(80);
if (buffer.tellp() <= truncate)
{
LL_CONT << buffer.str();

View File

@ -4,7 +4,7 @@
* @date 2019-12-04
* @brief LLMainThreadTask dispatches work to the main thread. When invoked on
* the main thread, it performs the work inline.
*
*
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
* Copyright (c) 2019, Linden Research, Inc.
* $/LicenseInfo$

View File

@ -140,12 +140,7 @@
#if LL_MSVC
#pragma warning( disable : 4996 ) // warning: deprecated
// Linker optimization with "extern template" generates these warnings
#pragma warning( disable : 4231 ) // nonstandard extension used : 'extern' before template explicit instantiation
#pragma warning( disable : 4506 ) // no definition for inline function
// level 4 warnings that we need to disable:
#pragma warning (disable : 4100) // unreferenced formal parameter
#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
#pragma warning (disable : 4244) // possible loss of data on conversions
#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
@ -154,7 +149,6 @@
#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch
#endif // LL_MSVC

View File

@ -1,25 +1,25 @@
/**
/**
* @file llsdjson.cpp
* @brief LLSD flexible data system
*
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2015, 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$
*/

View File

@ -1,25 +1,25 @@
/**
/**
* @file llsdjson.cpp
* @brief LLSD flexible data system
*
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2015, 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$
*/
@ -36,10 +36,10 @@
#include "llsd.h"
#include <boost/json.hpp>
/// Convert a parsed JSON structure into LLSD maintaining member names and
/// Convert a parsed JSON structure into LLSD maintaining member names and
/// array indexes.
/// JSON/JavaScript types are converted as follows:
///
///
/// JSON Type | LLSD Type
/// --------------+--------------
/// null | undefined
@ -50,14 +50,14 @@
/// boolean | LLSD::Boolean
/// array | LLSD::Array
/// object | LLSD::Map
///
///
/// For maps and arrays child entries will be converted and added to the structure.
/// Order is preserved for an array but not for objects.
LLSD LlsdFromJson(const boost::json::value &val);
/// Convert an LLSD object into Parsed JSON object maintaining member names and
/// Convert an LLSD object into Parsed JSON object maintaining member names and
/// array indexs.
///
///
/// Types are converted as follows:
/// LLSD Type | JSON Type
/// --------------+----------------
@ -71,7 +71,7 @@ LLSD LlsdFromJson(const boost::json::value &val);
/// TypeUUID | string
/// TypeMap | object
/// TypeArray | array
/// TypeBinary | unsupported
/// TypeBinary | unsupported
boost::json::value LlsdToJson(const LLSD &val);
#endif // LL_LLSDJSON_H

View File

@ -1,24 +1,24 @@
/**
/**
* @file llsingleton.h
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/
@ -36,6 +36,10 @@
#include "llthread.h" // on_main_thread()
#include "llmainthreadtask.h"
#ifdef LL_WINDOWS
#pragma warning( disable : 4506 ) // no definition for inline function
#endif
class LLSingletonBase: private boost::noncopyable
{
public:
@ -868,7 +872,7 @@ private: \
// Relatively unsafe singleton implementation that is much faster
// and simpler than LLSingleton, but has no dependency tracking
// or inherent thread safety and requires manual invocation of
// or inherent thread safety and requires manual invocation of
// createInstance before first use.
template<class T>
class LLSimpleton

View File

@ -216,7 +216,7 @@ std::streamsize LLGenericStreamQueue<Ch>::skip(std::streamsize n)
{
typename BufferList::iterator bli(mBuffer.begin()), blend(mBuffer.end());
std::streamsize toskip(n), skipped(0);
while (bli != blend && toskip >= bli->length())
while (bli != blend && (size_t)toskip >= bli->length())
{
std::streamsize chunk(bli->length());
typename BufferList::iterator zap(bli++);

View File

@ -1,25 +1,25 @@
/**
/**
* @file llthread.h
* @brief Base classes for thread, mutex and condition handling.
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010-2013, 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$
*/
@ -55,10 +55,10 @@ public:
LLThread(const std::string& name, apr_pool_t *poolp = NULL);
virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state.
virtual void shutdown(); // stops the thread
bool isQuitting() const { return (QUITTING == mStatus); }
bool isStopped() const { return (STOPPED == mStatus) || (CRASHED == mStatus); }
bool isCrashed() const { return (CRASHED == mStatus); }
bool isCrashed() const { return (CRASHED == mStatus); }
// <FS:Beq> Try to encourage the inlining
static LL_FORCE_INLINE id_t currentID(){return std::this_thread::get_id();}; // Return ID of current thread
@ -91,11 +91,11 @@ public:
// internal state used by LLMutex. You must call this once early
// in the running thread to prevent collisions with the main thread.
static void registerThreadID();
private:
bool mPaused;
std::thread::native_handle_type mNativeHandle; // for termination in case of issues
// static function passed to APR thread creation routine
void threadRun();
@ -112,21 +112,21 @@ protected:
//a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used.
//Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes.
// otherwise it will cause severe memory leaking!!! --bao
LLVolatileAPRPool *mLocalAPRFilePoolp ;
LLVolatileAPRPool *mLocalAPRFilePoolp ;
void setQuitting();
// virtual function overridden by subclass -- this will be called when the thread runs
virtual void run(void) = 0;
virtual void run(void) = 0;
// virtual predicate function -- returns true if the thread should wake up, false if it should sleep.
virtual bool runCondition(void);
// Lock/Unlock Run Condition -- use around modification of any variable used in runCondition()
void lockData();
void unlockData();
// This is the predicate that decides whether the thread should sleep.
// This is the predicate that decides whether the thread should sleep.
// It should only be called with mDataLock locked, since the virtual runCondition() function may need to access
// data structures that are thread-unsafe.
bool shouldSleep(void) { return (mStatus == RUNNING) && (isPaused() || (!runCondition())); }

View File

@ -3,7 +3,7 @@
* @author Nat Goodspeed
* @date 2021-10-21
* @brief Implementation for threadpool.
*
*
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
* Copyright (c) 2021, Linden Research, Inc.
* $/LicenseInfo$

View File

@ -88,7 +88,7 @@ void HttpLibcurl::shutdown()
if (mMultiHandles)
{
for (int policy_class(0); policy_class < mPolicyCount; ++policy_class)
for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class)
{
if (mMultiHandles[policy_class])
{
@ -122,7 +122,7 @@ void HttpLibcurl::start(int policy_count)
mActiveHandles = new int [mPolicyCount];
mDirtyPolicy = new bool [mPolicyCount];
for (int policy_class(0); policy_class < mPolicyCount; ++policy_class)
for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class)
{
if (NULL == (mMultiHandles[policy_class] = curl_multi_init()))
{
@ -148,7 +148,7 @@ HttpService::ELoopSpeed HttpLibcurl::processTransport()
HttpService::ELoopSpeed ret(HttpService::REQUEST_SLEEP);
// Give libcurl some cycles to do I/O & callbacks
for (int policy_class(0); policy_class < mPolicyCount; ++policy_class)
for (unsigned int policy_class(0); policy_class < mPolicyCount; ++policy_class)
{
if (! mMultiHandles[policy_class])
{
@ -448,7 +448,7 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode
if (bFailed)
{
HttpPolicy & policy(mService->getPolicy());
for (int i = 0; i < mPolicyCount; ++ i)
for (unsigned int i = 0; i < mPolicyCount; ++ i)
{
HttpPolicyClass & options(policy.getClassOptions(i));
long lVal;
@ -500,14 +500,14 @@ int HttpLibcurl::getActiveCount() const
}
int HttpLibcurl::getActiveCountInClass(int policy_class) const
int HttpLibcurl::getActiveCountInClass(unsigned int policy_class) const
{
llassert_always(policy_class < mPolicyCount);
return mActiveHandles ? mActiveHandles[policy_class] : 0;
}
void HttpLibcurl::policyUpdated(int policy_class)
void HttpLibcurl::policyUpdated(unsigned int policy_class)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
if (policy_class < 0 || policy_class >= mPolicyCount || ! mMultiHandles)

View File

@ -107,7 +107,7 @@ public:
///
/// Threading: called by worker thread.
int getActiveCount() const;
int getActiveCountInClass(int policy_class) const;
int getActiveCountInClass(unsigned int policy_class) const;
/// Attempt to cancel a request identified by handle.
///
@ -124,7 +124,7 @@ public:
/// initialization and dynamic option setting.
///
/// Threading: called by worker thread.
void policyUpdated(int policy_class);
void policyUpdated(unsigned int policy_class);
/// Allocate a curl handle for caller. May be freed using
/// either the freeHandle() method or calling curl_easy_cleanup()
@ -211,7 +211,7 @@ protected:
HttpService * mService; // Simple reference, not owner
HandleCache mHandleCache; // Handle allocator, owner
active_set_t mActiveOps;
int mPolicyCount;
unsigned int mPolicyCount;
CURLM ** mMultiHandles; // One handle per policy class
int * mActiveHandles; // Active count per policy class
bool * mDirtyPolicy; // Dirty policy update waiting for stall (per pc)

View File

@ -1,28 +1,28 @@
/**
/**
* @file lldir_utils_objc.h
* @brief Definition of directory utilities class for macOS
*
* $LicenseInfo:firstyear=2020&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2020, 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$
*/
*/
#if !LL_DARWIN
#error This header must not be included when compiling for any target other than Mac OS. Consider including lldir.h instead.

View File

@ -781,9 +781,9 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
// Compute min and max counts minus tail
tail = llclampf(tail);
S32 total = cumulated_histo[255];
S32 min_c = (S32)((F32)(total) * tail);
S32 max_c = (S32)((F32)(total) * (1.0 - tail));
U32 total = cumulated_histo[255];
U32 min_c = (U32)((F32)(total) * tail);
U32 max_c = (U32)((F32)(total) * (1.0 - tail));
// Find min and max values
S32 min_v = 0;
@ -798,9 +798,9 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
}
// Compute linear lookup table
U8 linear_red_lut[256];
U8 linear_green_lut[256];
U8 linear_blue_lut[256];
U8 linear_red_lut[256]{};
U8 linear_green_lut[256]{};
U8 linear_blue_lut[256]{};
if (max_v == min_v)
{
// Degenerated binary split case
@ -850,16 +850,16 @@ void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
}
// Compute deltas
S32 total = cumulated_histo[255];
S32 delta_count = total / nb_classes;
S32 current_count = delta_count;
S32 delta_value = 256 / (nb_classes - 1);
S32 current_value = 0;
U32 total = cumulated_histo[255];
U32 delta_count = total / nb_classes;
U32 current_count = delta_count;
U32 delta_value = 256 / (nb_classes - 1);
U32 current_value = 0;
// Compute equalized lookup table
U8 equalize_red_lut[256];
U8 equalize_green_lut[256];
U8 equalize_blue_lut[256];
U8 equalize_red_lut[256]{};
U8 equalize_green_lut[256]{};
U8 equalize_blue_lut[256]{};
for (S32 i = 0; i < 256; i++)
{
// Blend in current_value with alpha values

View File

@ -477,7 +477,7 @@ bool LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, bool &alpha_opaqu
S32 pixels = getWidth() * getHeight();
if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - mDataOffset)
if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - (S32)mDataOffset)
{ //here we have situation when data size in src less than actually needed
return false;
}

View File

@ -175,7 +175,7 @@ static OPJ_OFF_T opj_skip(OPJ_OFF_T bytes, void* user_data)
JPEG2KBase* jpeg_codec = static_cast<JPEG2KBase*>(user_data);
jpeg_codec->offset += bytes;
if (jpeg_codec->offset > jpeg_codec->size)
if (jpeg_codec->offset > (OPJ_OFF_T)jpeg_codec->size)
{
jpeg_codec->offset = jpeg_codec->size;
// Indicate end of stream
@ -848,7 +848,7 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
S32 offset = dest;
for (S32 y = (height - 1); y >= 0; y--)
{
for (S32 x = 0; x < width; x++)
for (U32 x = 0; x < width; x++)
{
rawp[offset] = image->comps[comp].data[y*comp_width + x];
offset += channels;

View File

@ -112,10 +112,10 @@ const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 ho
const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours
const LLSettingsDay::Seconds LLSettingsDay::INVALID_DAYOFFSET(-1); // KC
const S32 LLSettingsDay::TRACK_WATER(0); // water track is 0
const S32 LLSettingsDay::TRACK_GROUND_LEVEL(1);
const S32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water
const S32 LLSettingsDay::FRAME_MAX(56);
const U32 LLSettingsDay::TRACK_WATER(0); // water track is 0
const U32 LLSettingsDay::TRACK_GROUND_LEVEL(1);
const U32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water
const U32 LLSettingsDay::FRAME_MAX(56);
const F32 LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR(0.02501f);

View File

@ -60,10 +60,10 @@ public:
static const Seconds MAXIMUM_DAYOFFSET;
static const Seconds INVALID_DAYOFFSET; // KC
static const S32 TRACK_WATER;
static const S32 TRACK_GROUND_LEVEL;
static const S32 TRACK_MAX;
static const S32 FRAME_MAX;
static const U32 TRACK_WATER;
static const U32 TRACK_GROUND_LEVEL;
static const U32 TRACK_MAX;
static const U32 FRAME_MAX;
static const F32 DEFAULT_FRAME_SLOP_FACTOR;

View File

@ -484,7 +484,7 @@ public:
S32 i = data->getBinIndex();
if (i >= 0 && i < getElementCount())
if (i >= 0 && i < (S32)getElementCount())
{
if (mData[i] == data)
{ //found it

View File

@ -427,7 +427,7 @@ public:
llassert(!branch->isLeaf()); // Empty leaf
}
for (S32 i = 0; i < branch->getChildCount(); ++i)
for (U32 i = 0; i < branch->getChildCount(); ++i)
{ //stretch by child extents
LLVolumeOctreeListener* child = (LLVolumeOctreeListener*) branch->getChild(i)->getListener(0);
min.setMin(min, child->mExtents[0]);
@ -2737,7 +2737,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
if (do_reverse_triangles)
{
for (U32 j = 0; j < face.mNumIndices; j += 3)
for (S32 j = 0; j < face.mNumIndices; j += 3)
{
// swap the 2nd and 3rd index
S32 swap = face.mIndices[j+1];
@ -2774,7 +2774,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
min_tc = face.mTexCoords[0];
max_tc = face.mTexCoords[0];
for (U32 j = 1; j < face.mNumVertices; ++j)
for (S32 j = 1; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, face.mTexCoords[j]);
}
@ -3899,7 +3899,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
LLVector4a* v = (LLVector4a*)face.mPositions;
LLVector4a* n = (LLVector4a*)face.mNormals;
for (U32 j = 0; j < face.mNumIndices / 3; j++)
for (S32 j = 0; j < face.mNumIndices / 3; j++)
{
for (S32 k = 0; k < 3; k++)
{
@ -4025,7 +4025,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
LLVector4a* v = (LLVector4a*) face.mPositions;
LLVector4a* n = (LLVector4a*) face.mNormals;
for (U32 j = 0; j < face.mNumIndices/3; j++)
for (S32 j = 0; j < face.mNumIndices/3; j++)
{
//approximate normal
S32 v1 = face.mIndices[j*3+0];
@ -4062,7 +4062,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
}
//for each triangle
for (U32 j = 0; j < face.mNumIndices/3; j++)
for (S32 j = 0; j < face.mNumIndices/3; j++)
{
if (fFacing[j] == (AWAY | TOWARDS))
{ //this is a degenerate triangle
@ -5115,7 +5115,7 @@ void LLVolumeFace::optimize(F32 angle_cutoff)
range.setSub(mExtents[1],mExtents[0]);
//remove redundant vertices
for (U32 i = 0; i < mNumIndices; ++i)
for (S32 i = 0; i < mNumIndices; ++i)
{
U16 index = mIndices[i];
@ -5501,7 +5501,7 @@ struct MikktData
LLVector3 inv_scale(1.f / face->mNormalizedScale.mV[0], 1.f / face->mNormalizedScale.mV[1], 1.f / face->mNormalizedScale.mV[2]);
for (int i = 0; i < face->mNumIndices; ++i)
for (S32 i = 0; i < face->mNumIndices; ++i)
{
U32 idx = face->mIndices[i];
@ -5620,11 +5620,11 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
allocateTangents(mNumVertices);
for (int i = 0; i < mNumIndices; ++i)
for (S32 i = 0; i < mNumIndices; ++i)
{
U32 src_idx = i;
U32 dst_idx = remap[i];
if (dst_idx >= mNumVertices)
if (dst_idx >= (U32)mNumVertices)
{
dst_idx = mNumVertices - 1;
// Shouldn't happen, figure out what gets returned in remap and why.
@ -5651,7 +5651,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
scale.load3(mNormalizedScale.mV);
scale.getF32ptr()[3] = 1.f;
for (int i = 0; i < mNumVertices; ++i)
for (S32 i = 0; i < mNumVertices; ++i)
{
mPositions[i].mul(inv_scale);
mNormals[i].mul(scale);
@ -6519,7 +6519,7 @@ void LLVolumeFace::createTangents()
CalculateTangentArray(mNumVertices, mPositions, mNormals, mTexCoords, mNumIndices / 3, mIndices, mTangents);
//normalize normals
for (U32 i = 0; i < mNumVertices; i++)
for (S32 i = 0; i < mNumVertices; i++)
{
//bump map/planar projection code requires normals to be normalized
mNormals[i].normalize3fast();
@ -6791,7 +6791,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build)
{
// Get s value for tex-coord.
S32 index = mBeginS + s;
if (index >= profile.size())
if (index >= (S32)profile.size())
{
// edge?
ss = flat ? 1.f - begin_stex : 1.f;

View File

@ -113,7 +113,7 @@ void LLOctreeTriangleRayIntersect::traverse(const LLOctreeNode<LLVolumeTriangle,
if (LLLineSegmentBoxIntersect(mStart, mEnd, vl->mBounds[0], vl->mBounds[1]))
{
node->accept(this);
for (S32 i = 0; i < node->getChildCount(); ++i)
for (U32 i = 0; i < node->getChildCount(); ++i)
{
traverse(node->getChild(i));
}

View File

@ -49,23 +49,23 @@ namespace tut
void v4color_object::test<1>()
{
LLColor4 llcolor4;
ensure("1:LLColor4:Fail to initialize ", ((0 == llcolor4.mV[VX]) && (0 == llcolor4.mV[VY]) && (0 == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
ensure("1:LLColor4:Fail to initialize ", ((0 == llcolor4.mV[VRED]) && (0 == llcolor4.mV[VGREEN]) && (0 == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
F32 r = 0x20, g = 0xFFFF, b = 0xFF, a = 0xAF;
LLColor4 llcolor4a(r,g,b);
ensure("2:LLColor4:Fail to initialize ", ((r == llcolor4a.mV[VX]) && (g == llcolor4a.mV[VY]) && (b == llcolor4a.mV[VZ])&& (1.0f == llcolor4a.mV[VW])));
ensure("2:LLColor4:Fail to initialize ", ((r == llcolor4a.mV[VRED]) && (g == llcolor4a.mV[VGREEN]) && (b == llcolor4a.mV[VBLUE])&& (1.0f == llcolor4a.mV[VALPHA])));
LLColor4 llcolor4b(r,g,b,a);
ensure("3:LLColor4:Fail to initialize ", ((r == llcolor4b.mV[VX]) && (g == llcolor4b.mV[VY]) && (b == llcolor4b.mV[VZ])&& (a == llcolor4b.mV[VW])));
ensure("3:LLColor4:Fail to initialize ", ((r == llcolor4b.mV[VRED]) && (g == llcolor4b.mV[VGREEN]) && (b == llcolor4b.mV[VBLUE])&& (a == llcolor4b.mV[VALPHA])));
const F32 vec[4] = {.112f ,23.2f, -4.2f, -.0001f};
LLColor4 llcolor4c(vec);
ensure("4:LLColor4:Fail to initialize ", ((vec[0] == llcolor4c.mV[VX]) && (vec[1] == llcolor4c.mV[VY]) && (vec[2] == llcolor4c.mV[VZ])&& (vec[3] == llcolor4c.mV[VW])));
ensure("4:LLColor4:Fail to initialize ", ((vec[0] == llcolor4c.mV[VRED]) && (vec[1] == llcolor4c.mV[VGREEN]) && (vec[2] == llcolor4c.mV[VBLUE])&& (vec[3] == llcolor4c.mV[VALPHA])));
LLColor3 llcolor3(-2.23f,1.01f,42.3f);
F32 val = -.1f;
LLColor4 llcolor4d(llcolor3,val);
ensure("5:LLColor4:Fail to initialize ", ((llcolor3.mV[VX] == llcolor4d.mV[VX]) && (llcolor3.mV[VY] == llcolor4d.mV[VY]) && (llcolor3.mV[VZ] == llcolor4d.mV[VZ])&& (val == llcolor4d.mV[VW])));
ensure("5:LLColor4:Fail to initialize ", ((llcolor3.mV[VRED] == llcolor4d.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4d.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4d.mV[VBLUE])&& (val == llcolor4d.mV[VALPHA])));
LLSD sd = llcolor4d.getValue();
LLColor4 llcolor4e(sd);
@ -76,7 +76,7 @@ namespace tut
LLColor4 llcolor4g(color4u);
const F32 SCALE = 1.f/255.f;
F32 r2 = r1*SCALE, g2 = g1* SCALE, b2 = b1* SCALE;
ensure("7:LLColor4:Fail to initialize ", ((r2 == llcolor4g.mV[VX]) && (g2 == llcolor4g.mV[VY]) && (b2 == llcolor4g.mV[VZ])));
ensure("7:LLColor4:Fail to initialize ", ((r2 == llcolor4g.mV[VRED]) && (g2 == llcolor4g.mV[VGREEN]) && (b2 == llcolor4g.mV[VBLUE])));
}
template<> template<>
@ -98,10 +98,10 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF,a = 0xAF;
LLColor4 llcolor4(r,g,b,a);
llcolor4.setToBlack();
ensure("setToBlack:Fail to set the black ", ((0 == llcolor4.mV[VX]) && (0 == llcolor4.mV[VY]) && (0 == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
ensure("setToBlack:Fail to set the black ", ((0 == llcolor4.mV[VRED]) && (0 == llcolor4.mV[VGREEN]) && (0 == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
llcolor4.setToWhite();
ensure("setToWhite:Fail to set the white ", ((1.f == llcolor4.mV[VX]) && (1.f == llcolor4.mV[VY]) && (1.f == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
ensure("setToWhite:Fail to set the white ", ((1.f == llcolor4.mV[VRED]) && (1.f == llcolor4.mV[VGREEN]) && (1.f == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
}
template<> template<>
@ -110,10 +110,10 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF, a = 0xAF;
LLColor4 llcolor4;
llcolor4.setVec(r,g,b);
ensure("1:setVec:Fail to set the values ", ((r == llcolor4.mV[VX]) && (g == llcolor4.mV[VY]) && (b == llcolor4.mV[VZ])&& (1.f == llcolor4.mV[VW])));
ensure("1:setVec:Fail to set the values ", ((r == llcolor4.mV[VRED]) && (g == llcolor4.mV[VGREEN]) && (b == llcolor4.mV[VBLUE])&& (1.f == llcolor4.mV[VALPHA])));
llcolor4.setVec(r,g,b,a);
ensure("2:setVec:Fail to set the values ", ((r == llcolor4.mV[VX]) && (g == llcolor4.mV[VY]) && (b == llcolor4.mV[VZ])&& (a == llcolor4.mV[VW])));
ensure("2:setVec:Fail to set the values ", ((r == llcolor4.mV[VRED]) && (g == llcolor4.mV[VGREEN]) && (b == llcolor4.mV[VBLUE])&& (a == llcolor4.mV[VALPHA])));
LLColor4 llcolor4a;
llcolor4a.setVec(llcolor4);
@ -121,23 +121,23 @@ namespace tut
LLColor3 llcolor3(-2.23f,1.01f,42.3f);
llcolor4a.setVec(llcolor3);
ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VX] == llcolor4a.mV[VX]) && (llcolor3.mV[VY] == llcolor4a.mV[VY]) && (llcolor3.mV[VZ] == llcolor4a.mV[VZ])));
ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VRED] == llcolor4a.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4a.mV[VBLUE])));
F32 val = -.33f;
llcolor4a.setVec(llcolor3,val);
ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VX] == llcolor4a.mV[VX]) && (llcolor3.mV[VY] == llcolor4a.mV[VY]) && (llcolor3.mV[VZ] == llcolor4a.mV[VZ]) && (val == llcolor4a.mV[VW])));
ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VRED] == llcolor4a.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4a.mV[VBLUE]) && (val == llcolor4a.mV[VALPHA])));
const F32 vec[4] = {.112f ,23.2f, -4.2f, -.0001f};
LLColor4 llcolor4c;
llcolor4c.setVec(vec);
ensure("5:setVec:Fail to initialize ", ((vec[0] == llcolor4c.mV[VX]) && (vec[1] == llcolor4c.mV[VY]) && (vec[2] == llcolor4c.mV[VZ])&& (vec[3] == llcolor4c.mV[VW])));
ensure("5:setVec:Fail to initialize ", ((vec[0] == llcolor4c.mV[VRED]) && (vec[1] == llcolor4c.mV[VGREEN]) && (vec[2] == llcolor4c.mV[VBLUE])&& (vec[3] == llcolor4c.mV[VALPHA])));
U8 r1 = 0xF2, g1 = 0xFA, b1= 0xBF;
LLColor4U color4u(r1,g1,b1);
llcolor4.setVec(color4u);
const F32 SCALE = 1.f/255.f;
F32 r2 = r1*SCALE, g2 = g1* SCALE, b2 = b1* SCALE;
ensure("6:setVec:Fail to initialize ", ((r2 == llcolor4.mV[VX]) && (g2 == llcolor4.mV[VY]) && (b2 == llcolor4.mV[VZ])));
ensure("6:setVec:Fail to initialize ", ((r2 == llcolor4.mV[VRED]) && (g2 == llcolor4.mV[VGREEN]) && (b2 == llcolor4.mV[VBLUE])));
}
template<> template<>
@ -146,7 +146,7 @@ namespace tut
F32 alpha = 0xAF;
LLColor4 llcolor4;
llcolor4.setAlpha(alpha);
ensure("setAlpha:Fail to initialize ", (alpha == llcolor4.mV[VW]));
ensure("setAlpha:Fail to initialize ", (alpha == llcolor4.mV[VALPHA]));
}
template<> template<>
@ -209,7 +209,7 @@ namespace tut
LLColor3 llcolor3(r,g,b);
LLColor4 llcolor4a,llcolor4b;
llcolor4a = llcolor3;
ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VX]) && (llcolor3.mV[1] == llcolor4a.mV[VY]) && (llcolor3.mV[2] == llcolor4a.mV[VZ])));
ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VRED]) && (llcolor3.mV[1] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[2] == llcolor4a.mV[VBLUE])));
LLSD sd = llcolor4a.getValue();
llcolor4b = LLColor4(sd);
ensure_equals("Operator= LLSD:Fail ", llcolor4a, llcolor4b);
@ -234,10 +234,10 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4b + llcolor4a;
ensure("operator+:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4c.mV[VX]) && is_approx_equal(g1+g2,llcolor4c.mV[VY]) && is_approx_equal(b1+b2,llcolor4c.mV[VZ])));
ensure("operator+:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4c.mV[VRED]) && is_approx_equal(g1+g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1+b2,llcolor4c.mV[VBLUE])));
llcolor4b += llcolor4a;
ensure("operator+=:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4b.mV[VX]) && is_approx_equal(g1+g2,llcolor4b.mV[VY]) && is_approx_equal(b1+b2,llcolor4b.mV[VZ])));
ensure("operator+=:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4b.mV[VRED]) && is_approx_equal(g1+g2,llcolor4b.mV[VGREEN]) && is_approx_equal(b1+b2,llcolor4b.mV[VBLUE])));
}
template<> template<>
@ -247,10 +247,10 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4a - llcolor4b;
ensure("operator-:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4c.mV[VX]) && is_approx_equal(g1-g2,llcolor4c.mV[VY]) && is_approx_equal(b1-b2,llcolor4c.mV[VZ])));
ensure("operator-:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4c.mV[VRED]) && is_approx_equal(g1-g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1-b2,llcolor4c.mV[VBLUE])));
llcolor4a -= llcolor4b;
ensure("operator-=:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4a.mV[VX]) && is_approx_equal(g1-g2,llcolor4a.mV[VY]) && is_approx_equal(b1-b2,llcolor4a.mV[VZ])));
ensure("operator-=:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4a.mV[VRED]) && is_approx_equal(g1-g2,llcolor4a.mV[VGREEN]) && is_approx_equal(b1-b2,llcolor4a.mV[VBLUE])));
}
template<> template<>
@ -260,20 +260,20 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4a * llcolor4b;
ensure("1:operator*:Fail to multiply the values", (is_approx_equal(r1*r2,llcolor4c.mV[VX]) && is_approx_equal(g1*g2,llcolor4c.mV[VY]) && is_approx_equal(b1*b2,llcolor4c.mV[VZ])));
ensure("1:operator*:Fail to multiply the values", (is_approx_equal(r1*r2,llcolor4c.mV[VRED]) && is_approx_equal(g1*g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*b2,llcolor4c.mV[VBLUE])));
F32 mulVal = 3.33f;
llcolor4c = llcolor4a * mulVal;
ensure("2:operator*:Fail ", (is_approx_equal(r1*mulVal,llcolor4c.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VZ])));
ensure("2:operator*:Fail ", (is_approx_equal(r1*mulVal,llcolor4c.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VBLUE])));
llcolor4c = mulVal * llcolor4a;
ensure("3:operator*:Fail to multiply the values", (is_approx_equal(r1*mulVal,llcolor4c.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VZ])));
ensure("3:operator*:Fail to multiply the values", (is_approx_equal(r1*mulVal,llcolor4c.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VBLUE])));
llcolor4a *= mulVal;
ensure("4:operator*=:Fail to multiply the values ", (is_approx_equal(r1*mulVal,llcolor4a.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4a.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4a.mV[VZ])));
ensure("4:operator*=:Fail to multiply the values ", (is_approx_equal(r1*mulVal,llcolor4a.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4a.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4a.mV[VBLUE])));
LLColor4 llcolor4d(r1,g1,b1),llcolor4e(r2,g2,b2);
llcolor4e *= llcolor4d;
ensure("5:operator*=:Fail to multiply the values ", (is_approx_equal(r1*r2,llcolor4e.mV[VX]) && is_approx_equal(g1*g2,llcolor4e.mV[VY]) && is_approx_equal(b1*b2,llcolor4e.mV[VZ])));
ensure("5:operator*=:Fail to multiply the values ", (is_approx_equal(r1*r2,llcolor4e.mV[VRED]) && is_approx_equal(g1*g2,llcolor4e.mV[VGREEN]) && is_approx_equal(b1*b2,llcolor4e.mV[VBLUE])));
}
template<> template<>
@ -283,13 +283,13 @@ namespace tut
F32 div = 12.345f;
LLColor4 llcolor4a(r,g,b,a),llcolor4b;
llcolor4b = llcolor4a % div;//chnage only alpha value nor r,g,b;
ensure("1operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VX]) && is_approx_equal(g,llcolor4b.mV[VY]) && is_approx_equal(b,llcolor4b.mV[VZ])&& is_approx_equal(div*a,llcolor4b.mV[VW])));
ensure("1operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VRED]) && is_approx_equal(g,llcolor4b.mV[VGREEN]) && is_approx_equal(b,llcolor4b.mV[VBLUE])&& is_approx_equal(div*a,llcolor4b.mV[VALPHA])));
llcolor4b = div % llcolor4a;
ensure("2operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VX]) && is_approx_equal(g,llcolor4b.mV[VY]) && is_approx_equal(b,llcolor4b.mV[VZ])&& is_approx_equal(div*a,llcolor4b.mV[VW])));
ensure("2operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VRED]) && is_approx_equal(g,llcolor4b.mV[VGREEN]) && is_approx_equal(b,llcolor4b.mV[VBLUE])&& is_approx_equal(div*a,llcolor4b.mV[VALPHA])));
llcolor4a %= div;
ensure("operator%=:Fail ", (is_approx_equal(a*div,llcolor4a.mV[VW])));
ensure("operator%=:Fail ", (is_approx_equal(a*div,llcolor4a.mV[VALPHA])));
}
template<> template<>
@ -312,7 +312,7 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF;
LLColor4 llcolor4a(r,g,b),llcolor4b;
LLColor3 llcolor3 = vec4to3(llcolor4a);
ensure("vec4to3:Fail to convert vec4 to vec3 ", (is_approx_equal(llcolor3.mV[VX],llcolor4a.mV[VX]) && is_approx_equal(llcolor3.mV[VY],llcolor4a.mV[VY]) && is_approx_equal(llcolor3.mV[VZ],llcolor4a.mV[VZ])));
ensure("vec4to3:Fail to convert vec4 to vec3 ", (is_approx_equal(llcolor3.mV[VRED],llcolor4a.mV[VRED]) && is_approx_equal(llcolor3.mV[VGREEN],llcolor4a.mV[VGREEN]) && is_approx_equal(llcolor3.mV[VBLUE],llcolor4a.mV[VBLUE])));
llcolor4b = vec3to4(llcolor3);
ensure_equals("vec3to4:Fail to convert vec3 to vec4 ", llcolor4b, llcolor4a);
}
@ -324,7 +324,7 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = lerp(llcolor4a,llcolor4b,val);
ensure("lerp:Fail ", (is_approx_equal(r1 + (r2 - r1)* val,llcolor4c.mV[VX]) && is_approx_equal(g1 + (g2 - g1)* val,llcolor4c.mV[VY]) && is_approx_equal(b1 + (b2 - b1)* val,llcolor4c.mV[VZ])));
ensure("lerp:Fail ", (is_approx_equal(r1 + (r2 - r1)* val,llcolor4c.mV[VRED]) && is_approx_equal(g1 + (g2 - g1)* val,llcolor4c.mV[VGREEN]) && is_approx_equal(b1 + (b2 - b1)* val,llcolor4c.mV[VBLUE])));
}
template<> template<>

View File

@ -48,18 +48,18 @@ namespace tut
void v4coloru_object::test<1>()
{
LLColor4U llcolor4u;
ensure("1:LLColor4u:Fail to initialize ", ((0 == llcolor4u.mV[VX]) && (0 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
ensure("1:LLColor4u:Fail to initialize ", ((0 == llcolor4u.mV[VRED]) && (0 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u1(r,g,b);
ensure("2:LLColor4u:Fail to initialize ", ((r == llcolor4u1.mV[VX]) && (g == llcolor4u1.mV[VY]) && (b == llcolor4u1.mV[VZ])&& (255 == llcolor4u1.mV[VW])));
ensure("2:LLColor4u:Fail to initialize ", ((r == llcolor4u1.mV[VRED]) && (g == llcolor4u1.mV[VGREEN]) && (b == llcolor4u1.mV[VBLUE])&& (255 == llcolor4u1.mV[VALPHA])));
LLColor4U llcolor4u2(r,g,b,a);
ensure("3:LLColor4u:Fail to initialize ", ((r == llcolor4u2.mV[VX]) && (g == llcolor4u2.mV[VY]) && (b == llcolor4u2.mV[VZ])&& (a == llcolor4u2.mV[VW])));
ensure("3:LLColor4u:Fail to initialize ", ((r == llcolor4u2.mV[VRED]) && (g == llcolor4u2.mV[VGREEN]) && (b == llcolor4u2.mV[VBLUE])&& (a == llcolor4u2.mV[VALPHA])));
const U8 vec[4] = {0x12,0xFF,0xAF,0x23};
LLColor4U llcolor4u3(vec);
ensure("4:LLColor4u:Fail to initialize ", ((vec[0] == llcolor4u3.mV[VX]) && (vec[1] == llcolor4u3.mV[VY]) && (vec[2] == llcolor4u3.mV[VZ])&& (vec[3] == llcolor4u3.mV[VW])));
ensure("4:LLColor4u:Fail to initialize ", ((vec[0] == llcolor4u3.mV[VRED]) && (vec[1] == llcolor4u3.mV[VGREEN]) && (vec[2] == llcolor4u3.mV[VBLUE])&& (vec[3] == llcolor4u3.mV[VALPHA])));
LLSD sd = llcolor4u3.getValue();
LLColor4U llcolor4u4(sd);
@ -82,10 +82,10 @@ namespace tut
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u(r,g,b,a);
llcolor4u.setToBlack();
ensure("setToBlack:Fail to set black ", ((0 == llcolor4u.mV[VX]) && (0 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
ensure("setToBlack:Fail to set black ", ((0 == llcolor4u.mV[VRED]) && (0 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
llcolor4u.setToWhite();
ensure("setToWhite:Fail to white ", ((255 == llcolor4u.mV[VX]) && (255 == llcolor4u.mV[VY]) && (255 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
ensure("setToWhite:Fail to white ", ((255 == llcolor4u.mV[VRED]) && (255 == llcolor4u.mV[VGREEN]) && (255 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
}
template<> template<>
@ -104,11 +104,11 @@ namespace tut
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u;
llcolor4u.setVec(r,g,b,a);
ensure("1:setVec:Fail to set the values ", ((r == llcolor4u.mV[VX]) && (g == llcolor4u.mV[VY]) && (b == llcolor4u.mV[VZ])&& (a == llcolor4u.mV[VW])));
ensure("1:setVec:Fail to set the values ", ((r == llcolor4u.mV[VRED]) && (g == llcolor4u.mV[VGREEN]) && (b == llcolor4u.mV[VBLUE])&& (a == llcolor4u.mV[VALPHA])));
llcolor4u.setToBlack();
llcolor4u.setVec(r,g,b);
ensure("2:setVec:Fail to set the values ", ((r == llcolor4u.mV[VX]) && (g == llcolor4u.mV[VY]) && (b == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
ensure("2:setVec:Fail to set the values ", ((r == llcolor4u.mV[VRED]) && (g == llcolor4u.mV[VGREEN]) && (b == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
LLColor4U llcolor4u1;
llcolor4u1.setVec(llcolor4u);
@ -117,7 +117,7 @@ namespace tut
const U8 vec[4] = {0x12,0xFF,0xAF,0x23};
LLColor4U llcolor4u2;
llcolor4u2.setVec(vec);
ensure("4:setVec:Fail to set the values ", ((vec[0] == llcolor4u2.mV[VX]) && (vec[1] == llcolor4u2.mV[VY]) && (vec[2] == llcolor4u2.mV[VZ])&& (vec[3] == llcolor4u2.mV[VW])));
ensure("4:setVec:Fail to set the values ", ((vec[0] == llcolor4u2.mV[VRED]) && (vec[1] == llcolor4u2.mV[VGREEN]) && (vec[2] == llcolor4u2.mV[VBLUE])&& (vec[3] == llcolor4u2.mV[VALPHA])));
}
template<> template<>
@ -126,7 +126,7 @@ namespace tut
U8 alpha = 0x12;
LLColor4U llcolor4u;
llcolor4u.setAlpha(alpha);
ensure("setAlpha:Fail to set alpha value ", (alpha == llcolor4u.mV[VW]));
ensure("setAlpha:Fail to set alpha value ", (alpha == llcolor4u.mV[VALPHA]));
}
template<> template<>
@ -159,29 +159,29 @@ namespace tut
llcolor4u3 = llcolor4u1 + llcolor4u2;
ensure_equals(
"1a.operator+:Fail to Add the values ",
llcolor4u3.mV[VX],
llcolor4u3.mV[VRED],
(U8)(r1+r2));
ensure_equals(
"1b.operator+:Fail to Add the values ",
llcolor4u3.mV[VY],
llcolor4u3.mV[VGREEN],
(U8)(g1+g2));
ensure_equals(
"1c.operator+:Fail to Add the values ",
llcolor4u3.mV[VZ],
llcolor4u3.mV[VBLUE],
(U8)(b1+b2));
llcolor4u2 += llcolor4u1;
ensure_equals(
"2a.operator+=:Fail to Add the values ",
llcolor4u2.mV[VX],
llcolor4u2.mV[VRED],
(U8)(r1+r2));
ensure_equals(
"2b.operator+=:Fail to Add the values ",
llcolor4u2.mV[VY],
llcolor4u2.mV[VGREEN],
(U8)(g1+g2));
ensure_equals(
"2c.operator+=:Fail to Add the values ",
llcolor4u2.mV[VZ],
llcolor4u2.mV[VBLUE],
(U8)(b1+b2));
}
@ -194,29 +194,29 @@ namespace tut
llcolor4u3 = llcolor4u1 - llcolor4u2;
ensure_equals(
"1a. operator-:Fail to Add the values ",
llcolor4u3.mV[VX],
llcolor4u3.mV[VRED],
(U8)(r1-r2));
ensure_equals(
"1b. operator-:Fail to Add the values ",
llcolor4u3.mV[VY],
llcolor4u3.mV[VGREEN],
(U8)(g1-g2));
ensure_equals(
"1c. operator-:Fail to Add the values ",
llcolor4u3.mV[VZ],
llcolor4u3.mV[VBLUE],
(U8)(b1-b2));
llcolor4u1 -= llcolor4u2;
ensure_equals(
"2a. operator-=:Fail to Add the values ",
llcolor4u1.mV[VX],
llcolor4u1.mV[VRED],
(U8)(r1-r2));
ensure_equals(
"2b. operator-=:Fail to Add the values ",
llcolor4u1.mV[VY],
llcolor4u1.mV[VGREEN],
(U8)(g1-g2));
ensure_equals(
"2c. operator-=:Fail to Add the values ",
llcolor4u1.mV[VZ],
llcolor4u1.mV[VBLUE],
(U8)(b1-b2));
}
@ -229,30 +229,30 @@ namespace tut
llcolor4u3 = llcolor4u1 * llcolor4u2;
ensure_equals(
"1a. operator*:Fail to multiply the values",
llcolor4u3.mV[VX],
llcolor4u3.mV[VRED],
(U8)(r1*r2));
ensure_equals(
"1b. operator*:Fail to multiply the values",
llcolor4u3.mV[VY],
llcolor4u3.mV[VGREEN],
(U8)(g1*g2));
ensure_equals(
"1c. operator*:Fail to multiply the values",
llcolor4u3.mV[VZ],
llcolor4u3.mV[VBLUE],
(U8)(b1*b2));
U8 mulVal = 123;
llcolor4u1 *= mulVal;
ensure_equals(
"2a. operator*=:Fail to multiply the values",
llcolor4u1.mV[VX],
llcolor4u1.mV[VRED],
(U8)(r1*mulVal));
ensure_equals(
"2b. operator*=:Fail to multiply the values",
llcolor4u1.mV[VY],
llcolor4u1.mV[VGREEN],
(U8)(g1*mulVal));
ensure_equals(
"2c. operator*=:Fail to multiply the values",
llcolor4u1.mV[VZ],
llcolor4u1.mV[VBLUE],
(U8)(b1*mulVal));
}
@ -274,7 +274,7 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a);
U8 modVal = 45;
llcolor4u %= modVal;
ensure_equals("operator%=:Fail ", llcolor4u.mV[VW], (U8)(a * modVal));
ensure_equals("operator%=:Fail ", llcolor4u.mV[VALPHA], (U8)(a * modVal));
}
template<> template<>
@ -284,7 +284,7 @@ namespace tut
LLColor4U llcolor4u1(r,g,b,a);
std::string color("12, 23, 132, 50");
LLColor4U::parseColor4U(color, &llcolor4u1);
ensure("parseColor4U() failed to parse the color value ", ((12 == llcolor4u1.mV[VX]) && (23 == llcolor4u1.mV[VY]) && (132 == llcolor4u1.mV[VZ])&& (50 == llcolor4u1.mV[VW])));
ensure("parseColor4U() failed to parse the color value ", ((12 == llcolor4u1.mV[VRED]) && (23 == llcolor4u1.mV[VGREEN]) && (132 == llcolor4u1.mV[VBLUE])&& (50 == llcolor4u1.mV[VALPHA])));
color = "12, 23, 132";
ensure("2:parseColor4U() failed to parse the color value ", (false == LLColor4U::parseColor4U(color, &llcolor4u1)));
@ -300,8 +300,8 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a),llcolor4u1;
const F32 fVal = 3.f;
llcolor4u1 = llcolor4u.multAll(fVal);
ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY]
&& ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW])));
ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VRED]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VGREEN]
&& ((U8)ll_round(b * fVal) == llcolor4u1.mV[VBLUE])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VALPHA])));
}
template<> template<>
@ -311,13 +311,13 @@ namespace tut
U8 r2 = 23, g2 = 230, b2 = 124, a2 = 255;
LLColor4U llcolor4u(r1,g1,b1,a1),llcolor4u1(r2,g2,b2,a2);
llcolor4u1 = llcolor4u1.addClampMax(llcolor4u);
ensure("1:addClampMax():Fail to add the value ", ((r1+r2 == llcolor4u1.mV[VX]) && (255 == llcolor4u1.mV[VY]) && (b1+b2 == llcolor4u1.mV[VZ])&& (255 == llcolor4u1.mV[VW])));
ensure("1:addClampMax():Fail to add the value ", ((r1+r2 == llcolor4u1.mV[VRED]) && (255 == llcolor4u1.mV[VGREEN]) && (b1+b2 == llcolor4u1.mV[VBLUE])&& (255 == llcolor4u1.mV[VALPHA])));
r1 = 132, g1 = 3, b1 = 3, a1 = 2;
r2 = 123, g2 = 230, b2 = 154, a2 = 25;
LLColor4U llcolor4u2(r1,g1,b1,a1),llcolor4u3(r2,g2,b2,a2);
llcolor4u3 = llcolor4u3.addClampMax(llcolor4u2);
ensure("2:addClampMax():Fail to add the value ", ((255 == llcolor4u3.mV[VX]) && (g1+g2 == llcolor4u3.mV[VY]) && (b1+b2 == llcolor4u3.mV[VZ])&& (a1+a2 == llcolor4u3.mV[VW])));
ensure("2:addClampMax():Fail to add the value ", ((255 == llcolor4u3.mV[VRED]) && (g1+g2 == llcolor4u3.mV[VGREEN]) && (b1+b2 == llcolor4u3.mV[VBLUE])&& (a1+a2 == llcolor4u3.mV[VALPHA])));
}
template<> template<>
@ -331,6 +331,6 @@ namespace tut
F32 color_scale_factor = MAX_COLOR/r;
S32 r2 = ll_round(r * color_scale_factor);
S32 g2 = ll_round(g * color_scale_factor);
ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VRED]) && (g2 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
}
}

View File

@ -63,7 +63,7 @@ const LLColor3& LLColor3::operator=(const LLColor4 &a)
std::ostream& operator<<(std::ostream& s, const LLColor3 &a)
{
s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << " }";
s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << " }";
return s;
}

View File

@ -198,17 +198,17 @@ inline LLColor3::LLColor3(void)
inline LLColor3::LLColor3(F32 r, F32 g, F32 b)
{
mV[VX] = r;
mV[VY] = g;
mV[VZ] = b;
mV[VRED] = r;
mV[VGREEN] = g;
mV[VBLUE] = b;
}
inline LLColor3::LLColor3(const F32 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
}
#if LL_WINDOWS
@ -228,11 +228,11 @@ inline LLColor3::LLColor3(const char* color_string) // takes a string of format
char tempstr[7];
strncpy(tempstr,color_string,6); /* Flawfinder: ignore */
tempstr[6] = '\0';
mV[VZ] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
mV[VBLUE] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
tempstr[4] = '\0';
mV[VY] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
mV[VGREEN] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
tempstr[2] = '\0';
mV[VX] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
mV[VRED] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
}
inline const LLColor3& LLColor3::setToBlack(void)

View File

@ -136,57 +136,57 @@ LLColor4::operator LLColor4U() const
LLColor4::LLColor4(const LLColor3 &vec, F32 a)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = a;
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = a;
}
LLColor4::LLColor4(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
mV[VX] = color4u.mV[VX] * SCALE;
mV[VY] = color4u.mV[VY] * SCALE;
mV[VZ] = color4u.mV[VZ] * SCALE;
mV[VW] = color4u.mV[VW] * SCALE;
mV[VRED] = color4u.mV[VRED] * SCALE;
mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
}
LLColor4::LLColor4(const LLVector4& vector4)
{
mV[VX] = vector4.mV[VX];
mV[VY] = vector4.mV[VY];
mV[VZ] = vector4.mV[VZ];
mV[VW] = vector4.mV[VW];
mV[VRED] = vector4.mV[VRED];
mV[VGREEN] = vector4.mV[VGREEN];
mV[VBLUE] = vector4.mV[VBLUE];
mV[VALPHA] = vector4.mV[VALPHA];
}
const LLColor4& LLColor4::set(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
mV[VX] = color4u.mV[VX] * SCALE;
mV[VY] = color4u.mV[VY] * SCALE;
mV[VZ] = color4u.mV[VZ] * SCALE;
mV[VW] = color4u.mV[VW] * SCALE;
mV[VRED] = color4u.mV[VRED] * SCALE;
mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
const LLColor4& LLColor4::set(const LLColor3 &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
// no change to alpha!
// mV[VW] = 1.f;
// mV[VALPHA] = 1.f;
return (*this);
}
const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = a;
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = a;
return (*this);
}
@ -194,22 +194,22 @@ const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
const LLColor4& LLColor4::setVec(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
mV[VX] = color4u.mV[VX] * SCALE;
mV[VY] = color4u.mV[VY] * SCALE;
mV[VZ] = color4u.mV[VZ] * SCALE;
mV[VW] = color4u.mV[VW] * SCALE;
mV[VRED] = color4u.mV[VRED] * SCALE;
mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor3 &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
// no change to alpha!
// mV[VW] = 1.f;
// mV[VALPHA] = 1.f;
return (*this);
}
@ -217,10 +217,10 @@ const LLColor4& LLColor4::setVec(const LLColor3 &vec)
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = a;
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = a;
return (*this);
}
@ -260,45 +260,45 @@ void LLColor4::setValue(const LLSD& sd)
const LLColor4& LLColor4::operator=(const LLColor3 &a)
{
mV[VX] = a.mV[VX];
mV[VY] = a.mV[VY];
mV[VZ] = a.mV[VZ];
mV[VRED] = a.mV[VRED];
mV[VGREEN] = a.mV[VGREEN];
mV[VBLUE] = a.mV[VBLUE];
// converting from an rgb sets a=1 (opaque)
mV[VW] = 1.f;
mV[VALPHA] = 1.f;
return (*this);
}
std::ostream& operator<<(std::ostream& s, const LLColor4 &a)
{
s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << ", " << a.mV[VW] << " }";
s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << ", " << a.mV[VALPHA] << " }";
return s;
}
bool operator==(const LLColor4 &a, const LLColor3 &b)
{
return ( (a.mV[VX] == b.mV[VX])
&&(a.mV[VY] == b.mV[VY])
&&(a.mV[VZ] == b.mV[VZ]));
return ( (a.mV[VRED] == b.mV[VRED])
&&(a.mV[VGREEN] == b.mV[VGREEN])
&&(a.mV[VBLUE] == b.mV[VBLUE]));
}
bool operator!=(const LLColor4 &a, const LLColor3 &b)
{
return ( (a.mV[VX] != b.mV[VX])
||(a.mV[VY] != b.mV[VY])
||(a.mV[VZ] != b.mV[VZ]));
return ( (a.mV[VRED] != b.mV[VRED])
||(a.mV[VGREEN] != b.mV[VGREEN])
||(a.mV[VBLUE] != b.mV[VBLUE]));
}
LLColor3 vec4to3(const LLColor4 &vec)
{
LLColor3 temp(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
LLColor4 vec3to4(const LLColor3 &vec)
{
LLColor3 temp(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
@ -411,10 +411,10 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
{
// There are more tokens to read. This must be a vector.
LLColor4 v;
LLStringUtil::convertToF32( color_name, v.mV[VX] );
LLStringUtil::convertToF32( *token_iter, v.mV[VY] );
v.mV[VZ] = 0.0f;
v.mV[VW] = 1.0f;
LLStringUtil::convertToF32( color_name, v.mV[VRED] );
LLStringUtil::convertToF32( *token_iter, v.mV[VGREEN] );
v.mV[VBLUE] = 0.0f;
v.mV[VALPHA] = 1.0f;
++token_iter;
if (token_iter == tokens.end())
@ -425,18 +425,18 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
else
{
// There is a z-component.
LLStringUtil::convertToF32( *token_iter, v.mV[VZ] );
LLStringUtil::convertToF32( *token_iter, v.mV[VBLUE] );
++token_iter;
if (token_iter != tokens.end())
{
// There is an alpha component.
LLStringUtil::convertToF32( *token_iter, v.mV[VW] );
LLStringUtil::convertToF32( *token_iter, v.mV[VALPHA] );
}
}
// Make sure all values are between 0 and 1.
if (v.mV[VX] > 1.f || v.mV[VY] > 1.f || v.mV[VZ] > 1.f || v.mV[VW] > 1.f)
if (v.mV[VRED] > 1.f || v.mV[VGREEN] > 1.f || v.mV[VBLUE] > 1.f || v.mV[VALPHA] > 1.f)
{
v = v * (1.f / 255.f);
}

View File

@ -245,10 +245,10 @@ LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u);
inline LLColor4::LLColor4(void)
{
mV[VX] = 0.f;
mV[VY] = 0.f;
mV[VZ] = 0.f;
mV[VW] = 1.f;
mV[VRED] = 0.f;
mV[VGREEN] = 0.f;
mV[VBLUE] = 0.f;
mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(const LLSD& sd)
@ -258,113 +258,113 @@ inline LLColor4::LLColor4(const LLSD& sd)
inline LLColor4::LLColor4(F32 r, F32 g, F32 b)
{
mV[VX] = r;
mV[VY] = g;
mV[VZ] = b;
mV[VW] = 1.f;
mV[VRED] = r;
mV[VGREEN] = g;
mV[VBLUE] = b;
mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(F32 r, F32 g, F32 b, F32 a)
{
mV[VX] = r;
mV[VY] = g;
mV[VZ] = b;
mV[VW] = a;
mV[VRED] = r;
mV[VGREEN] = g;
mV[VBLUE] = b;
mV[VALPHA] = a;
}
inline LLColor4::LLColor4(U32 clr)
{
mV[VX] = (clr&0xff) * (1.0f/255.0f);
mV[VY] = ((clr>>8)&0xff) * (1.0f/255.0f);
mV[VZ] = ((clr>>16)&0xff) * (1.0f/255.0f);
mV[VW] = (clr>>24) * (1.0f/255.0f);
mV[VRED] = (clr&0xff) * (1.0f/255.0f);
mV[VGREEN] = ((clr>>8)&0xff) * (1.0f/255.0f);
mV[VBLUE] = ((clr>>16)&0xff) * (1.0f/255.0f);
mV[VALPHA] = (clr>>24) * (1.0f/255.0f);
}
inline LLColor4::LLColor4(const F32 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
}
inline const LLColor4& LLColor4::setToBlack(void)
{
mV[VX] = 0.f;
mV[VY] = 0.f;
mV[VZ] = 0.f;
mV[VW] = 1.f;
mV[VRED] = 0.f;
mV[VGREEN] = 0.f;
mV[VBLUE] = 0.f;
mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::setToWhite(void)
{
mV[VX] = 1.f;
mV[VY] = 1.f;
mV[VZ] = 1.f;
mV[VW] = 1.f;
mV[VRED] = 1.f;
mV[VGREEN] = 1.f;
mV[VBLUE] = 1.f;
mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z)
{
mV[VX] = x;
mV[VY] = y;
mV[VZ] = z;
mV[VRED] = x;
mV[VGREEN] = y;
mV[VBLUE] = z;
// no change to alpha!
// mV[VW] = 1.f;
// mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a)
{
mV[VX] = x;
mV[VY] = y;
mV[VZ] = z;
mV[VW] = a;
mV[VRED] = x;
mV[VGREEN] = y;
mV[VBLUE] = z;
mV[VALPHA] = a;
return (*this);
}
inline const LLColor4& LLColor4::set(const LLColor4 &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = vec.mV[VW];
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::set(const F32 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::set(const F64 *vec)
{
mV[VX] = static_cast<F32>(vec[VX]);
mV[VY] = static_cast<F32>(vec[VY]);
mV[VZ] = static_cast<F32>(vec[VZ]);
mV[VW] = static_cast<F32>(vec[VW]);
mV[VRED] = static_cast<F32>(vec[VRED]);
mV[VGREEN] = static_cast<F32>(vec[VGREEN]);
mV[VBLUE] = static_cast<F32>(vec[VBLUE]);
mV[VALPHA] = static_cast<F32>(vec[VALPHA]);
return (*this);
}
// deprecated
inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
{
mV[VX] = x;
mV[VY] = y;
mV[VZ] = z;
mV[VRED] = x;
mV[VGREEN] = y;
mV[VBLUE] = z;
// no change to alpha!
// mV[VW] = 1.f;
// mV[VALPHA] = 1.f;
return (*this);
}
@ -372,20 +372,20 @@ inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
// deprecated
inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a)
{
mV[VX] = x;
mV[VY] = y;
mV[VZ] = z;
mV[VW] = a;
mV[VRED] = x;
mV[VGREEN] = y;
mV[VBLUE] = z;
mV[VALPHA] = a;
return (*this);
}
// deprecated
inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = vec.mV[VW];
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
@ -393,16 +393,16 @@ inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
// deprecated
inline const LLColor4& LLColor4::setVec(const F32 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::setAlpha(F32 a)
{
mV[VW] = a;
mV[VALPHA] = a;
return (*this);
}
@ -410,25 +410,25 @@ inline const LLColor4& LLColor4::setAlpha(F32 a)
inline F32 LLColor4::length(void) const
{
return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
}
inline F32 LLColor4::lengthSquared(void) const
{
return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
}
inline F32 LLColor4::normalize(void)
{
F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
F32 oomag;
if (mag)
{
oomag = 1.f/mag;
mV[VX] *= oomag;
mV[VY] *= oomag;
mV[VZ] *= oomag;
mV[VRED] *= oomag;
mV[VGREEN] *= oomag;
mV[VBLUE] *= oomag;
}
return (mag);
}
@ -436,27 +436,27 @@ inline F32 LLColor4::normalize(void)
// deprecated
inline F32 LLColor4::magVec(void) const
{
return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
}
// deprecated
inline F32 LLColor4::magVecSquared(void) const
{
return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
}
// deprecated
inline F32 LLColor4::normVec(void)
{
F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
F32 oomag;
if (mag)
{
oomag = 1.f/mag;
mV[VX] *= oomag;
mV[VY] *= oomag;
mV[VZ] *= oomag;
mV[VRED] *= oomag;
mV[VGREEN] *= oomag;
mV[VBLUE] *= oomag;
}
return (mag);
}
@ -467,135 +467,135 @@ inline F32 LLColor4::normVec(void)
inline LLColor4 operator+(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
a.mV[VX] + b.mV[VX],
a.mV[VY] + b.mV[VY],
a.mV[VZ] + b.mV[VZ],
a.mV[VW] + b.mV[VW]);
a.mV[VRED] + b.mV[VRED],
a.mV[VGREEN] + b.mV[VGREEN],
a.mV[VBLUE] + b.mV[VBLUE],
a.mV[VALPHA] + b.mV[VALPHA]);
}
inline LLColor4 operator-(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
a.mV[VX] - b.mV[VX],
a.mV[VY] - b.mV[VY],
a.mV[VZ] - b.mV[VZ],
a.mV[VW] - b.mV[VW]);
a.mV[VRED] - b.mV[VRED],
a.mV[VGREEN] - b.mV[VGREEN],
a.mV[VBLUE] - b.mV[VBLUE],
a.mV[VALPHA] - b.mV[VALPHA]);
}
inline LLColor4 operator*(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
a.mV[VX] * b.mV[VX],
a.mV[VY] * b.mV[VY],
a.mV[VZ] * b.mV[VZ],
a.mV[VW] * b.mV[VW]);
a.mV[VRED] * b.mV[VRED],
a.mV[VGREEN] * b.mV[VGREEN],
a.mV[VBLUE] * b.mV[VBLUE],
a.mV[VALPHA] * b.mV[VALPHA]);
}
inline LLColor4 operator*(const LLColor4 &a, F32 k)
{
// only affects rgb (not a!)
return LLColor4(
a.mV[VX] * k,
a.mV[VY] * k,
a.mV[VZ] * k,
a.mV[VW]);
a.mV[VRED] * k,
a.mV[VGREEN] * k,
a.mV[VBLUE] * k,
a.mV[VALPHA]);
}
inline LLColor4 operator/(const LLColor4 &a, F32 k)
{
return LLColor4(
a.mV[VX] / k,
a.mV[VY] / k,
a.mV[VZ] / k,
a.mV[VW]);
a.mV[VRED] / k,
a.mV[VGREEN] / k,
a.mV[VBLUE] / k,
a.mV[VALPHA]);
}
inline LLColor4 operator*(F32 k, const LLColor4 &a)
{
// only affects rgb (not a!)
return LLColor4(
a.mV[VX] * k,
a.mV[VY] * k,
a.mV[VZ] * k,
a.mV[VW]);
a.mV[VRED] * k,
a.mV[VGREEN] * k,
a.mV[VBLUE] * k,
a.mV[VALPHA]);
}
inline LLColor4 operator%(F32 k, const LLColor4 &a)
{
// only affects alpha (not rgb!)
return LLColor4(
a.mV[VX],
a.mV[VY],
a.mV[VZ],
a.mV[VW] * k);
a.mV[VRED],
a.mV[VGREEN],
a.mV[VBLUE],
a.mV[VALPHA] * k);
}
inline LLColor4 operator%(const LLColor4 &a, F32 k)
{
// only affects alpha (not rgb!)
return LLColor4(
a.mV[VX],
a.mV[VY],
a.mV[VZ],
a.mV[VW] * k);
a.mV[VRED],
a.mV[VGREEN],
a.mV[VBLUE],
a.mV[VALPHA] * k);
}
inline bool operator==(const LLColor4 &a, const LLColor4 &b)
{
return ( (a.mV[VX] == b.mV[VX])
&&(a.mV[VY] == b.mV[VY])
&&(a.mV[VZ] == b.mV[VZ])
&&(a.mV[VW] == b.mV[VW]));
return ( (a.mV[VRED] == b.mV[VRED])
&&(a.mV[VGREEN] == b.mV[VGREEN])
&&(a.mV[VBLUE] == b.mV[VBLUE])
&&(a.mV[VALPHA] == b.mV[VALPHA]));
}
inline bool operator!=(const LLColor4 &a, const LLColor4 &b)
{
return ( (a.mV[VX] != b.mV[VX])
||(a.mV[VY] != b.mV[VY])
||(a.mV[VZ] != b.mV[VZ])
||(a.mV[VW] != b.mV[VW]));
return ( (a.mV[VRED] != b.mV[VRED])
||(a.mV[VGREEN] != b.mV[VGREEN])
||(a.mV[VBLUE] != b.mV[VBLUE])
||(a.mV[VALPHA] != b.mV[VALPHA]));
}
inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b)
{
a.mV[VX] += b.mV[VX];
a.mV[VY] += b.mV[VY];
a.mV[VZ] += b.mV[VZ];
a.mV[VW] += b.mV[VW];
a.mV[VRED] += b.mV[VRED];
a.mV[VGREEN] += b.mV[VGREEN];
a.mV[VBLUE] += b.mV[VBLUE];
a.mV[VALPHA] += b.mV[VALPHA];
return a;
}
inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b)
{
a.mV[VX] -= b.mV[VX];
a.mV[VY] -= b.mV[VY];
a.mV[VZ] -= b.mV[VZ];
a.mV[VW] -= b.mV[VW];
a.mV[VRED] -= b.mV[VRED];
a.mV[VGREEN] -= b.mV[VGREEN];
a.mV[VBLUE] -= b.mV[VBLUE];
a.mV[VALPHA] -= b.mV[VALPHA];
return a;
}
inline const LLColor4& operator*=(LLColor4 &a, F32 k)
{
// only affects rgb (not a!)
a.mV[VX] *= k;
a.mV[VY] *= k;
a.mV[VZ] *= k;
a.mV[VRED] *= k;
a.mV[VGREEN] *= k;
a.mV[VBLUE] *= k;
return a;
}
inline const LLColor4& operator *=(LLColor4 &a, const LLColor4 &b)
{
a.mV[VX] *= b.mV[VX];
a.mV[VY] *= b.mV[VY];
a.mV[VZ] *= b.mV[VZ];
// a.mV[VW] *= b.mV[VW];
a.mV[VRED] *= b.mV[VRED];
a.mV[VGREEN] *= b.mV[VGREEN];
a.mV[VBLUE] *= b.mV[VBLUE];
// a.mV[VALPHA] *= b.mV[VALPHA];
return a;
}
inline const LLColor4& operator%=(LLColor4 &a, F32 k)
{
// only affects alpha (not rgb!)
a.mV[VW] *= k;
a.mV[VALPHA] *= k;
return a;
}
@ -617,10 +617,10 @@ inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b)
inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u)
{
return LLColor4(
a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u,
a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u,
a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u);
a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u,
a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u,
a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u,
a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u);
}
inline bool LLColor4::operator<(const LLColor4& rhs) const

View File

@ -53,10 +53,10 @@ LLColor4U::operator LLColor4()
/*
LLColor4U::LLColor4U(const LLColor3 &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = 255;
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = 255;
}
*/
@ -70,12 +70,12 @@ LLColor4U::LLColor4U(const LLColor3 &vec)
/*
LLColor4U LLColor4U::operator=(const LLColor3 &a)
{
mV[VX] = a.mV[VX];
mV[VY] = a.mV[VY];
mV[VZ] = a.mV[VZ];
mV[VRED] = a.mV[VRED];
mV[VGREEN] = a.mV[VGREEN];
mV[VBLUE] = a.mV[VBLUE];
// converting from an rgb sets a=1 (opaque)
mV[VW] = 255;
mV[VALPHA] = 255;
return (*this);
}
*/
@ -83,7 +83,7 @@ LLColor4U LLColor4U::operator=(const LLColor3 &a)
std::ostream& operator<<(std::ostream& s, const LLColor4U &a)
{
s << "{ " << (S32)a.mV[VX] << ", " << (S32)a.mV[VY] << ", " << (S32)a.mV[VZ] << ", " << (S32)a.mV[VW] << " }";
s << "{ " << (S32)a.mV[VRED] << ", " << (S32)a.mV[VGREEN] << ", " << (S32)a.mV[VBLUE] << ", " << (S32)a.mV[VALPHA] << " }";
return s;
}

View File

@ -142,34 +142,34 @@ F32 distVec_squared(const LLColor4U &a, const LLColor4U &b); // Returns d
inline LLColor4U::LLColor4U()
{
mV[VX] = 0;
mV[VY] = 0;
mV[VZ] = 0;
mV[VW] = 255;
mV[VRED] = 0;
mV[VGREEN] = 0;
mV[VBLUE] = 0;
mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b)
{
mV[VX] = r;
mV[VY] = g;
mV[VZ] = b;
mV[VW] = 255;
mV[VRED] = r;
mV[VGREEN] = g;
mV[VBLUE] = b;
mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b, U8 a)
{
mV[VX] = r;
mV[VY] = g;
mV[VZ] = b;
mV[VW] = a;
mV[VRED] = r;
mV[VGREEN] = g;
mV[VBLUE] = b;
mV[VALPHA] = a;
}
inline LLColor4U::LLColor4U(const U8 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
}
/*
@ -181,30 +181,30 @@ inline LLColor4U::operator LLColor4()
inline const LLColor4U& LLColor4U::setToBlack(void)
{
mV[VX] = 0;
mV[VY] = 0;
mV[VZ] = 0;
mV[VW] = 255;
mV[VRED] = 0;
mV[VGREEN] = 0;
mV[VBLUE] = 0;
mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::setToWhite(void)
{
mV[VX] = 255;
mV[VY] = 255;
mV[VZ] = 255;
mV[VW] = 255;
mV[VRED] = 255;
mV[VGREEN] = 255;
mV[VBLUE] = 255;
mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 x, const U8 y, const U8 z)
{
mV[VX] = x;
mV[VY] = y;
mV[VZ] = z;
mV[VRED] = x;
mV[VGREEN] = y;
mV[VBLUE] = z;
// no change to alpha!
// mV[VW] = 255;
// mV[VALPHA] = 255;
return (*this);
}
@ -220,31 +220,31 @@ inline const LLColor4U& LLColor4U::set(const U8 r, const U8 g, const U8 b, U8 a)
inline const LLColor4U& LLColor4U::set(const LLColor4U &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = vec.mV[VW];
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z)
{
mV[VX] = x;
mV[VY] = y;
mV[VZ] = z;
mV[VRED] = x;
mV[VGREEN] = y;
mV[VBLUE] = z;
// no change to alpha!
// mV[VW] = 255;
// mV[VALPHA] = 255;
return (*this);
}
@ -262,26 +262,26 @@ inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8
// deprecated
inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
mV[VZ] = vec.mV[VZ];
mV[VW] = vec.mV[VW];
mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 *vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4U& LLColor4U::setAlpha(U8 a)
{
mV[VW] = a;
mV[VALPHA] = a;
return (*this);
}
@ -289,159 +289,159 @@ inline const LLColor4U& LLColor4U::setAlpha(U8 a)
inline F32 LLColor4U::length(void) const
{
return (F32) sqrt( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] );
return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
}
inline F32 LLColor4U::lengthSquared(void) const
{
return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ];
return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
// deprecated
inline F32 LLColor4U::magVec(void) const
{
return (F32) sqrt( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] );
return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
}
// deprecated
inline F32 LLColor4U::magVecSquared(void) const
{
return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ];
return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
inline LLColor4U operator+(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
a.mV[VX] + b.mV[VX],
a.mV[VY] + b.mV[VY],
a.mV[VZ] + b.mV[VZ],
a.mV[VW] + b.mV[VW]);
a.mV[VRED] + b.mV[VRED],
a.mV[VGREEN] + b.mV[VGREEN],
a.mV[VBLUE] + b.mV[VBLUE],
a.mV[VALPHA] + b.mV[VALPHA]);
}
inline LLColor4U operator-(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
a.mV[VX] - b.mV[VX],
a.mV[VY] - b.mV[VY],
a.mV[VZ] - b.mV[VZ],
a.mV[VW] - b.mV[VW]);
a.mV[VRED] - b.mV[VRED],
a.mV[VGREEN] - b.mV[VGREEN],
a.mV[VBLUE] - b.mV[VBLUE],
a.mV[VALPHA] - b.mV[VALPHA]);
}
inline LLColor4U operator*(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
a.mV[VX] * b.mV[VX],
a.mV[VY] * b.mV[VY],
a.mV[VZ] * b.mV[VZ],
a.mV[VW] * b.mV[VW]);
a.mV[VRED] * b.mV[VRED],
a.mV[VGREEN] * b.mV[VGREEN],
a.mV[VBLUE] * b.mV[VBLUE],
a.mV[VALPHA] * b.mV[VALPHA]);
}
inline LLColor4U LLColor4U::addClampMax(const LLColor4U &color)
{
return LLColor4U(llmin((S32)mV[VX] + color.mV[VX], 255),
llmin((S32)mV[VY] + color.mV[VY], 255),
llmin((S32)mV[VZ] + color.mV[VZ], 255),
llmin((S32)mV[VW] + color.mV[VW], 255));
return LLColor4U(llmin((S32)mV[VRED] + color.mV[VRED], 255),
llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255),
llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255),
llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255));
}
inline LLColor4U LLColor4U::multAll(const F32 k)
{
// Round to nearest
return LLColor4U(
(U8)ll_round(mV[VX] * k),
(U8)ll_round(mV[VY] * k),
(U8)ll_round(mV[VZ] * k),
(U8)ll_round(mV[VW] * k));
(U8)ll_round(mV[VRED] * k),
(U8)ll_round(mV[VGREEN] * k),
(U8)ll_round(mV[VBLUE] * k),
(U8)ll_round(mV[VALPHA] * k));
}
/*
inline LLColor4U operator*(const LLColor4U &a, U8 k)
{
// only affects rgb (not a!)
return LLColor4U(
a.mV[VX] * k,
a.mV[VY] * k,
a.mV[VZ] * k,
a.mV[VW]);
a.mV[VRED] * k,
a.mV[VGREEN] * k,
a.mV[VBLUE] * k,
a.mV[VALPHA]);
}
inline LLColor4U operator*(U8 k, const LLColor4U &a)
{
// only affects rgb (not a!)
return LLColor4U(
a.mV[VX] * k,
a.mV[VY] * k,
a.mV[VZ] * k,
a.mV[VW]);
a.mV[VRED] * k,
a.mV[VGREEN] * k,
a.mV[VBLUE] * k,
a.mV[VALPHA]);
}
inline LLColor4U operator%(U8 k, const LLColor4U &a)
{
// only affects alpha (not rgb!)
return LLColor4U(
a.mV[VX],
a.mV[VY],
a.mV[VZ],
a.mV[VW] * k );
a.mV[VRED],
a.mV[VGREEN],
a.mV[VBLUE],
a.mV[VALPHA] * k );
}
inline LLColor4U operator%(const LLColor4U &a, U8 k)
{
// only affects alpha (not rgb!)
return LLColor4U(
a.mV[VX],
a.mV[VY],
a.mV[VZ],
a.mV[VW] * k );
a.mV[VRED],
a.mV[VGREEN],
a.mV[VBLUE],
a.mV[VALPHA] * k );
}
*/
inline bool operator==(const LLColor4U &a, const LLColor4U &b)
{
return ( (a.mV[VX] == b.mV[VX])
&&(a.mV[VY] == b.mV[VY])
&&(a.mV[VZ] == b.mV[VZ])
&&(a.mV[VW] == b.mV[VW]));
return ( (a.mV[VRED] == b.mV[VRED])
&&(a.mV[VGREEN] == b.mV[VGREEN])
&&(a.mV[VBLUE] == b.mV[VBLUE])
&&(a.mV[VALPHA] == b.mV[VALPHA]));
}
inline bool operator!=(const LLColor4U &a, const LLColor4U &b)
{
return ( (a.mV[VX] != b.mV[VX])
||(a.mV[VY] != b.mV[VY])
||(a.mV[VZ] != b.mV[VZ])
||(a.mV[VW] != b.mV[VW]));
return ( (a.mV[VRED] != b.mV[VRED])
||(a.mV[VGREEN] != b.mV[VGREEN])
||(a.mV[VBLUE] != b.mV[VBLUE])
||(a.mV[VALPHA] != b.mV[VALPHA]));
}
inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b)
{
a.mV[VX] += b.mV[VX];
a.mV[VY] += b.mV[VY];
a.mV[VZ] += b.mV[VZ];
a.mV[VW] += b.mV[VW];
a.mV[VRED] += b.mV[VRED];
a.mV[VGREEN] += b.mV[VGREEN];
a.mV[VBLUE] += b.mV[VBLUE];
a.mV[VALPHA] += b.mV[VALPHA];
return a;
}
inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b)
{
a.mV[VX] -= b.mV[VX];
a.mV[VY] -= b.mV[VY];
a.mV[VZ] -= b.mV[VZ];
a.mV[VW] -= b.mV[VW];
a.mV[VRED] -= b.mV[VRED];
a.mV[VGREEN] -= b.mV[VGREEN];
a.mV[VBLUE] -= b.mV[VBLUE];
a.mV[VALPHA] -= b.mV[VALPHA];
return a;
}
inline const LLColor4U& operator*=(LLColor4U &a, U8 k)
{
// only affects rgb (not a!)
a.mV[VX] *= k;
a.mV[VY] *= k;
a.mV[VZ] *= k;
a.mV[VRED] *= k;
a.mV[VGREEN] *= k;
a.mV[VBLUE] *= k;
return a;
}
inline const LLColor4U& operator%=(LLColor4U &a, U8 k)
{
// only affects alpha (not rgb!)
a.mV[VW] *= k;
a.mV[VALPHA] *= k;
return a;
}

View File

@ -1,25 +1,25 @@
/**
/**
* @file llassetstorage.cpp
* @brief Implementation of the base asset storage system.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/
@ -74,18 +74,18 @@ namespace
return false;
}
// Rider: This is the general case of the operator declared above. The code compares the callback
// passed into the LLAssetStorage functions to determine if there are duplicated requests for an
// asset. Unfortunately std::function does not provide a direct way to compare two variables so
// we define the operator here.
// XCode is not very happy with the variadic temples in use below so we will just define the specific
// Rider: This is the general case of the operator declared above. The code compares the callback
// passed into the LLAssetStorage functions to determine if there are duplicated requests for an
// asset. Unfortunately std::function does not provide a direct way to compare two variables so
// we define the operator here.
// XCode is not very happy with the variadic temples in use below so we will just define the specific
// case of comparing two LLGetAssetCallback objects since that is all we really use.
//
//
// template<typename T, typename... U>
// bool operator == (const std::function<T(U...)> &a, const std::function <T(U...)> &b)
// {
// typedef T(fnType)(U...);
//
//
// auto fnPtrA = a.target<T(*)(U...)>();
// auto fnPtrB = b.target<T(*)(U...)>();
// if (fnPtrA && fnPtrB)
@ -112,8 +112,8 @@ LLAssetInfo::LLAssetInfo( void )
LLAssetInfo::LLAssetInfo( const LLUUID& object_id, const LLUUID& creator_id,
LLAssetType::EType type, const char* name,
const char* desc )
: mUuid( object_id ),
mCreatorID( creator_id ),
: mUuid( object_id ),
mCreatorID( creator_id ),
mType( type )
{
setName( name );
@ -355,7 +355,7 @@ void LLAssetStorage::_init(LLMessageSystem *msg,
LLAssetStorage::~LLAssetStorage()
{
mShutDown = true;
_cleanupRequests(true, LL_ERR_CIRCUIT_GONE);
if (gMessageSystem)
@ -372,7 +372,7 @@ LLAssetStorage::~LLAssetStorage()
void LLAssetStorage::setUpstream(const LLHost &upstream_host)
{
LL_DEBUGS("AppInit") << "AssetStorage: Setting upstream provider to " << upstream_host << LL_ENDL;
mUpstreamHost = upstream_host;
}
@ -398,7 +398,7 @@ void LLAssetStorage::_cleanupRequests(bool all, S32 error)
// if all is true, we want to clean up everything
// otherwise just check for timed out requests
// EXCEPT for upload timeouts
if (all
if (all
|| ((RT_DOWNLOAD == rt)
&& LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime)))
{
@ -406,7 +406,7 @@ void LLAssetStorage::_cleanupRequests(bool all, S32 error)
<< (all ? "aborted" : "timed out") << " for "
<< tmp->getUUID() << "."
<< LLAssetType::lookup(tmp->getType()) << LL_ENDL;
timed_out.push_front(tmp);
iter = requests->erase(curiter);
}
@ -477,11 +477,11 @@ bool LLAssetStorage::findInCacheAndInvokeCallback(const LLUUID& uuid, LLAssetTyp
// GET routines
///////////////////////////////////////////////////////////////////////////
// IW - uuid is passed by value to avoid side effects, please don't re-add &
// IW - uuid is passed by value to avoid side effects, please don't re-add &
void LLAssetStorage::getAssetData(const LLUUID uuid,
LLAssetType::EType type,
LLAssetType::EType type,
LLAssetStorage::LLGetAssetCallback callback,
void *user_data,
void *user_data,
bool is_priority)
{
LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << LL_ENDL;
@ -546,9 +546,9 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
LL_WARNS("AssetStorage") << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << LL_ENDL;
file.remove();
}
bool duplicate = false;
// check to see if there's a pending download of this uuid already
for (request_list_t::iterator iter = mPendingDownloads.begin();
iter != mPendingDownloads.end(); ++iter )
@ -563,7 +563,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
<< "." << LLAssetType::lookup(type) << LL_ENDL;
return;
}
// this is a duplicate request
// queue the request, but don't actually ask for it again
duplicate = true;
@ -571,11 +571,11 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
}
if (duplicate)
{
LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid
LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid
<< "." << LLAssetType::lookup(type) << LL_ENDL;
}
_queueDataRequest(uuid, type, callback, user_data, duplicate, is_priority);
_queueDataRequest(uuid, type, callback, user_data, duplicate, is_priority);
}
}
@ -645,7 +645,7 @@ void LLAssetStorage::downloadCompleteCallback(
// Inefficient since we're doing a find through a list that may have thousands of elements.
// This is due for refactoring; we will probably change mPendingDownloads into a set.
request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(),
request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(),
gAssetStorage->mPendingDownloads.end(),
req);
@ -668,7 +668,7 @@ void LLAssetStorage::downloadCompleteCallback(
if (vfile.getSize() <= 0)
{
LL_WARNS("AssetStorage") << "downloadCompleteCallback has non-existent or zero-size asset " << callback_id << LL_ENDL;
result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
vfile.remove();
}
@ -693,13 +693,13 @@ void LLAssetStorage::downloadCompleteCallback(
void LLAssetStorage::getEstateAsset(
const LLHost &object_sim,
const LLUUID &agent_id,
const LLUUID &agent_id,
const LLUUID &session_id,
const LLUUID &asset_id,
LLAssetType::EType atype,
const LLUUID &asset_id,
LLAssetType::EType atype,
EstateAssetType etype,
LLGetAssetCallback callback,
void *user_data,
LLGetAssetCallback callback,
void *user_data,
bool is_priority)
{
LL_DEBUGS() << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << LL_ENDL;
@ -723,7 +723,7 @@ void LLAssetStorage::getEstateAsset(
{
return;
}
bool exists = LLFileSystem::getExists(asset_id, atype);
LLFileSystem file(asset_id, atype);
U32 size = exists ? file.getSize() : 0;
@ -836,21 +836,21 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback(
}
void LLAssetStorage::getInvItemAsset(
const LLHost &object_sim,
const LLUUID &agent_id,
const LLHost &object_sim,
const LLUUID &agent_id,
const LLUUID &session_id,
const LLUUID &owner_id,
const LLUUID &task_id,
const LLUUID &task_id,
const LLUUID &item_id,
const LLUUID &asset_id,
const LLUUID &asset_id,
LLAssetType::EType atype,
LLGetAssetCallback callback,
void *user_data,
LLGetAssetCallback callback,
void *user_data,
bool is_priority)
{
LL_DEBUGS() << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << LL_ENDL;
bool exists = false;
bool exists = false;
U32 size = 0;
if(asset_id.notNull())
@ -910,7 +910,7 @@ void LLAssetStorage::getInvItemAsset(
spi.setAsset(asset_id, atype);
LL_DEBUGS("ViewerAsset") << "requesting inv item id " << item_id << " asset_id " << asset_id << " type " << LLAssetType::lookup(atype) << LL_ENDL;
// Set our destination file, and the completion callback.
LLTransferTargetParamsVFile tpvf;
tpvf.setAsset(asset_id, atype);
@ -984,9 +984,9 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
// static
void LLAssetStorage::uploadCompleteCallback(
const LLUUID& uuid,
void *user_data,
S32 result,
const LLUUID& uuid,
void *user_data,
S32 result,
LLExtStat ext_status) // StoreAssetData callback (fixed)
{
if (!gAssetStorage)
@ -1190,7 +1190,7 @@ const LLAssetRequest* LLAssetStorage::findRequest(const LLAssetStorage::request_
LLAssetType::EType asset_type,
const LLUUID& asset_id)
{
if (requests)
if (requests)
{
// Search the requests list for the asset.
request_list_t::const_iterator iter = requests->begin();
@ -1213,7 +1213,7 @@ LLAssetRequest* LLAssetStorage::findRequest(LLAssetStorage::request_list_t* requ
LLAssetType::EType asset_type,
const LLUUID& asset_id)
{
if (requests)
if (requests)
{
// Search the requests list for the asset.
request_list_t::iterator iter = requests->begin();
@ -1296,7 +1296,7 @@ bool LLAssetStorage::deletePendingRequestImpl(LLAssetStorage::request_list_t* re
delete req;
return true;
}
return false;
}
@ -1340,14 +1340,14 @@ const char* LLAssetStorage::getErrorString(S32 status)
}
}
void LLAssetStorage::getAssetData(const LLUUID uuid,
LLAssetType::EType type,
void (*callback)(const char*,
const LLUUID&,
void *,
S32,
LLExtStat),
void *user_data,
void LLAssetStorage::getAssetData(const LLUUID uuid,
LLAssetType::EType type,
void (*callback)(const char*,
const LLUUID&,
void *,
S32,
LLExtStat),
void *user_data,
bool is_priority)
{
// check for duplicates here, since we're about to fool the normal duplicate checker
@ -1358,7 +1358,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
auto cbptr = tmp->mDownCallback.target<void(*)(const LLUUID &, LLAssetType::EType, void *, S32, LLExtStat)>();
if (type == tmp->getType() &&
if (type == tmp->getType() &&
uuid == tmp->getUUID() &&
(cbptr && (*cbptr == legacyGetDataCallback)) &&
callback == ((LLLegacyAssetRequest *)tmp->mUserData)->mDownCallback &&
@ -1369,8 +1369,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
return;
}
}
LLLegacyAssetRequest *legacy = new LLLegacyAssetRequest;
legacy->mDownCallback = callback;
@ -1381,10 +1381,10 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
}
// static
void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
LLAssetType::EType type,
void *user_data,
S32 status,
void *user_data,
S32 status,
LLExtStat ext_status)
{
LLLegacyAssetRequest *legacy = (LLLegacyAssetRequest *)user_data;
@ -1403,7 +1403,7 @@ void LLAssetStorage::legacyGetDataCallback(const LLUUID &uuid,
uuid.toString(uuid_str);
filename = llformat("%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type));
LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
if (fp)
{
const S32 buf_size = 65536;
@ -1458,7 +1458,7 @@ void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::ET
std::string filename(in_filename);
if (filename.empty())
filename = ll_safe_string(file);
// Create revised message - new_message = "in_message :: file:line"
std::stringstream new_message;
new_message << in_message << " :: " << filename << ":" << line;
@ -1531,7 +1531,7 @@ void LLAssetStorage::flushOldToxicAssets( bool force_it )
// Add an item to the toxic asset map
void LLAssetStorage::markAssetToxic( const LLUUID& uuid )
{
{
if ( !uuid.isNull() )
{
// Set the value to the current time. Creates a new entry if needed

View File

@ -1,4 +1,4 @@
/**
/**
* @file llcorehttputil.cpp
* @date 2014-08-25
* @brief Implementation of adapter and utility classes expanding the llcorehttp interfaces.
@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2014, 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$
*/
@ -48,7 +48,7 @@ namespace LLCoreHttpUtil
const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f;
namespace
namespace
{
const std::string HTTP_LOGBODY_KEY("HTTPLogBodyOnError");
@ -87,9 +87,9 @@ void logMessageFail(std::string logAuth, std::string url, std::string message)
}
//=========================================================================
/// The HttpRequestPumper is a utility class. When constructed it will poll the
/// The HttpRequestPumper is a utility class. When constructed it will poll the
/// supplied HttpRequest once per frame until it is destroyed.
///
///
class HttpRequestPumper
{
public:
@ -261,7 +261,7 @@ void HttpCoroHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespons
LLCore::HttpStatus status = response->getStatus();
if (status == LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_HANDLE_NOT_FOUND))
{ // A response came in for a canceled request and we have not processed the
{ // A response came in for a canceled request and we have not processed the
// cancel yet. Patience!
return;
}
@ -273,9 +273,9 @@ void HttpCoroHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespons
LLCore::HttpStatus::type_enum_t errType = status.getType();
LL_WARNS("CoreHTTP")
<< "Possible failure [" << status.toTerseString() << "] cannot "<< response->getRequestMethod()
<< "Possible failure [" << status.toTerseString() << "] cannot "<< response->getRequestMethod()
<< " url '" << response->getRequestURL()
<< "' because " << status.toString()
<< "' because " << status.toString()
<< LL_ENDL;
if ((errType >= 400) && (errType < 500))
{
@ -360,13 +360,13 @@ void HttpCoroHandler::writeStatusCodes(LLCore::HttpStatus status, const std::str
}
//=========================================================================
/// The HttpCoroLLSDHandler is a specialization of the LLCore::HttpHandler for
/// interacting with coroutines. When the request is completed the response
/// The HttpCoroLLSDHandler is a specialization of the LLCore::HttpHandler for
/// interacting with coroutines. When the request is completed the response
/// will be posted onto the supplied Event Pump.
///
///
/// If the LLSD retrieved from through the HTTP connection is not in the form
/// of a LLSD::map it will be returned as in an llsd["content"] element.
///
///
/// The LLSD posted back to the coroutine will have the following additions:
/// llsd["http_result"] -+- ["message"] - An error message returned from the HTTP status
/// +- ["status"] - The status code associated with the HTTP call
@ -374,7 +374,7 @@ void HttpCoroHandler::writeStatusCodes(LLCore::HttpStatus status, const std::str
/// +- ["type"] - The LLCore::HttpStatus type associted with the HTTP call
/// +- ["url"] - The URL used to make the call.
/// +- ["headers"] - A map of name name value pairs with the HTTP headers.
///
///
class HttpCoroLLSDHandler : public HttpCoroHandler
{
public:
@ -390,7 +390,7 @@ HttpCoroLLSDHandler::HttpCoroLLSDHandler(LLEventStream &reply):
HttpCoroHandler(reply)
{
}
LLSD HttpCoroLLSDHandler::handleSuccess(LLCore::HttpResponse * response, LLCore::HttpStatus &status)
{
@ -424,7 +424,7 @@ LLSD HttpCoroLLSDHandler::handleSuccess(LLCore::HttpResponse * response, LLCore:
#endif
if (!success)
{
{
#if 1
// Only emit a warning if we failed to parse when 'content-type' == 'application/llsd+xml'
LLCore::HttpHeaders::ptr_t headers(response->getHeaders());
@ -440,13 +440,13 @@ LLSD HttpCoroLLSDHandler::handleSuccess(LLCore::HttpResponse * response, LLCore:
status = LLCore::HttpStatus(499, "Failed to deserialize LLSD.");
}
#endif
// If we've gotten to this point and the result LLSD is still undefined
// If we've gotten to this point and the result LLSD is still undefined
// either there was an issue deserializing the body or the response was
// blank. Create an empty map to hold the result either way.
result = LLSD::emptyMap();
}
else if (!result.isMap())
{ // The results are not themselves a map. Move them down so that
{ // The results are not themselves a map. Move them down so that
// this method can return a map to the caller.
// *TODO: Should it always do this?
LLSD newResult = LLSD::emptyMap();
@ -476,13 +476,13 @@ LLSD HttpCoroLLSDHandler::parseBody(LLCore::HttpResponse *response, bool &succes
//========================================================================
/// The HttpCoroRawHandler is a specialization of the LLCore::HttpHandler for
/// interacting with coroutines.
///
/// In addition to the normal "http_results" the returned LLSD will contain
/// The HttpCoroRawHandler is a specialization of the LLCore::HttpHandler for
/// interacting with coroutines.
///
/// In addition to the normal "http_results" the returned LLSD will contain
/// an entry keyed with "raw" containing the unprocessed results of the HTTP
/// call.
///
///
class HttpCoroRawHandler : public HttpCoroHandler
{
public:
@ -515,9 +515,9 @@ LLSD HttpCoroRawHandler::handleSuccess(LLCore::HttpResponse * response, LLCore::
#if 1
// This is the slower implementation. It is safe vis-a-vi the const_cast<> and modification
// of a LLSD managed array but contains an extra (potentially large) copy.
//
//
// *TODO: https://jira.secondlife.com/browse/MAINT-5221
LLSD::Binary data;
data.reserve(size);
bas >> std::noskipws;
@ -526,12 +526,12 @@ LLSD HttpCoroRawHandler::handleSuccess(LLCore::HttpResponse * response, LLCore::
result[HttpCoroutineAdapter::HTTP_RESULTS_RAW] = data;
#else
// This is disabled because it's dangerous. See the other case for an
// This is disabled because it's dangerous. See the other case for an
// alternate implementation.
// We create a new LLSD::Binary object and assign it to the result map.
// The LLSD has created it's own copy so we retrieve it asBinary and const cast
// The LLSD has created it's own copy so we retrieve it asBinary and const cast
// the reference so that we can modify it.
// *TODO: This is potentially dangerous... but I am trying to avoid a potentially
// *TODO: This is potentially dangerous... but I am trying to avoid a potentially
// large copy.
result[HttpCoroutineAdapter::HTTP_RESULTS_RAW] = LLSD::Binary();
LLSD::Binary &data = const_cast<LLSD::Binary &>( result[HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary() );
@ -551,13 +551,13 @@ LLSD HttpCoroRawHandler::parseBody(LLCore::HttpResponse *response, bool &success
}
//========================================================================
/// The HttpCoroJSONHandler is a specialization of the LLCore::HttpHandler for
/// interacting with coroutines.
///
/// In addition to the normal "http_results" the returned LLSD will contain
/// JSON entries will be converted into an LLSD map. All results are considered
/// The HttpCoroJSONHandler is a specialization of the LLCore::HttpHandler for
/// interacting with coroutines.
///
/// In addition to the normal "http_results" the returned LLSD will contain
/// JSON entries will be converted into an LLSD map. All results are considered
/// strings
///
///
class HttpCoroJSONHandler : public HttpCoroHandler
{
public:
@ -692,7 +692,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPostWithLLSD(request,
mPolicyId, url, body, options, headers,
@ -730,7 +730,7 @@ LLSD HttpCoroutineAdapter::postRawAndSuspend(LLCore::HttpRequest::ptr_t request,
return postAndSuspend_(request, url, rawbody, options, headers, httpHandler);
}
// *TODO: This functionality could be moved into the LLCore::Http library itself
// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, std::string fileName,
@ -759,7 +759,7 @@ LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request
return postAndSuspend(request, url, fileData, options, headers);
}
// *TODO: This functionality could be moved into the LLCore::Http library itself
// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
@ -776,7 +776,7 @@ LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request
U8* fileBuffer;
fileBuffer = new U8[fileSize];
vfile.read(fileBuffer, fileSize);
outs.write((char*)fileBuffer, fileSize);
delete[] fileBuffer;
}
@ -816,7 +816,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestPost(mPolicyId, url, rawbody.get(),
options, headers, handler);
@ -873,7 +873,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPutWithLLSD(request,
mPolicyId, url, body, options, headers,
@ -900,7 +900,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestPut(mPolicyId,
url, rawbody.get(), options, headers, handler);
@ -950,13 +950,13 @@ LLSD HttpCoroutineAdapter::getJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
LLSD HttpCoroutineAdapter::getAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
{
HttpRequestPumper pumper(request);
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestGet(mPolicyId,
url, options, headers, handler);
@ -985,7 +985,7 @@ LLSD HttpCoroutineAdapter::deleteAndSuspend(LLCore::HttpRequest::ptr_t request,
}
LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
@ -996,13 +996,13 @@ LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t reque
LLSD HttpCoroutineAdapter::deleteAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler)
{
HttpRequestPumper pumper(request);
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = request->requestDelete(mPolicyId,
url, options, headers, handler);
@ -1039,7 +1039,7 @@ LLSD HttpCoroutineAdapter::patchAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPatchWithLLSD(request,
mPolicyId, url, body, options, headers,
@ -1073,7 +1073,7 @@ LLSD HttpCoroutineAdapter::copyAndSuspend(LLCore::HttpRequest::ptr_t request,
LLSD HttpCoroutineAdapter::copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
{
@ -1081,9 +1081,9 @@ LLSD HttpCoroutineAdapter::copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
//
//
LLCore::HttpHandle hhandle = request->requestCopy(mPolicyId, url,
options, headers, handler);
@ -1123,9 +1123,9 @@ LLSD HttpCoroutineAdapter::moveAndSuspend_(LLCore::HttpRequest::ptr_t &request,
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
//
//
LLCore::HttpHandle hhandle = request->requestMove(mPolicyId, url,
options, headers, handler);
@ -1174,7 +1174,7 @@ void HttpCoroutineAdapter::cancelSuspendedOperation()
}
}
void HttpCoroutineAdapter::saveState(LLCore::HttpHandle yieldingHandle,
void HttpCoroutineAdapter::saveState(LLCore::HttpHandle yieldingHandle,
LLCore::HttpRequest::ptr_t &request, HttpCoroHandler::ptr_t &handler)
{
mWeakRequest = request;
@ -1190,15 +1190,15 @@ void HttpCoroutineAdapter::cleanState()
}
/*static*/
LLSD HttpCoroutineAdapter::buildImmediateErrorResult(const LLCore::HttpRequest::ptr_t &request,
const std::string &url)
LLSD HttpCoroutineAdapter::buildImmediateErrorResult(const LLCore::HttpRequest::ptr_t &request,
const std::string &url)
{
LLCore::HttpStatus status = request->getStatus();
LL_WARNS("CoreHTTP") << "Error posting to " << url << " Status=" << status.getStatus() <<
" message = " << status.getMessage() << LL_ENDL;
// Mimic the status results returned from an http error that we had
// to wait on
// Mimic the status results returned from an http error that we had
// to wait on
LLSD httpresults = LLSD::emptyMap();
HttpCoroHandler::writeStatusCodes(status, url, httpresults);
@ -1228,7 +1228,7 @@ void HttpCoroutineAdapter::callbackHttpGet(const std::string &url, LLCore::HttpR
/*static*/
void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::string &success, const std::string &failure)
{
completionCallback_t cbSuccess = (success.empty()) ? NULL :
completionCallback_t cbSuccess = (success.empty()) ? NULL :
static_cast<completionCallback_t>(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success));
completionCallback_t cbFailure = (failure.empty()) ? NULL :
static_cast<completionCallback_t>(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure));
@ -1253,7 +1253,7 @@ void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
if (!status)
{
{
if (failure)
{
failure(httpResults);

View File

@ -289,14 +289,14 @@ bool LLPartSysData::unpack(LLDataPacker &dp)
//skip to LLPartData block
U8 feh = 0;
for (U32 i = 0; i < size; ++i)
for (S32 i = 0; i < size; ++i)
{
dp.unpackU8(feh, "whippang");
}
dp.unpackS32(size, "partsize");
//skip LLPartData block
for (U32 i = 0; i < size; ++i)
for (S32 i = 0; i < size; ++i)
{
dp.unpackU8(feh, "whippang");
}

View File

@ -262,10 +262,10 @@ void LLPluginClassMedia::idle(void)
message.setValueS32("height", mRequestedMediaHeight);
message.setValueS32("texture_width", mRequestedTextureWidth);
message.setValueS32("texture_height", mRequestedTextureHeight);
message.setValueReal("background_r", mBackgroundColor.mV[VX]);
message.setValueReal("background_g", mBackgroundColor.mV[VY]);
message.setValueReal("background_b", mBackgroundColor.mV[VZ]);
message.setValueReal("background_a", mBackgroundColor.mV[VW]);
message.setValueReal("background_r", mBackgroundColor.mV[VRED]);
message.setValueReal("background_g", mBackgroundColor.mV[VGREEN]);
message.setValueReal("background_b", mBackgroundColor.mV[VBLUE]);
message.setValueReal("background_a", mBackgroundColor.mV[VALPHA]);
mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue.
LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL;

View File

@ -1064,9 +1064,9 @@ bool LLDAELoader::OpenFile(const std::string& filename)
//Verify some basic properties of the dae
//1. Basic validity check on controller
U32 controllerCount = (int) db->getElementCount( NULL, "controller" );
U32 controllerCount = db->getElementCount(NULL, "controller");
bool result = false;
for ( int i=0; i<controllerCount; ++i )
for (U32 i = 0; i < controllerCount; ++i)
{
domController* pController = NULL;
db->getElement( (daeElement**) &pController, i , NULL, "controller" );
@ -1319,7 +1319,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
//Some collada setup for accessing the skeleton
U32 skeleton_count = dae->getDatabase()->getElementCount( NULL, "skeleton" );
std::vector<domInstance_controller::domSkeleton*> skeletons;
for (S32 i=0; i<skeleton_count; i++)
for (U32 i = 0; i < skeleton_count; i++)
{
daeElement* pElement = 0;
dae->getDatabase()->getElement( &pElement, i, 0, "skeleton" );

View File

@ -5,21 +5,21 @@
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, 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$
*/
@ -72,7 +72,7 @@ LLGLTFMaterial::LLGLTFMaterial()
#if 0
mTextureTransform[i].mOffset.clear();
mTextureTransform[i].mRotation = 0.f;
#endif
#endif
}
#if 0
mLocalTexDataDigest = 0;
@ -783,7 +783,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
{
mMetallicFactor = mf.asReal();
if (mMetallicFactor == getDefaultMetallicFactor())
{
{
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
mMetallicFactor -= FLT_EPSILON;
}
@ -794,7 +794,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
{
mRoughnessFactor = rf.asReal();
if (mRoughnessFactor == getDefaultRoughnessFactor())
{
{
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
mRoughnessFactor -= FLT_EPSILON;
}

View File

@ -104,7 +104,7 @@ void LLModel::offsetMesh( const LLVector3& pivotPoint )
LLVolumeFace& face = *currentFaceIt;
LLVector4a *pos = (LLVector4a*) face.mPositions;
for (U32 i=0; i<face.mNumVertices; ++i )
for (S32 i=0; i<face.mNumVertices; ++i )
{
pos[i].add( pivot );
}
@ -113,7 +113,7 @@ void LLModel::offsetMesh( const LLVector3& pivotPoint )
void LLModel::remapVolumeFaces()
{
for (U32 i = 0; i < getNumVolumeFaces(); ++i)
for (S32 i = 0; i < getNumVolumeFaces(); ++i)
{
mVolumeFaces[i].remap();
}
@ -121,7 +121,7 @@ void LLModel::remapVolumeFaces()
void LLModel::optimizeVolumeFaces()
{
for (U32 i = 0; i < getNumVolumeFaces(); ++i)
for (S32 i = 0; i < getNumVolumeFaces(); ++i)
{
mVolumeFaces[i].optimize();
}
@ -176,7 +176,7 @@ void LLModel::trimVolumeFacesToSize(U32 new_count, LLVolume::face_list_t* remain
{
llassert(new_count <= LL_SCULPT_MESH_MAX_FACES);
if (new_count && (getNumVolumeFaces() > new_count))
if (new_count > 0 && ((U32)getNumVolumeFaces() > new_count))
{
// Copy out remaining volume faces for alternative handling, if provided
//
@ -227,7 +227,7 @@ void LLModel::normalizeVolumeFaces()
min_tc = face.mTexCoords[0];
max_tc = face.mTexCoords[0];
for (U32 j = 1; j < face.mNumVertices; ++j)
for (S32 j = 1; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, face.mTexCoords[j]);
}
@ -301,7 +301,7 @@ void LLModel::normalizeVolumeFaces()
LLVector4a* norm = (LLVector4a*) face.mNormals;
LLVector4a* t = (LLVector4a*)face.mTangents;
for (U32 j = 0; j < face.mNumVertices; ++j)
for (S32 j = 0; j < face.mNumVertices; ++j)
{
pos[j].add(trans);
pos[j].mul(scale);
@ -375,7 +375,7 @@ LLVector3 LLModel::getTransformedCenter(const LLMatrix4& mat)
{
LLVolumeFace& face = mVolumeFaces[i];
for (U32 j = 0; j < face.mNumVertices; ++j)
for (S32 j = 0; j < face.mNumVertices; ++j)
{
m.affineTransform(face.mPositions[j],t);
update_min_max(minv, maxv, t);
@ -487,7 +487,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
faceted.resizeVertices(vol_face.mNumIndices);
faceted.resizeIndices(vol_face.mNumIndices);
//bake out triangles into temporary face, clearing texture coordinates
for (U32 i = 0; i < vol_face.mNumIndices; ++i)
for (S32 i = 0; i < vol_face.mNumIndices; ++i)
{
U32 idx = vol_face.mIndices[i];
@ -497,7 +497,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//generate normals for temporary face
for (U32 i = 0; i < faceted.mNumIndices; i += 3)
for (S32 i = 0; i < faceted.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = faceted.mIndices[i+0];
U16 i1 = faceted.mIndices[i+1];
@ -526,12 +526,12 @@ void LLModel::generateNormals(F32 angle_cutoff)
//generate normals for welded face based on new topology (step 3)
for (U32 i = 0; i < faceted.mNumVertices; i++)
for (S32 i = 0; i < faceted.mNumVertices; i++)
{
faceted.mNormals[i].clear();
}
for (U32 i = 0; i < faceted.mNumIndices; i += 3)
for (S32 i = 0; i < faceted.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = faceted.mIndices[i+0];
U16 i1 = faceted.mIndices[i+1];
@ -560,7 +560,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
//normalize normals and build point map
LLVolumeFace::VertexMapData::PointMap point_map;
for (U32 i = 0; i < faceted.mNumVertices; ++i)
for (S32 i = 0; i < faceted.mNumVertices; ++i)
{
faceted.mNormals[i].normalize3();
@ -578,7 +578,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
new_face.resizeIndices(vol_face.mNumIndices);
new_face.resizeVertices(vol_face.mNumIndices);
for (U32 i = 0; i < vol_face.mNumIndices; ++i)
for (S32 i = 0; i < vol_face.mNumIndices; ++i)
{
U32 idx = vol_face.mIndices[i];
LLVolumeFace::VertexData v;
@ -589,7 +589,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
if (vol_face.mTexCoords)
{
for (U32 i = 0; i < vol_face.mNumIndices; i++)
for (S32 i = 0; i < vol_face.mNumIndices; i++)
{
U32 idx = vol_face.mIndices[i];
new_face.mTexCoords[i] = vol_face.mTexCoords[idx];
@ -602,7 +602,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//generate normals for new face
for (U32 i = 0; i < new_face.mNumIndices; i += 3)
for (S32 i = 0; i < new_face.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = new_face.mIndices[i+0];
U16 i1 = new_face.mIndices[i+1];
@ -627,7 +627,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//swap out normals in new_face with best match from point map (step 5)
for (U32 i = 0; i < new_face.mNumVertices; ++i)
for (S32 i = 0; i < new_face.mNumVertices; ++i)
{
//LLVolumeFace::VertexData v = new_face.mVertices[i];
@ -740,7 +740,7 @@ LLSD LLModel::writeModel(
for (S32 i = 0; i < model[idx]->getNumVolumeFaces(); ++i)
{ //for each face
const LLVolumeFace& face = model[idx]->getVolumeFace(i);
for (U32 j = 0; j < face.mNumVertices; ++j)
for (S32 j = 0; j < face.mNumVertices; ++j)
{
update_min_max(min_pos, max_pos, face.mPositions[j].getF32ptr());
}
@ -777,7 +777,7 @@ LLSD LLModel::writeModel(
max_tc = min_tc;
//get texture coordinate domain
for (U32 j = 0; j < face.mNumVertices; ++j)
for (S32 j = 0; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, ftc[j]);
}
@ -785,7 +785,7 @@ LLSD LLModel::writeModel(
LLVector2 tc_range = max_tc - min_tc;
for (U32 j = 0; j < face.mNumVertices; ++j)
for (S32 j = 0; j < face.mNumVertices; ++j)
{ //for each vert
F32* pos = face.mPositions[j].getF32ptr();
@ -855,7 +855,7 @@ LLSD LLModel::writeModel(
}
U32 idx_idx = 0;
for (U32 j = 0; j < face.mNumIndices; ++j)
for (S32 j = 0; j < face.mNumIndices; ++j)
{
U8* buff = (U8*) &(face.mIndices[j]);
indices[idx_idx++] = buff[0];
@ -902,7 +902,7 @@ LLSD LLModel::writeModel(
// a bone index of 0xFF signifies no more influences for this vertex
std::stringstream ostr;
for (U32 j = 0; j < face.mNumVertices; ++j)
for (S32 j = 0; j < face.mNumVertices; ++j)
{
LLVector3 pos(face.mPositions[j].getF32ptr());
@ -2053,7 +2053,7 @@ bool ll_is_degenerate(const LLVector4a& a, const LLVector4a& b, const LLVector4a
bool validate_face(const LLVolumeFace& face)
{
for (U32 i = 0; i < face.mNumIndices; ++i)
for (S32 i = 0; i < face.mNumIndices; ++i)
{
if (face.mIndices[i] >= face.mNumVertices)
{

View File

@ -407,9 +407,9 @@ S32 LLTextureEntry::setColor(const LLColor3 &color)
S32 LLTextureEntry::setAlpha(const F32 alpha)
{
if (mColor.mV[VW] != alpha)
if (mColor.mV[VALPHA] != alpha)
{
mColor.mV[VW] = alpha;
mColor.mV[VALPHA] = alpha;
return TEM_CHANGE_COLOR;
}
return TEM_CHANGE_NONE;

View File

@ -283,7 +283,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
LLColor4U text_color(color);
// Preserve the transparency to render fading emojis in fading text (e.g.
// for the chat console)... HB
LLColor4U emoji_color(255, 255, 255, text_color.mV[VW]);
LLColor4U emoji_color(255, 255, 255, text_color.mV[VALPHA]);
std::pair<EFontGlyphType, S32> bitmap_entry = std::make_pair(EFontGlyphType::Grayscale, -1);
S32 glyph_count = 0;

View File

@ -1184,7 +1184,7 @@ bool LLGLManager::initGL()
// <FS:Beq> stop doing this and trust the hardware detection
// if hardware detection has all failed the this will correct for that
// S32 old_vram = mVRAM;
// U32 old_vram = mVRAM;
// mVRAM = 0;
#if LL_WINDOWS
@ -1229,7 +1229,7 @@ bool LLGLManager::initGL()
// // Function will check all GPUs WMI knows of and will pick up the one with most
// // memory. We need to check all GPUs because system can switch active GPU to
// // weaker one, to preserve power when not under load.
// S32 mem = LLDXHardware::getMBVideoMemoryViaWMI();
// U32 mem = LLDXHardware::getMBVideoMemoryViaWMI();
// if (mem != 0)
// {
// mVRAM = mem;
@ -1381,7 +1381,7 @@ void LLGLManager::asLLSD(LLSD& info)
info["gpu_version"] = mDriverVersionVendorString;
info["opengl_version"] = mGLVersionString;
info["vram"] = mVRAM;
info["vram"] = LLSD::Integer(mVRAM);
// OpenGL limits
info["max_samples"] = mMaxSamples;

View File

@ -132,9 +132,7 @@ public:
std::string mDriverVersionVendorString;
std::string mGLVersionString;
S32 mVRAM; // VRAM in MB
void getPixelFormat(); // Get the best pixel format
U32 mVRAM; // VRAM in MB
std::string getGLInfoString();
void printGLInfoString();
@ -152,7 +150,6 @@ public:
private:
void initExtensions();
void initGLStates();
void initGLImages();
};
extern LLGLManager gGLManager;

View File

@ -100,7 +100,7 @@ void LLImageGLMemory::free_tex_image(U32 texName)
// track texture free on given texNames
void LLImageGLMemory::free_tex_images(U32 count, const U32* texNames)
{
for (int i = 0; i < count; ++i)
for (U32 i = 0; i < count; ++i)
{
free_tex_image(texNames[i]);
}
@ -1318,7 +1318,7 @@ void LLImageGL::generateTextures(S32 numTextures, U32 *textures)
name_count = pool_size;
}
if (numTextures <= name_count)
if ((U32)numTextures <= name_count)
{
//copy teture names off the end of the pool
memcpy(textures, name_pool + name_count - numTextures, sizeof(U32) * numTextures);

View File

@ -671,7 +671,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
{ //switches are supported in GLSL 1.30 and later
if (gGLManager.mIsNVIDIA)
{ //switches are unreliable on some NVIDIA drivers
for (U32 i = 0; i < texture_index_channels; ++i)
for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string if_string = llformat("\t%sif (vary_texture_index == %d) { return texture(tex%d, texcoord); }\n", i > 0 ? "else " : "", i, i);
extra_code_text[extra_code_count++] = strdup(if_string.c_str());

View File

@ -660,7 +660,7 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
if (tc != nullptr)
{
for (int i = 0; i < num_indices; ++i)
for (U32 i = 0; i < num_indices; ++i)
{
U16 idx = indicesp[i];
gGL.texCoord2fv(tc[idx].mV);
@ -669,7 +669,7 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
}
else
{
for (int i = 0; i < num_indices; ++i)
for (U32 i = 0; i < num_indices; ++i)
{
U16 idx = indicesp[i];
gGL.vertex3fv(pos[idx].getF32ptr());
@ -686,19 +686,17 @@ bool LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
return true;
}
llassert(start < (U32)mNumVerts);
llassert(end < (U32)mNumVerts);
llassert(start < mNumVerts);
llassert(end < mNumVerts);
if (start >= (U32) mNumVerts ||
end >= (U32) mNumVerts)
if (start >= mNumVerts ||
end >= mNumVerts)
{
LL_ERRS() << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << LL_ENDL;
}
llassert(mNumIndices >= 0);
if (indices_offset >= (U32) mNumIndices ||
indices_offset + count > (U32) mNumIndices)
if (indices_offset >= mNumIndices ||
indices_offset + count > mNumIndices)
{
LL_ERRS() << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << LL_ENDL;
}
@ -735,7 +733,7 @@ bool LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
for (U32 i = start; i < end; i++)
{
U32 idx = (U32) (v[i][3]+0.25f);
if (idx >= shader->mFeatures.mIndexedTextureChannels)
if (idx >= (U32)shader->mFeatures.mIndexedTextureChannels)
{
LL_ERRS() << "Bad texture index found in vertex data stream." << LL_ENDL;
}

View File

@ -604,7 +604,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, L
}
S32 skip_chars = 0; // skip '\n'
S32 line_length = static_cast<S32>(line_end) - paragraph_offset;
U32 line_length = static_cast<U32>(line_end) - paragraph_offset;
U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_length, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
// </FS>
@ -812,11 +812,11 @@ void LLConsole::update()
F32 skip_time = mTimer.getElapsedTimeF32() - mLinePersistTime;
paragraph_t temp_para;
std::map<LLUUID, S32> session_map;
std::map<LLUUID, U32> session_map;
for (paragraph_t::reverse_iterator it = mParagraphs.rbegin(); it != mParagraphs.rend(); ++it)
{
Paragraph& para = *it;
session_map[para.mSessionID] += (S32)para.mLines.size();
session_map[para.mSessionID] += (U32)para.mLines.size();
if (session_map[para.mSessionID] <= mMaxLines && // max lines on a per session basis
!((mLinePersistTime > 0.f) && (para.mAddTime - skip_time) / (mLinePersistTime - mFadeTime) <= 0.f)) // not expired yet
{

View File

@ -1026,9 +1026,9 @@ void LLKeywords::dump()
void LLKeywordToken::dump()
{
LL_INFOS() << "[" <<
mColor.mV[VX] << ", " <<
mColor.mV[VY] << ", " <<
mColor.mV[VZ] << "] [" <<
mColor.mV[VRED] << ", " <<
mColor.mV[VGREEN] << ", " <<
mColor.mV[VBLUE] << "] [" <<
wstring_to_utf8str(mToken) << "]" <<
LL_ENDL;
}

View File

@ -934,7 +934,7 @@ void LLTextBase::drawText()
}
// Draw squiggly lines under any visible misspelled words
while ( (mMisspellRanges.end() != misspell_it) && (misspell_it->first < seg_end) && (misspell_it->second > seg_start) )
while ( (mMisspellRanges.end() != misspell_it) && (misspell_it->first < (U32)seg_end) && (misspell_it->second > (U32)seg_start) )
{
// Skip the current word if the user is still busy editing it
if ( (!mSpellCheckTimer.hasExpired()) && (misspell_it->first <= (U32)mCursorPos) && (misspell_it->second >= (U32)mCursorPos) )
@ -943,7 +943,7 @@ void LLTextBase::drawText()
continue;
}
U32 misspell_start = llmax<U32>(misspell_it->first, seg_start), misspell_end = llmin<U32>(misspell_it->second, seg_end);
U32 misspell_start = llmax<U32>(misspell_it->first, (U32)seg_start), misspell_end = llmin<U32>(misspell_it->second, (U32)seg_end);
S32 squiggle_start = 0, squiggle_end = 0, pony = 0;
cur_segment->getDimensions(seg_start - cur_segment->getStart(), misspell_start - seg_start, squiggle_start, pony);
cur_segment->getDimensions(misspell_start - cur_segment->getStart(), misspell_end - misspell_start, squiggle_end, pony);
@ -966,7 +966,7 @@ void LLTextBase::drawText()
squiggle_start += 4;
}
if (misspell_it->second > seg_end)
if (misspell_it->second > (U32)seg_end)
{
break;
}
@ -3945,9 +3945,9 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
void LLNormalTextSegment::dump() const
{
LL_INFOS() << "Segment [" <<
// mColor.mV[VX] << ", " <<
// mColor.mV[VY] << ", " <<
// mColor.mV[VZ] << "]\t[" <<
// mColor.mV[VRED] << ", " <<
// mColor.mV[VGREEN] << ", " <<
// mColor.mV[VBLUE] << "]\t[" <<
mStart << ", " <<
getEnd() << "]" <<
LL_ENDL;

View File

@ -1,25 +1,25 @@
/**
/**
* @file lltextvalidate.cpp
* @brief Text validation helper functions
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/

View File

@ -1,4 +1,4 @@
/**
/**
* @file lltextbase.h
* @author Martin Reddy
* @brief The base class of text box/editor, providing Url handling support
@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/

View File

@ -3,22 +3,22 @@
* @brief Viewer event recording and playback support for mouse and keyboard events
*
* $LicenseInfo:firstyear=2013&license=viewerlgpl$
*
*
* Copyright (c) 2013, 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$
*/
@ -27,10 +27,10 @@
#define LL_VIEWER_EVENT_RECORDER
#include "linden_common.h"
#include "linden_common.h"
#include "lldir.h"
#include "llsd.h"
#include "lldir.h"
#include "llsd.h"
#include "llfile.h"
#include "lldate.h"
#include "llsdserialize.h"
@ -46,7 +46,7 @@ class LLViewerEventRecorder : public LLSimpleton<LLViewerEventRecorder>
public:
LLViewerEventRecorder();
~LLViewerEventRecorder();
void updateMouseEventInfo(S32 local_x,S32 local_y, S32 global_x, S32 global_y, std::string mName);
void setMouseLocalCoords(S32 x,S32 y);
void setMouseGlobalCoords(S32 x,S32 y);
@ -75,12 +75,12 @@ public:
bool logEvents;
std::string mLogFilename;
llofstream mLog;
llofstream mLog;
private:
// Mouse event info
// Mouse event info
S32 global_x;
S32 global_y;
S32 local_x;
@ -92,7 +92,7 @@ public:
// Actually write the event out to llsd log file
void recordEvent(LLSD event);
void clear(S32 r);
void clear(S32 r);
static const S32 UNDEFINED=-1;
};

View File

@ -25,7 +25,7 @@
* $/LicenseInfo$
*/
// A control that allows to set two related vector magnitudes by manipulating a single vector on a plane.
// A control that allows to set two related vector magnitudes by manipulating a single vector on a plane.
#include "linden_common.h"
@ -158,7 +158,7 @@ void drawArrow(S32 tailX, S32 tailY, S32 tipX, S32 tipY, LLColor4 color)
S32 dy = tipY - tailY;
S32 arrowLength = (abs(dx) < ARROW_LENGTH_LONG && abs(dy) < ARROW_LENGTH_LONG) ? ARROW_LENGTH_SHORT : ARROW_LENGTH_LONG;
F32 theta = std::atan2(dy, dx);
F32 rad = ARROW_ANGLE * std::atan(1) * 4 / 180;

View File

@ -253,7 +253,7 @@ HRESULT GetVideoMemoryViaWMI(WCHAR* strInputDeviceID, DWORD* pdwAdapterRam)
}
//static
S32 LLDXHardware::getMBVideoMemoryViaWMI()
U32 LLDXHardware::getMBVideoMemoryViaWMI()
{
DWORD vram = 0;
if (SUCCEEDED(GetVideoMemoryViaWMI(NULL, &vram)))

View File

@ -107,7 +107,7 @@ public:
// Will get memory of best GPU in MB, return memory on sucsess, 0 on failure
// Note: WMI is not accurate in some cases
static S32 getMBVideoMemoryViaWMI();
static U32 getMBVideoMemoryViaWMI();
// Find a particular device that matches the following specs.
// Empty strings indicate that you don't care.

View File

@ -447,7 +447,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
mMaxCores = llmin(mMaxCores, (U32) 64);
DWORD_PTR mask = 0;
for (int i = 0; i < mMaxCores; ++i)
for (U32 i = 0; i < mMaxCores; ++i)
{
mask |= ((DWORD_PTR) 1) << i;
}

View File

@ -16607,7 +16607,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<string>U32</string>
<key>Value</key>
<integer>8</integer>
</map>

View File

@ -25,7 +25,7 @@
// debug stub
float random (vec2 uv)
float random (vec2 uv)
{
return 0.f;
}

View File

@ -379,7 +379,7 @@ void FSFloaterPerformance::draw()
getChild<LLTextBox>("frame_breakdown")->setText(getString("frame_stats", args));
auto button = getChild<LLButton>("AutoTuneFPS");
if((bool)button->getToggleState() != LLPerfStats::tunables.userAutoTuneEnabled)
if (button->getToggleState() != LLPerfStats::tunables.userAutoTuneEnabled)
{
button->toggleState();
}
@ -392,7 +392,7 @@ void FSFloaterPerformance::draw()
{
U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns;
// If the target frame time < non avatar frame time then we can pototentially reach it.
if (non_avatar_time_ns < target_frame_time_ns)
if (non_avatar_time_ns < (U32)target_frame_time_ns)
{
textbox->setColor(LLUIColorTable::instance().getColor("orange"));
}

View File

@ -728,7 +728,7 @@ void FSRadar::updateRadarList()
U32 loop = 0;
while (loop < num_entering)
{
for (S32 i = 0; i < num_this_pass; i++)
for (U32 i = 0; i < num_this_pass; i++)
{
msg = llformat("%s,%s", msg.c_str(), mRadarEnterAlerts[loop + i].asString().c_str());
}
@ -757,7 +757,7 @@ void FSRadar::updateRadarList()
U32 loop = 0;
while (loop < num_leaving)
{
for (S32 i = 0; i < num_this_pass; i++)
for (U32 i = 0; i < num_this_pass; i++)
{
msg = llformat("%s,%s", msg.c_str(), mRadarLeaveAlerts[loop + i].asString().c_str());
}

View File

@ -1,5 +1,5 @@
#!/bin/bash
# just run this script each time after you change the installer's name to fix the icon misalignment
# just run this script each time after you change the installer's name to fix the icon misalignment
mydir="$(dirname "$0")"
# If there's more than one DMG in more than one build directory, pick the most
# recent one.

View File

@ -27,7 +27,7 @@ for LLKDECONFIG in kde-config kde4-config; do
LLKDEPROTODIR=`$LLKDECONFIG --path services | cut -d ':' -f 1`
if [ -d "$LLKDEPROTODIR" ]; then
LLKDEPROTOFILE=${LLKDEPROTODIR}/secondlife.protocol
cat > ${LLKDEPROTOFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTOFILE}
cat > ${LLKDEPROTOFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTOFILE}
[Protocol]
exec=${HANDLER} '%u'
protocol=secondlife

View File

@ -3925,12 +3925,12 @@ LLSD LLAppViewer::getViewerInfo() const
info["CPU"] = gSysCPU.getCPUString();
info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Megabytes>());
info["USED_RAM"] = LLSD::Real(LLMemory::getAllocatedMemKB().valueInUnits<LLUnits::Megabytes>());
info["CONCURRENCY"] = LLSD::Integer((S32)boost::thread::hardware_concurrency()); // <FS:Beq> Add hardware concurrency to info
info["CONCURRENCY"] = LLSD::Integer(std::thread::hardware_concurrency()); // <FS:Beq> Add hardware concurrency to info
// Moved hack adjustment to Windows memory size into llsys.cpp
info["OS_VERSION"] = LLOSInfo::instance().getOSString();
info["GRAPHICS_CARD_VENDOR"] = ll_safe_string((const char*)(glGetString(GL_VENDOR)));
info["GRAPHICS_CARD"] = ll_safe_string((const char*)(glGetString(GL_RENDERER)));
info["GRAPHICS_CARD_MEMORY"] = gGLManager.mVRAM;
info["GRAPHICS_CARD_MEMORY"] = LLSD::Integer(gGLManager.mVRAM);
#if LL_WINDOWS
std::string drvinfo;

View File

@ -48,7 +48,7 @@ void LLCone::render(S32 sides)
gGL.begin(LLRender::TRIANGLE_FAN);
gGL.vertex3f(0,0,0);
for (U32 i = 0; i < sides; i++)
for (S32 i = 0; i < sides; i++)
{
F32 a = (F32) i/sides * F_PI*2.f;
F32 x = cosf(a)*0.5f;
@ -61,7 +61,7 @@ void LLCone::render(S32 sides)
gGL.begin(LLRender::TRIANGLE_FAN);
gGL.vertex3f(0.f, 0.f, 0.5f);
for (U32 i = 0; i < sides; i++)
for (S32 i = 0; i < sides; i++)
{
F32 a = (F32) i/sides * F_PI*2.f;
F32 x = cosf(a)*0.5f;

View File

@ -262,7 +262,7 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass)
if (mShaderLevel == 1)
{
fog_color.mV[VW] = log(fog_density) / log(2);
fog_color.mV[VALPHA] = log(fog_density) / log(2);
}
F32 water_height = environment.getWaterHeight();

View File

@ -2653,7 +2653,7 @@ LLSettingsDay::ptr_t LLEnvironment::createDayCycleFromEnvironment(EnvSelection_t
if (type == "sky")
{
for (S32 idx = 1; idx < LLSettingsDay::TRACK_MAX; ++idx)
for (U32 idx = 1; idx < LLSettingsDay::TRACK_MAX; ++idx)
day->clearCycleTrack(idx);
day->setSettingsAtKeyframe(settings, 0.0f, 1);
}

View File

@ -1242,7 +1242,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
if (mVertexBuffer.notNull())
{
if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
if (num_indices + mIndicesIndex > mVertexBuffer->getNumIndices())
{
if (gDebugGL)
{
@ -1258,7 +1258,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
return false;
}
if (num_vertices + mGeomIndex > mVertexBuffer->getNumVerts())
if (num_vertices + (U32)mGeomIndex > mVertexBuffer->getNumVerts())
{
if (gDebugGL)
{
@ -1319,14 +1319,15 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
clearState(GLOBAL);
}
// <FS:ND> Protection against faces w/o te set.
// LLColor4U color = tep->getColor();
LLColor4U color = (tep ? tep->getColor() : LLColor4());
// </FS:ND>
if (tep && tep->getGLTFRenderMaterial())
LLColor4U color{};
if (tep)
{
color = tep->getGLTFRenderMaterial()->mBaseColor;
color = tep->getColor();
if (tep->getGLTFRenderMaterial())
{
color = tep->getGLTFRenderMaterial()->mBaseColor;
}
}
if (rebuild_color)
@ -1683,7 +1684,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume,
mask.setElement<2>();
mask.setElement<3>();
U32 count = num_vertices/2 + num_vertices%2;
S32 count = num_vertices/2 + num_vertices%2;
for (S32 i = 0; i < count; i++)
{
@ -2429,7 +2430,7 @@ bool LLFace::verify(const U32* indices_array) const
}
// First, check whether the face data fits within the pool's range.
if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
if ((U32)(mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
{
ok = false;
LL_INFOS() << "Face references invalid vertices!" << LL_ENDL;

View File

@ -45,7 +45,7 @@ LLFetchedGLTFMaterial::LLFetchedGLTFMaterial()
LLFetchedGLTFMaterial::~LLFetchedGLTFMaterial()
{
}
LLFetchedGLTFMaterial& LLFetchedGLTFMaterial::operator=(const LLFetchedGLTFMaterial& rhs)

View File

@ -91,7 +91,7 @@ LLFloater360Capture::~LLFloater360Capture()
// gAgent.set360CaptureActive(false); // <FS:Beq/> make FS Area search work again
// gAgent.changeInterestListMode(mStartILMode);
// }
if ( !LLApp::isExiting() )
if (!LLApp::isExiting())
{
gAgent.set360CaptureActive(false); // <FS:Beq/> make FS Area search work again
gAgent.changeInterestListMode(IL_MODE_DEFAULT);// The Change Interest Mode target mode is indicative only. If something else is holding the 360 mode open then this will be ignored.
@ -430,9 +430,9 @@ void LLFloater360Capture::mockSnapShot(LLImageRaw* raw)
unsigned int depth = raw->getComponents();
unsigned char* pixels = raw->getData();
for (int y = 0; y < height; y++)
for (unsigned int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
for (unsigned int x = 0; x < width; x++)
{
unsigned long offset = y * width * depth + x * depth;
unsigned char red = x * 256 / width;

View File

@ -1,24 +1,24 @@
/**
/**
* @file llfloatercamerapresets.h
*
* $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$
*/

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterchangeitemthumbnail.cpp
* @brief LLFloaterChangeItemThumbnail class implementation
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, 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$
*/
@ -97,7 +97,7 @@ void LLThumbnailImagePicker::notify(const std::vector<std::string>& filenames)
{
return;
}
LLFloaterSimpleSnapshot::uploadThumbnail(file_path, mInventoryId, mTaskId, mCallback);
}
@ -637,7 +637,7 @@ void LLFloaterChangeItemThumbnail::onRemove(void *userdata)
LLNotificationsUtil::add("DeleteThumbnail", LLSD(), payload, boost::bind(&LLFloaterChangeItemThumbnail::onRemovalConfirmation, _1, _2, self->getHandle()));
}
// static
// static
void LLFloaterChangeItemThumbnail::onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFloater> handle)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloatereditenvironmentbase.cpp
* @brief Floaters to create and edit fixed settings for sky and water.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloatereditenvironmentbase.h
* @brief Floaters to create and edit fixed settings for sky and water.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@ -54,7 +54,7 @@ public:
virtual void onFocusReceived() override;
virtual void onFocusLost() override;
virtual LLSettingsBase::ptr_t getEditSettings() const = 0;
virtual bool isDirty() const override { return getIsDirty(); }
@ -141,7 +141,7 @@ private:
bool mIsDirty;
bool mCanEdit;
on_dirty_charged_sg mOnDirtyChanged;
};

View File

@ -1195,7 +1195,7 @@ void LLFloaterEditExtDayCycle::updateButtons()
}
else
{
for (S32 track = 1; track < LLSettingsDay::TRACK_MAX; ++track)
for (U32 track = 1; track < LLSettingsDay::TRACK_MAX; ++track)
{
if (track == mCurrentTrack)
continue;
@ -1220,7 +1220,7 @@ void LLFloaterEditExtDayCycle::updateButtons()
// update track buttons
bool extended_env = LLEnvironment::instance().isExtendedEnvironmentEnabled();
for (S32 track = 0; track < LLSettingsDay::TRACK_MAX; ++track)
for (U32 track = 0; track < LLSettingsDay::TRACK_MAX; ++track)
{
LLButton* button = getChild<LLButton>(track_tabs[track], true);
button->setEnabled(extended_env);

View File

@ -39,9 +39,9 @@
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
#include "llsdserialize.h"
#include "lltextbox.h"
#include "lltextbox.h"
#include "lltrans.h"
#include "llviewerchat.h"
#include "llviewerchat.h"
#include "llviewercontrol.h" // <FS:Beq/> Add B&W emoji font support
LLFloaterEmojiPicker::recent_emojis_updated_callback_t LLFloaterEmojiPicker::sRecentEmojisUpdatedCallback{}; // <FS:Ansariel> Live-update recently used emojis

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterfixedenvironment.cpp
* @brief Floaters to create and edit fixed settings for sky and water.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@ -260,7 +260,7 @@ void LLFloaterEnvironmentAdjust::onButtonReset()
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
LLEnvironment::instance().updateEnvironment();
}
});
});
}
//-------------------------------------------------------------------------

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterenvironmentadjust.h
* @brief Floaters to create and edit fixed settings for sky and water.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterfixedenvironment.cpp
* @brief Floaters to create and edit fixed settings for sky and water.
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@ -429,7 +429,7 @@ bool LLFloaterFixedEnvironmentWater::postBuild()
void LLFloaterFixedEnvironmentWater::updateEditEnvironment(void)
{
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,
std::static_pointer_cast<LLSettingsWater>(mSettings));
}
@ -437,7 +437,7 @@ void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key)
{
if (!mSettings)
{
// Initialize the settings, take a snapshot of the current water.
// Initialize the settings, take a snapshot of the current water.
mSettings = LLEnvironment::instance().getEnvironmentFixedWater(LLEnvironment::ENV_CURRENT)->buildClone();
mSettings->setName("Snapshot water (new)");
@ -461,7 +461,7 @@ void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector<
LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename, messages);
if (!legacywater)
{
{
LLNotificationsUtil::add("WLImportFail", messages);
return;
}
@ -508,7 +508,7 @@ bool LLFloaterFixedEnvironmentSky::postBuild()
void LLFloaterFixedEnvironmentSky::updateEditEnvironment(void)
{
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,
std::static_pointer_cast<LLSettingsSky>(mSettings));
}
@ -516,7 +516,7 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key)
{
if (!mSettings)
{
// Initialize the settings, take a snapshot of the current water.
// Initialize the settings, take a snapshot of the current water.
mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone();
mSettings->setName("Snapshot sky (new)");
LLEnvironment::instance().saveBeaconsState();
@ -548,7 +548,7 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector<std:
LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename, messages);
if (!legacysky)
{
{
LLNotificationsUtil::add("WLImportFail", messages);
return;

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterforgetuser.cpp
* @brief LLFloaterForgetUser class definition.
*
* $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$
*/
@ -157,7 +157,7 @@ bool LLFloaterForgetUser::onConfirmForget(const LLSD& notification, const LLSD&
return false;
}
// static
// static
bool LLFloaterForgetUser::onConfirmLogout(const LLSD& notification, const LLSD& response, const std::string &fav_id, const std::string &grid)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterforgetuser.h
* @brief LLFloaterForgetUser class declaration.
*
* $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$
*/

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloatergridstatus.h
* @brief Grid status floater - uses an embedded web browser to show Grid status info
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2017, 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$
*/

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterhowto.h
* @brief A variant of web floater meant to open guidebook
*
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2021, 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$
*/

View File

@ -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$
*/
@ -278,7 +278,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,7 +317,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)
return false;
if (context == PARAMETER_EDIT)
{
{
return (selected.size() == 1) && isSettingSelected(selected.front());
}
else if (context == PARAMETER_COPY)
@ -364,11 +364,11 @@ bool LLFloaterMyEnvironment::canApply(const std::string &context)
return false;
if (context == PARAMETER_REGION)
{
{
return LLEnvironment::instance().canAgentUpdateRegionEnvironment();
}
else if (context == PARAMETER_PARCEL)
{
{
return LLEnvironment::instance().canAgentUpdateParcelEnvironment();
}
else

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaternewfeaturenotification.cpp
* @brief LLFloaterNewFeatureNotification class implementation
*
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2023, 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$
*/
@ -46,7 +46,7 @@ bool LLFloaterNewFeatureNotification::postBuild()
const std::string title_txt = "title_txt";
const std::string dsc_txt = "description_txt";
std::string feature = "_" + getKey().asString();
getChild<LLUICtrl>(title_txt)->setValue(getString(title_txt + feature));
getChild<LLUICtrl>(dsc_txt)->setValue(getString(dsc_txt + feature));

View File

@ -1,24 +1,24 @@
/**
/**
* @file llfloaterperformance.cpp
*
* $LicenseInfo:firstyear=2021&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2021, 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$
*/
@ -186,7 +186,7 @@ void LLFloaterPerformance::draw()
{
enableAutotuneWarning();
if (mUpdateTimer->hasExpired() &&
if (mUpdateTimer->hasExpired() &&
!LLFloaterReg::instanceVisible("save_pref_preset", PRESETS_GRAPHIC)) // give user a chance to save the graphics settings before updating them
{
setFPSText();
@ -447,7 +447,7 @@ void LLFloaterPerformance::populateNearbyList()
row[0]["column"] = "complex_visual";
row[0]["type"] = "bar";
LLSD& value = row[0]["value"];
// The ratio used in the bar is the current cost, as soon as we take action this changes so we keep the
// The ratio used in the bar is the current cost, as soon as we take action this changes so we keep the
// pre-tune value for the numerical column and sorting.
value["ratio"] = render_av_gpu_ms / mNearbyMaxGPUTime;
value["bottom"] = BAR_BOTTOM_PAD;
@ -571,7 +571,7 @@ void LLFloaterPerformance::updateMaxRenderTime()
{
LLAvatarComplexityControls::updateMaxRenderTime(
mNearbyPanel->getChild<LLSliderCtrl>("RenderAvatarMaxART"),
mNearbyPanel->getChild<LLTextBox>("RenderAvatarMaxARTText"),
mNearbyPanel->getChild<LLTextBox>("RenderAvatarMaxARTText"),
true);
}
@ -684,7 +684,7 @@ bool is_ALM_available()
{
bool bumpshiny = LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump");
bool shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
return LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
bumpshiny &&
shaders;

View File

@ -1,25 +1,25 @@
/**
/**
* @file llfloaterprofiletexture.h
* @brief LLFloaterProfileTexture class definition
*
* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2022, 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$
*/

View File

@ -75,7 +75,7 @@ static bool is_valid_update(const LLSD& data)
++count;
}
else
{
{
LL_WARNS() << "Missing required parameter: object_id" << LL_ENDL;
return false;
}
@ -95,7 +95,7 @@ static bool is_valid_update(const LLSD& data)
++count;
}
else
{
{
LL_WARNS() << "Missing required parameter: side" << LL_ENDL;
return false;
}
@ -121,7 +121,7 @@ static bool is_valid_update(const LLSD& data)
}
if (count < 3)
{
{
LL_WARNS() << "Only specified object_id and side, update won't actually change anything and is just noise" << LL_ENDL;
return false;
}
@ -175,7 +175,7 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s
LLSDSerialize::fromNotation(data, str, data_in.length());
const LLHost& host = msg->getSender();
LLViewerRegion* region = LLWorld::instance().getRegion(host);
llassert(region);
@ -201,7 +201,7 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s
bool has_te[MAX_TES] = { false };
if (tes.isArray()) // NOTE: if no "te" array exists, this is a malformed message (null out all overrides will come in as an empty te array)
{
{
LLGLTFOverrideCacheEntry cache;
cache.mLocalId = local_id;
cache.mObjectId = id;
@ -253,7 +253,7 @@ void LLGLTFMaterialList::queueOverrideUpdate(const LLUUID& id, S32 side, LLGLTFM
{
#if 0
override_list_t& overrides = mQueuedOverrides[id];
if (overrides.size() < side + 1)
{
overrides.resize(side + 1);
@ -373,7 +373,7 @@ void LLGLTFMaterialList::queueUpdate(const LLSD& data)
{
sUpdates = LLSD::emptyArray();
}
sUpdates[sUpdates.size()] = data;
}
@ -393,7 +393,7 @@ void LLGLTFMaterialList::flushUpdates(void(*done_callback)(bool))
data[i]["object_id"] = e.object_id;
data[i]["side"] = e.side;
if (e.has_override)
{
data[i]["gltf_json"] = e.override_data.asJSON();
@ -579,7 +579,7 @@ LLFetchedGLTFMaterial* LLGLTFMaterialList::getMaterial(const LLUUID& id)
gAssetStorage->getAssetData(id, LLAssetType::AT_MATERIAL, onAssetLoadComplete, (void*)user_data);
}
return mat;
}

Some files were not shown because too many files have changed in this diff Show More