Merge branch 'master' of https://github.com/Lirusaito/SingularityViewer.git
Conflicts: indra/newview/llviewerobjectlist.cpp indra/newview/llviewerpartsim.cpp
This commit is contained in:
@@ -254,7 +254,6 @@ set(llcommon_HEADER_FILES
|
||||
metapropertyt.h
|
||||
reflective.h
|
||||
reflectivet.h
|
||||
roles_constants.h
|
||||
stdenums.h
|
||||
stdtypes.h
|
||||
string_table.h
|
||||
|
||||
@@ -118,16 +118,6 @@ enum EAddPosition
|
||||
ADD_BOTTOM
|
||||
};
|
||||
|
||||
enum LLGroupChange
|
||||
{
|
||||
GC_PROPERTIES,
|
||||
GC_MEMBER_DATA,
|
||||
GC_ROLE_DATA,
|
||||
GC_ROLE_MEMBER_DATA,
|
||||
GC_TITLES,
|
||||
GC_ALL
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// DEPRECATED - create new, more specific files for shared enums/constants
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -178,7 +178,7 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
|
||||
while(input_stream.good())
|
||||
{
|
||||
input_stream.getline(buffer, MAX_STRING);
|
||||
sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */
|
||||
if (sscanf(buffer, " %254s %254s", keyword, valuestr) < 1) continue;
|
||||
if(0 == strcmp("{",keyword))
|
||||
{
|
||||
continue;
|
||||
@@ -610,7 +610,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp)
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
|
||||
sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */
|
||||
if (sscanf(buffer, " %254s %254s", keyword, valuestr) < 1) continue;
|
||||
if(0 == strcmp("{",keyword))
|
||||
{
|
||||
continue;
|
||||
@@ -813,10 +813,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
|
||||
while(success && input_stream.good())
|
||||
{
|
||||
input_stream.getline(buffer, MAX_STRING);
|
||||
sscanf( /* Flawfinder: ignore */
|
||||
if (sscanf(
|
||||
buffer,
|
||||
" %254s %254s",
|
||||
keyword, valuestr);
|
||||
keyword, valuestr) < 1) continue;
|
||||
if(0 == strcmp("{",keyword))
|
||||
{
|
||||
continue;
|
||||
@@ -1489,10 +1489,10 @@ BOOL LLInventoryCategory::importFile(LLFILE* fp)
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
|
||||
sscanf( /* Flawfinder: ignore */
|
||||
if (sscanf(
|
||||
buffer,
|
||||
" %254s %254s",
|
||||
keyword, valuestr);
|
||||
keyword, valuestr) < 1) continue;
|
||||
if(0 == strcmp("{",keyword))
|
||||
{
|
||||
continue;
|
||||
@@ -1568,10 +1568,10 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
|
||||
while(input_stream.good())
|
||||
{
|
||||
input_stream.getline(buffer, MAX_STRING);
|
||||
sscanf( /* Flawfinder: ignore */
|
||||
if (sscanf(
|
||||
buffer,
|
||||
" %254s %254s",
|
||||
keyword, valuestr);
|
||||
keyword, valuestr) < 1) continue;
|
||||
if(0 == strcmp("{",keyword))
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llcoordframe.cpp
|
||||
* @brief LLCoordFrame class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llcoordframe.h
|
||||
* @brief LLCoordFrame class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file llinterp.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,31 +3,25 @@
|
||||
* @author Andrew Meadows
|
||||
* @brief Simple line class that can compute nearest approach between two lines
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,31 +4,25 @@
|
||||
* @author Andrew Meadows
|
||||
* @brief Simple line for computing nearest approach between two infinite lines
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include "lldefs.h"
|
||||
//#include "llstl.h" // *TODO: Remove when LLString is gone
|
||||
//#include "llstring.h" // *TODO: Remove when LLString is gone
|
||||
@@ -72,15 +73,21 @@ const F32 F_E = 2.71828182845904523536f;
|
||||
const F32 F_SQRT2 = 1.4142135623730950488016887242097f;
|
||||
const F32 F_SQRT3 = 1.73205080756888288657986402541f;
|
||||
const F32 OO_SQRT2 = 0.7071067811865475244008443621049f;
|
||||
const F32 OO_SQRT3 = 0.577350269189625764509f;
|
||||
const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
|
||||
const F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
|
||||
const F32 F_APPROXIMATELY_ZERO = 0.00001f;
|
||||
const F32 F_LN10 = 2.3025850929940456840179914546844f;
|
||||
const F32 OO_LN10 = 0.43429448190325182765112891891661;
|
||||
const F32 F_LN2 = 0.69314718056f;
|
||||
const F32 OO_LN2 = 1.4426950408889634073599246810019f;
|
||||
|
||||
const F32 F_ALMOST_ZERO = 0.0001f;
|
||||
const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO;
|
||||
|
||||
const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees
|
||||
// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle);
|
||||
|
||||
// BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?
|
||||
const F32 FP_MAG_THRESHOLD = 0.0000001f;
|
||||
|
||||
@@ -111,6 +118,12 @@ inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f <
|
||||
// WARNING: Infinity is comparable with F32_MAX and negative
|
||||
// infinity is comparable with F32_MIN
|
||||
|
||||
// handles negative and positive zeros
|
||||
inline bool is_zero(F32 x)
|
||||
{
|
||||
return (*(U32*)(&x) & 0x7fffffff) == 0;
|
||||
}
|
||||
|
||||
inline bool is_approx_equal(F32 x, F32 y)
|
||||
{
|
||||
const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "sys.h"
|
||||
#include "llmath.h"
|
||||
|
||||
static LL_ALIGN_16(const F32 M_IDENT_3A[12]) =
|
||||
|
||||
@@ -2,36 +2,28 @@
|
||||
* @file llmodularmath.cpp
|
||||
* @brief LLModularMath class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2010, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
// implementation is all in the header, this include dep ensures the unit test is rerun if the implementation changes.
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llmodularmath.h
|
||||
* @brief Useful modular math functions.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2008-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file llperlin.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file llperlin.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -58,34 +58,40 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)
|
||||
|
||||
LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
|
||||
{
|
||||
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX] * s;
|
||||
mQ[VY] = v.mV[VY] * s;
|
||||
mQ[VZ] = v.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)
|
||||
{
|
||||
LLVector3 v(vec);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX] * s;
|
||||
mQ[VY] = v.mV[VY] * s;
|
||||
mQ[VZ] = v.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
LLQuaternion::LLQuaternion(const LLVector3 &x_axis,
|
||||
@@ -136,57 +142,61 @@ void LLQuaternion::quantize8(F32 lower, F32 upper)
|
||||
|
||||
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, F32 x, F32 y, F32 z)
|
||||
{
|
||||
LLVector3 vec(x, y, z);
|
||||
vec.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = vec.mV[VX]*s;
|
||||
mQ[VY] = vec.mV[VY]*s;
|
||||
mQ[VZ] = vec.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(x * x + y * y + z * z);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = x * s;
|
||||
mQ[VY] = y * s;
|
||||
mQ[VZ] = z * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector3 &vec)
|
||||
{
|
||||
LLVector3 v(vec);
|
||||
v.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector4 &vec)
|
||||
{
|
||||
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
@@ -219,68 +229,80 @@ const LLQuaternion& LLQuaternion::set(const LLMatrix4 &mat)
|
||||
// deprecated
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 angle, F32 x, F32 y, F32 z)
|
||||
{
|
||||
LLVector3 vec(x, y, z);
|
||||
vec.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = vec.mV[VX]*s;
|
||||
mQ[VY] = vec.mV[VY]*s;
|
||||
mQ[VZ] = vec.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(x * x + y * y + z * z);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = x * s;
|
||||
mQ[VY] = y * s;
|
||||
mQ[VZ] = z * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector3 &vec)
|
||||
{
|
||||
LLVector3 v(vec);
|
||||
v.normalize();
|
||||
|
||||
angle *= 0.5f;
|
||||
F32 c, s;
|
||||
c = cosf(angle);
|
||||
s = sinf(angle);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector4 &vec)
|
||||
{
|
||||
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
|
||||
v.normalize();
|
||||
|
||||
F32 c, s;
|
||||
c = cosf(angle*0.5f);
|
||||
s = sinf(angle*0.5f);
|
||||
|
||||
mQ[VX] = v.mV[VX]*s;
|
||||
mQ[VY] = v.mV[VY]*s;
|
||||
mQ[VZ] = v.mV[VZ]*s;
|
||||
mQ[VW] = c;
|
||||
|
||||
normalize();
|
||||
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
angle *= 0.5;
|
||||
F32 c = cosf(angle);
|
||||
F32 s = sinf(angle) / mag;
|
||||
mQ[VX] = vec.mV[VX] * s;
|
||||
mQ[VY] = vec.mV[VY] * s;
|
||||
mQ[VZ] = vec.mV[VZ] * s;
|
||||
mQ[VW] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadIdentity();
|
||||
}
|
||||
return (*this);
|
||||
}
|
||||
|
||||
const LLQuaternion& LLQuaternion::setQuat(F32 roll, F32 pitch, F32 yaw)
|
||||
{
|
||||
LLMatrix3 rot_mat(roll, pitch, yaw);
|
||||
rot_mat.orthogonalize();
|
||||
*this = rot_mat.quaternion();
|
||||
|
||||
normalize();
|
||||
roll *= 0.5f;
|
||||
pitch *= 0.5f;
|
||||
yaw *= 0.5f;
|
||||
F32 sinX = sinf(roll);
|
||||
F32 cosX = cosf(roll);
|
||||
F32 sinY = sinf(pitch);
|
||||
F32 cosY = cosf(pitch);
|
||||
F32 sinZ = sinf(yaw);
|
||||
F32 cosZ = cosf(yaw);
|
||||
mQ[VW] = cosX * cosY * cosZ - sinX * sinY * sinZ;
|
||||
mQ[VX] = sinX * cosY * cosZ + cosX * sinY * sinZ;
|
||||
mQ[VY] = cosX * sinY * cosZ - sinX * cosY * sinZ;
|
||||
mQ[VZ] = cosX * cosY * sinZ + sinX * sinY * cosZ;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
@@ -425,68 +447,44 @@ LLMatrix4 LLQuaternion::getMatrix4(void) const
|
||||
// calculate the shortest rotation from a to b
|
||||
void LLQuaternion::shortestArc(const LLVector3 &a, const LLVector3 &b)
|
||||
{
|
||||
// Make a local copy of both vectors.
|
||||
LLVector3 vec_a = a;
|
||||
LLVector3 vec_b = b;
|
||||
|
||||
// Make sure neither vector is zero length. Also normalize
|
||||
// the vectors while we are at it.
|
||||
F32 vec_a_mag = vec_a.normalize();
|
||||
F32 vec_b_mag = vec_b.normalize();
|
||||
if (vec_a_mag < F_APPROXIMATELY_ZERO ||
|
||||
vec_b_mag < F_APPROXIMATELY_ZERO)
|
||||
F32 ab = a * b; // dotproduct
|
||||
LLVector3 c = a % b; // crossproduct
|
||||
F32 cc = c * c; // squared length of the crossproduct
|
||||
if (ab * ab + cc) // test if the arguments have sufficient magnitude
|
||||
{
|
||||
// Can't calculate a rotation from this.
|
||||
// Just return ZERO_ROTATION instead.
|
||||
loadIdentity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Create an axis to rotate around, and the cos of the angle to rotate.
|
||||
LLVector3 axis = vec_a % vec_b;
|
||||
F32 cos_theta = vec_a * vec_b;
|
||||
|
||||
// Check the angle between the vectors to see if they are parallel or anti-parallel.
|
||||
if (cos_theta > 1.0 - F_APPROXIMATELY_ZERO)
|
||||
{
|
||||
// a and b are parallel. No rotation is necessary.
|
||||
loadIdentity();
|
||||
}
|
||||
else if (cos_theta < -1.0 + F_APPROXIMATELY_ZERO)
|
||||
{
|
||||
// a and b are anti-parallel.
|
||||
// Rotate 180 degrees around some orthogonal axis.
|
||||
// Find the projection of the x-axis onto a, and try
|
||||
// using the vector between the projection and the x-axis
|
||||
// as the orthogonal axis.
|
||||
LLVector3 proj = vec_a.mV[VX] / (vec_a * vec_a) * vec_a;
|
||||
LLVector3 ortho_axis(1.f, 0.f, 0.f);
|
||||
ortho_axis -= proj;
|
||||
|
||||
// Turn this into an orthonormal axis.
|
||||
F32 ortho_length = ortho_axis.normalize();
|
||||
// If the axis' length is 0, then our guess at an orthogonal axis
|
||||
// was wrong (a is parallel to the x-axis).
|
||||
if (ortho_length < F_APPROXIMATELY_ZERO)
|
||||
if (cc > 0.0f) // test if the arguments are (anti)parallel
|
||||
{
|
||||
// Use the z-axis instead.
|
||||
ortho_axis.setVec(0.f, 0.f, 1.f);
|
||||
F32 s = sqrtf(ab * ab + cc) + ab; // note: don't try to optimize this line
|
||||
F32 m = 1.0f / sqrtf(cc + s * s); // the inverted magnitude of the quaternion
|
||||
mQ[VX] = c.mV[VX] * m;
|
||||
mQ[VY] = c.mV[VY] * m;
|
||||
mQ[VZ] = c.mV[VZ] * m;
|
||||
mQ[VW] = s * m;
|
||||
return;
|
||||
}
|
||||
if (ab < 0.0f) // test if the angle is bigger than PI/2 (anti parallel)
|
||||
{
|
||||
c = a - b; // the arguments are anti-parallel, we have to choose an axis
|
||||
F32 m = sqrtf(c.mV[VX] * c.mV[VX] + c.mV[VY] * c.mV[VY]); // the length projected on the XY-plane
|
||||
if (m > FP_MAG_THRESHOLD)
|
||||
{
|
||||
mQ[VX] = -c.mV[VY] / m; // return the quaternion with the axis in the XY-plane
|
||||
mQ[VY] = c.mV[VX] / m;
|
||||
mQ[VZ] = 0.0f;
|
||||
mQ[VW] = 0.0f;
|
||||
return;
|
||||
}
|
||||
else // the vectors are parallel to the Z-axis
|
||||
{
|
||||
mQ[VX] = 1.0f; // rotate around the X-axis
|
||||
mQ[VY] = 0.0f;
|
||||
mQ[VZ] = 0.0f;
|
||||
mQ[VW] = 0.0f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a quaternion from this orthonormal axis.
|
||||
mQ[VX] = ortho_axis.mV[VX];
|
||||
mQ[VY] = ortho_axis.mV[VY];
|
||||
mQ[VZ] = ortho_axis.mV[VZ];
|
||||
mQ[VW] = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// a and b are NOT parallel or anti-parallel.
|
||||
// Return the rotation between these vectors.
|
||||
F32 theta = (F32)acos(cos_theta);
|
||||
|
||||
setAngleAxis(theta, axis);
|
||||
}
|
||||
loadIdentity();
|
||||
}
|
||||
|
||||
// constrains rotation to a cone angle specified in radians
|
||||
@@ -838,79 +836,82 @@ LLQuaternion::Order StringToOrder( const char *str )
|
||||
|
||||
void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const
|
||||
{
|
||||
F32 cos_a = mQ[VW];
|
||||
if (cos_a > 1.0f) cos_a = 1.0f;
|
||||
if (cos_a < -1.0f) cos_a = -1.0f;
|
||||
|
||||
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
|
||||
|
||||
if ( fabs( sin_a ) < 0.0005f )
|
||||
sin_a = 1.0f;
|
||||
else
|
||||
sin_a = 1.f/sin_a;
|
||||
|
||||
F32 temp_angle = 2.0f * (F32) acos( cos_a );
|
||||
if (temp_angle > F_PI)
|
||||
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
|
||||
if (v > FP_MAG_THRESHOLD)
|
||||
{
|
||||
// The (angle,axis) pair should never have angles outside [PI, -PI]
|
||||
// since we want the _shortest_ (angle,axis) solution.
|
||||
// Since acos is defined for [0, PI], and we multiply by 2.0, we
|
||||
// can push the angle outside the acceptible range.
|
||||
// When this happens we set the angle to the other portion of a
|
||||
// full 2PI rotation, and negate the axis, which reverses the
|
||||
// direction of the rotation (by the right-hand rule).
|
||||
*angle = 2.f * F_PI - temp_angle;
|
||||
vec.mV[VX] = - mQ[VX] * sin_a;
|
||||
vec.mV[VY] = - mQ[VY] * sin_a;
|
||||
vec.mV[VZ] = - mQ[VZ] * sin_a;
|
||||
F32 oomag = 1.0f / v;
|
||||
F32 w = mQ[VW];
|
||||
if (mQ[VW] < 0.0f)
|
||||
{
|
||||
w = -w; // make VW positive
|
||||
oomag = -oomag; // invert the axis
|
||||
}
|
||||
vec.mV[VX] = mQ[VX] * oomag; // normalize the axis
|
||||
vec.mV[VY] = mQ[VY] * oomag;
|
||||
vec.mV[VZ] = mQ[VZ] * oomag;
|
||||
*angle = 2.0f * atan2f(v, w); // get the angle
|
||||
}
|
||||
else
|
||||
{
|
||||
*angle = temp_angle;
|
||||
vec.mV[VX] = mQ[VX] * sin_a;
|
||||
vec.mV[VY] = mQ[VY] * sin_a;
|
||||
vec.mV[VZ] = mQ[VZ] * sin_a;
|
||||
*angle = 0.0f; // no rotation
|
||||
vec.mV[VX] = 0.0f; // around some dummy axis
|
||||
vec.mV[VY] = 0.0f;
|
||||
vec.mV[VZ] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// quaternion does not need to be normalized
|
||||
void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const
|
||||
{
|
||||
LLMatrix3 rot_mat(*this);
|
||||
rot_mat.orthogonalize();
|
||||
rot_mat.getEulerAngles(roll, pitch, yaw);
|
||||
|
||||
// // NOTE: LLQuaternion's are actually inverted with respect to
|
||||
// // the matrices, so this code also assumes inverted quaternions
|
||||
// // (-x, -y, -z, w). The result is that roll,pitch,yaw are applied
|
||||
// // in reverse order (yaw,pitch,roll).
|
||||
// F32 x = -mQ[VX], y = -mQ[VY], z = -mQ[VZ], w = mQ[VW];
|
||||
// F64 m20 = 2.0*(x*z-y*w);
|
||||
// if (1.0f - fabsf(m20) < F_APPROXIMATELY_ZERO)
|
||||
// {
|
||||
// *roll = 0.0f;
|
||||
// *pitch = (F32)asin(m20);
|
||||
// *yaw = (F32)atan2(2.0*(x*y-z*w), 1.0 - 2.0*(x*x+z*z));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// *roll = (F32)atan2(-2.0*(y*z+x*w), 1.0-2.0*(x*x+y*y));
|
||||
// *pitch = (F32)asin(m20);
|
||||
// *yaw = (F32)atan2(-2.0*(x*y+z*w), 1.0-2.0*(y*y+z*z));
|
||||
// }
|
||||
F32 sx = 2 * (mQ[VX] * mQ[VW] - mQ[VY] * mQ[VZ]); // sine of the roll
|
||||
F32 sy = 2 * (mQ[VY] * mQ[VW] + mQ[VX] * mQ[VZ]); // sine of the pitch
|
||||
F32 ys = mQ[VW] * mQ[VW] - mQ[VY] * mQ[VY]; // intermediate cosine 1
|
||||
F32 xz = mQ[VX] * mQ[VX] - mQ[VZ] * mQ[VZ]; // intermediate cosine 2
|
||||
F32 cx = ys - xz; // cosine of the roll
|
||||
F32 cy = sqrtf(sx * sx + cx * cx); // cosine of the pitch
|
||||
if (cy > GIMBAL_THRESHOLD) // no gimbal lock
|
||||
{
|
||||
*roll = atan2f(sx, cx);
|
||||
*pitch = atan2f(sy, cy);
|
||||
*yaw = atan2f(2 * (mQ[VZ] * mQ[VW] - mQ[VX] * mQ[VY]), ys + xz);
|
||||
}
|
||||
else // gimbal lock
|
||||
{
|
||||
if (sy > 0)
|
||||
{
|
||||
*pitch = F_PI_BY_TWO;
|
||||
*yaw = 2 * atan2f(mQ[VZ] + mQ[VX], mQ[VW] + mQ[VY]);
|
||||
}
|
||||
else
|
||||
{
|
||||
*pitch = -F_PI_BY_TWO;
|
||||
*yaw = 2 * atan2f(mQ[VZ] - mQ[VX], mQ[VW] - mQ[VY]);
|
||||
}
|
||||
*roll = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Saves space by using the fact that our quaternions are normalized
|
||||
LLVector3 LLQuaternion::packToVector3() const
|
||||
{
|
||||
F32 x = mQ[VX];
|
||||
F32 y = mQ[VY];
|
||||
F32 z = mQ[VZ];
|
||||
F32 w = mQ[VW];
|
||||
F32 mag = sqrtf(x * x + y * y + z * z + w * w);
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
x /= mag;
|
||||
y /= mag;
|
||||
z /= mag; // no need to normalize w, it's not used
|
||||
}
|
||||
if( mQ[VW] >= 0 )
|
||||
{
|
||||
return LLVector3( mQ[VX], mQ[VY], mQ[VZ] );
|
||||
return LLVector3( x, y , z );
|
||||
}
|
||||
else
|
||||
{
|
||||
return LLVector3( -mQ[VX], -mQ[VY], -mQ[VZ] );
|
||||
return LLVector3( -x, -y, -z );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,43 +304,29 @@ inline const LLQuaternion& LLQuaternion::setQuat(const F32 *q)
|
||||
return (*this);
|
||||
}
|
||||
|
||||
// There may be a cheaper way that avoids the sqrt.
|
||||
// Does sin_a = VX*VX + VY*VY + VZ*VZ?
|
||||
// Copied from Matrix and Quaternion FAQ 1.12
|
||||
inline void LLQuaternion::getAngleAxis(F32* angle, F32* x, F32* y, F32* z) const
|
||||
{
|
||||
F32 cos_a = mQ[VW];
|
||||
if (cos_a > 1.0f) cos_a = 1.0f;
|
||||
if (cos_a < -1.0f) cos_a = -1.0f;
|
||||
|
||||
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
|
||||
|
||||
if ( fabs( sin_a ) < 0.0005f )
|
||||
sin_a = 1.0f;
|
||||
else
|
||||
sin_a = 1.f/sin_a;
|
||||
|
||||
F32 temp_angle = 2.0f * (F32) acos( cos_a );
|
||||
if (temp_angle > F_PI)
|
||||
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
|
||||
if (v > FP_MAG_THRESHOLD)
|
||||
{
|
||||
// The (angle,axis) pair should never have angles outside [PI, -PI]
|
||||
// since we want the _shortest_ (angle,axis) solution.
|
||||
// Since acos is defined for [0, PI], and we multiply by 2.0, we
|
||||
// can push the angle outside the acceptible range.
|
||||
// When this happens we set the angle to the other portion of a
|
||||
// full 2PI rotation, and negate the axis, which reverses the
|
||||
// direction of the rotation (by the right-hand rule).
|
||||
*angle = 2.f * F_PI - temp_angle;
|
||||
*x = - mQ[VX] * sin_a;
|
||||
*y = - mQ[VY] * sin_a;
|
||||
*z = - mQ[VZ] * sin_a;
|
||||
F32 oomag = 1.0f / v;
|
||||
F32 w = mQ[VW];
|
||||
if (w < 0.0f)
|
||||
{
|
||||
w = -w; // make VW positive
|
||||
oomag = -oomag; // invert the axis
|
||||
}
|
||||
*x = mQ[VX] * oomag; // normalize the axis
|
||||
*y = mQ[VY] * oomag;
|
||||
*z = mQ[VZ] * oomag;
|
||||
*angle = 2.0f * atan2f(v, w); // get the angle
|
||||
}
|
||||
else
|
||||
{
|
||||
*angle = temp_angle;
|
||||
*x = mQ[VX] * sin_a;
|
||||
*y = mQ[VY] * sin_a;
|
||||
*z = mQ[VZ] * sin_a;
|
||||
*angle = 0.0f; // no rotation
|
||||
*x = 0.0f; // around some dummy axis
|
||||
*y = 0.0f;
|
||||
*z = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1648,7 +1648,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
|
||||
F32 t = (F32)i * mStep;
|
||||
mPath[i].mPos.set(0,
|
||||
lerp(0, -sin(F_PI*params.getTwist()*t)*0.5f,t),
|
||||
lerp(-0.5, cos(F_PI*params.getTwist()*t)*0.5f,t));
|
||||
lerp(-0.5f, cos(F_PI*params.getTwist()*t)*0.5f,t));
|
||||
mPath[i].mScale.set(lerp(1,params.getScale().mV[0],t),
|
||||
lerp(1,params.getScale().mV[1],t), 0,1);
|
||||
mPath[i].mTexT = t;
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llvolumemgr.h
|
||||
* @brief LLVolumeMgr class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m3math.cpp
|
||||
* @brief LLMatrix3 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m3math.h
|
||||
* @brief LLMatrix3 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m4math.cpp
|
||||
* @brief LLMatrix4 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -684,37 +678,6 @@ const LLMatrix4& LLMatrix4::initMatrix(const LLMatrix3 &mat, const LLVector4 &
|
||||
|
||||
// LLMatrix4 Operators
|
||||
|
||||
|
||||
/* Not implemented to help enforce code consistency with the syntax of
|
||||
row-major notation. This is a Good Thing.
|
||||
LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b)
|
||||
{
|
||||
// Operate "to the right" on column-vector b
|
||||
LLVector4 vec;
|
||||
vec.mV[VX] = a.mMatrix[VX][VX] * b.mV[VX] +
|
||||
a.mMatrix[VY][VX] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VX] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VX] * b.mV[VW];
|
||||
|
||||
vec.mV[VY] = a.mMatrix[VX][VY] * b.mV[VX] +
|
||||
a.mMatrix[VY][VY] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VY] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VY] * b.mV[VW];
|
||||
|
||||
vec.mV[VZ] = a.mMatrix[VX][VZ] * b.mV[VX] +
|
||||
a.mMatrix[VY][VZ] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VZ] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VZ] * b.mV[VW];
|
||||
|
||||
vec.mV[VW] = a.mMatrix[VX][VW] * b.mV[VX] +
|
||||
a.mMatrix[VY][VW] * b.mV[VY] +
|
||||
a.mMatrix[VZ][VW] * b.mV[VZ] +
|
||||
a.mMatrix[VW][VW] * b.mV[VW];
|
||||
return vec;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b)
|
||||
{
|
||||
// Operate "to the left" on row-vector a
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file m4math.h
|
||||
* @brief LLMatrix4 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -229,9 +223,6 @@ public:
|
||||
// Operators
|
||||
//
|
||||
|
||||
// Not implemented to enforce code that agrees with symbolic syntax
|
||||
// friend LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b); // Apply rotation a to vector b
|
||||
|
||||
// friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b); // Return a * b
|
||||
friend LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b); // Return transform of vector a by matrix b
|
||||
friend const LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b); // Return full transform of a by matrix b
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file raytrace.cpp
|
||||
* @brief Functions called by box object scripts.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file raytrace.h
|
||||
* @brief Ray intersection tests for primitives.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v2math.cpp
|
||||
* @brief LLVector2 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v2math.h
|
||||
* @brief LLVector2 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3color.cpp
|
||||
* @brief LLColor3 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3color.h
|
||||
* @brief LLColor3 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -39,6 +33,7 @@ class LLVector4;
|
||||
#include "llerror.h"
|
||||
#include "llmath.h"
|
||||
#include "llsd.h"
|
||||
#include <string.h>
|
||||
|
||||
// LLColor3 = |r g b|
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3dmath.cpp
|
||||
* @brief LLVector3d class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -72,17 +72,22 @@ class LLVector3d
|
||||
BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed
|
||||
BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed
|
||||
|
||||
inline const LLVector3d& clearVec(); // Clears LLVector3d to (0, 0, 0, 1)
|
||||
inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
|
||||
inline const LLVector3d& clearVec(); // deprecated
|
||||
inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
|
||||
inline const LLVector3d& zeroVec(); // deprecated
|
||||
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
|
||||
inline const LLVector3d& setVec(const LLVector3d &vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& setVec(const F64 *vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& setVec(const LLVector3 &vec);
|
||||
inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
|
||||
inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
|
||||
inline const LLVector3d& set(const LLVector3 &vec);
|
||||
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
|
||||
inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
|
||||
inline const LLVector3d& setVec(const F64 *vec); // deprecated
|
||||
inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
|
||||
|
||||
F64 magVec() const; // Returns magnitude of LLVector3d
|
||||
F64 magVecSquared() const; // Returns magnitude squared of LLVector3d
|
||||
inline F64 normVec(); // Normalizes and returns the magnitude of LLVector3d
|
||||
F64 magVec() const; // deprecated
|
||||
F64 magVecSquared() const; // deprecated
|
||||
inline F64 normVec(); // deprecated
|
||||
|
||||
F64 length() const; // Returns magnitude of LLVector3d
|
||||
F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
|
||||
@@ -127,7 +132,15 @@ class LLVector3d
|
||||
|
||||
typedef LLVector3d LLGlobalVec;
|
||||
|
||||
const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
|
||||
inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
|
||||
{
|
||||
mdV[0] = vec.mV[0];
|
||||
mdV[1] = vec.mV[1];
|
||||
mdV[2] = vec.mV[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
|
||||
{
|
||||
mdV[0] = vec.mV[0];
|
||||
mdV[1] = vec.mV[1];
|
||||
@@ -184,6 +197,14 @@ inline BOOL LLVector3d::isFinite() const
|
||||
|
||||
// Clear and Assignment Functions
|
||||
|
||||
inline const LLVector3d& LLVector3d::clear(void)
|
||||
{
|
||||
mdV[0] = 0.f;
|
||||
mdV[1] = 0.f;
|
||||
mdV[2]= 0.f;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::clearVec(void)
|
||||
{
|
||||
mdV[0] = 0.f;
|
||||
@@ -208,6 +229,30 @@ inline const LLVector3d& LLVector3d::zeroVec(void)
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 z)
|
||||
{
|
||||
mdV[VX] = x;
|
||||
mdV[VY] = y;
|
||||
mdV[VZ] = z;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
|
||||
{
|
||||
mdV[0] = vec.mdV[0];
|
||||
mdV[1] = vec.mdV[1];
|
||||
mdV[2] = vec.mdV[2];
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::set(const F64 *vec)
|
||||
{
|
||||
mdV[0] = vec[0];
|
||||
mdV[1] = vec[1];
|
||||
mdV[2] = vec[2];
|
||||
return (*this);
|
||||
}
|
||||
|
||||
inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F64 z)
|
||||
{
|
||||
mdV[VX] = x;
|
||||
@@ -472,4 +517,15 @@ inline LLVector3d projected_vec(const LLVector3d &a, const LLVector3d &b)
|
||||
return project_axis * (a * project_axis);
|
||||
}
|
||||
|
||||
inline LLVector3d inverse_projected_vec(const LLVector3d& a, const LLVector3d& b)
|
||||
{
|
||||
LLVector3d normalized_a = a;
|
||||
normalized_a.normalize();
|
||||
LLVector3d normalized_b = b;
|
||||
F64 b_length = normalized_b.normalize();
|
||||
|
||||
F64 dot_product = normalized_a * normalized_b;
|
||||
return normalized_a * (b_length / dot_product);
|
||||
}
|
||||
|
||||
#endif // LL_V3DMATH_H
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v3math.cpp
|
||||
* @brief LLVector3 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -159,6 +159,7 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
|
||||
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
|
||||
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
|
||||
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
|
||||
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a scaled such that projected_vec(inverse_projected_vec(a, b), b) == b;
|
||||
LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
|
||||
LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
|
||||
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
|
||||
@@ -490,9 +491,27 @@ inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)
|
||||
|
||||
inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
|
||||
{
|
||||
LLVector3 project_axis = b;
|
||||
project_axis.normalize();
|
||||
return project_axis * (a * project_axis);
|
||||
F32 bb = b * b;
|
||||
if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD)
|
||||
{
|
||||
return ((a * b) / bb) * b;
|
||||
}
|
||||
else
|
||||
{
|
||||
return b.zero;
|
||||
}
|
||||
}
|
||||
|
||||
inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
|
||||
{
|
||||
LLVector3 normalized_a = a;
|
||||
normalized_a.normalize();
|
||||
LLVector3 normalized_b = b;
|
||||
F32 b_length = normalized_b.normalize();
|
||||
|
||||
F32 dot_product = normalized_a * normalized_b;
|
||||
//NB: if a _|_ b, then returns an infinite vector
|
||||
return normalized_a * (b_length / dot_product);
|
||||
}
|
||||
|
||||
inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b)
|
||||
@@ -556,15 +575,13 @@ inline void update_min_max(LLVector3& min, LLVector3& max, const F32* pos)
|
||||
|
||||
inline F32 angle_between(const LLVector3& a, const LLVector3& b)
|
||||
{
|
||||
LLVector3 an = a;
|
||||
LLVector3 bn = b;
|
||||
an.normalize();
|
||||
bn.normalize();
|
||||
F32 cosine = an * bn;
|
||||
F32 angle = (cosine >= 1.0f) ? 0.0f :
|
||||
(cosine <= -1.0f) ? F_PI :
|
||||
(F32)acos(cosine);
|
||||
return angle;
|
||||
F32 ab = a * b; // dotproduct
|
||||
if (ab == -0.0f)
|
||||
{
|
||||
ab = 0.0f; // get rid of negative zero
|
||||
}
|
||||
LLVector3 c = a % b; // crossproduct
|
||||
return atan2f(sqrtf(c * c), ab); // return the angle
|
||||
}
|
||||
|
||||
inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v4coloru.cpp
|
||||
* @brief LLColor4U class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v4math.cpp
|
||||
* @brief LLVector4 class implementation.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file v4math.h
|
||||
* @brief LLVector4 class header file.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
/**
|
||||
* @file xform.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -42,7 +36,7 @@ LLXform::~LLXform()
|
||||
{
|
||||
}
|
||||
|
||||
// Link optimization - don't inline these llwarns
|
||||
// Link optimization - don't inline these LL_WARNS()
|
||||
void LLXform::warn(const char* const msg)
|
||||
{
|
||||
llwarns << msg << llendl;
|
||||
|
||||
@@ -104,9 +104,9 @@ public:
|
||||
inline void setRotation(const F32 x, const F32 y, const F32 z, const F32 s);
|
||||
|
||||
// Above functions must be inline for speed, but also
|
||||
// need to emit warnings. llwarns causes inline LLError::CallSite
|
||||
// need to emit warnings. LL_WARNS() causes inline LLError::CallSite
|
||||
// static objects that make more work for the linker.
|
||||
// Avoid inline llwarns by calling this function.
|
||||
// Avoid inline LL_WARNS() by calling this function.
|
||||
void warn(const char* const msg);
|
||||
|
||||
void setChanged(const U32 bits) { mChanged |= bits; }
|
||||
|
||||
@@ -905,7 +905,7 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri
|
||||
#define P2(n, b) AIHTTPTimeoutPolicy n##_timeout(#n, b)
|
||||
|
||||
// Policy name Policy
|
||||
P(accountingCostResponder);
|
||||
//P(accountingCostResponder);
|
||||
P(agentStateResponder);
|
||||
P(appearanceChangeMetricsResponder);
|
||||
P(assetUploadResponder);
|
||||
@@ -936,6 +936,7 @@ P(fetchScriptLimitsRegionSummaryResponder);
|
||||
P(fnPtrResponder);
|
||||
P(floaterPermsResponder);
|
||||
P2(gamingDataReceived, transfer_22s_connect_10s);
|
||||
P(groupBanDataResponder);
|
||||
P2(groupMemberDataResponder, transfer_300s);
|
||||
P2(groupProposalBallotResponder, transfer_300s);
|
||||
P(homeLocationResponder);
|
||||
@@ -992,4 +993,4 @@ P(webProfileResponders);
|
||||
P(wholeModelFeeResponder);
|
||||
P(wholeModelUploadResponder);
|
||||
P2(XMLRPCResponder, connect_40s);
|
||||
P2(crashLoggerResponder, transfer_300s);
|
||||
P2(crashLoggerResponder, transfer_300s);
|
||||
|
||||
@@ -95,7 +95,7 @@ class AIHTTPTimeoutPolicy {
|
||||
void sanity_checks(void) const;
|
||||
|
||||
// Accessors.
|
||||
char const* name(void) const { return mName; }
|
||||
char const* name(void) const { return mName ? mName : "AIHTTPTimeoutPolicyBase"; }
|
||||
U16 getConnectTimeout(std::string const& hostname) const;
|
||||
U16 getDNSLookup(void) const { return mDNSLookupGrace; }
|
||||
U16 getConnect(void) const { return mMaximumConnectTime; }
|
||||
|
||||
@@ -192,13 +192,13 @@ public:
|
||||
: mAgentIDs(agent_ids)
|
||||
{ }
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
// Pull expiration out of headers if available
|
||||
F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mReceivedHeaders);
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
|
||||
LLSD agents = content["agents"];
|
||||
LLSD agents = mContent["agents"];
|
||||
LLSD::array_const_iterator it = agents.beginArray();
|
||||
for ( ; it != agents.endArray(); ++it)
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
}
|
||||
|
||||
// Same logic as error response case
|
||||
LLSD unresolved_agents = content["bad_ids"];
|
||||
LLSD unresolved_agents = mContent["bad_ids"];
|
||||
S32 num_unresolved = unresolved_agents.size();
|
||||
if (num_unresolved > 0)
|
||||
{
|
||||
@@ -252,13 +252,13 @@ public:
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
// If there's an error, it might be caused by PeopleApi,
|
||||
// or when loading textures on startup and using a very slow
|
||||
// network, this query may time out.
|
||||
// What we should do depends on whether or not we have a cached name
|
||||
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::error " << status << " " << reason
|
||||
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::httpFailure " << mStatus << " " << mReason
|
||||
<< LL_ENDL;
|
||||
|
||||
// Add dummy records for any agent IDs in this request that we do not have cached already
|
||||
@@ -794,6 +794,7 @@ void LLAvatarNameCache::setUseDisplayNames(bool use)
|
||||
if (use != sUseDisplayNames)
|
||||
{
|
||||
sUseDisplayNames = use;
|
||||
LL_DEBUGS("AvNameCache") << "Display names are now: " << (use ? "on" : "off") << LL_ENDL;
|
||||
// flush our cache
|
||||
sCache.clear();
|
||||
|
||||
|
||||
@@ -312,36 +312,36 @@ AIHTTPTimeoutPolicy const& LLHTTPClient::ResponderBase::getHTTPTimeoutPolicy(voi
|
||||
return AIHTTPTimeoutPolicy::getDebugSettingsCurlTimeout();
|
||||
}
|
||||
|
||||
void LLHTTPClient::ResponderBase::decode_llsd_body(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer, LLSD& content)
|
||||
void LLHTTPClient::ResponderBase::decode_llsd_body(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
AICurlInterface::Stats::llsd_body_count++;
|
||||
if (is_internal_http_error(status))
|
||||
if (is_internal_http_error(mStatus))
|
||||
{
|
||||
// In case of an internal error (ie, a curl error), a description of the (curl) error is the best we can do.
|
||||
// In any case, the body if anything was received at all, can not be relied upon.
|
||||
content = reason;
|
||||
mContent = mReason;
|
||||
return;
|
||||
}
|
||||
// If the status indicates success (and we get here) then we expect the body to be LLSD.
|
||||
bool const should_be_llsd = (200 <= status && status < 300);
|
||||
bool const should_be_llsd = isGoodStatus(mStatus);
|
||||
if (should_be_llsd)
|
||||
{
|
||||
LLBufferStream istr(channels, buffer.get());
|
||||
if (LLSDSerialize::fromXML(content, istr) == LLSDParser::PARSE_FAILURE)
|
||||
if (LLSDSerialize::fromXML(mContent, istr) == LLSDParser::PARSE_FAILURE)
|
||||
{
|
||||
// Unfortunately we can't show the body of the message... I think this is a pretty serious error
|
||||
// though, so if this ever happens it has to be investigated by making a copy of the buffer
|
||||
// before serializing it, as is done below.
|
||||
llwarns << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl;
|
||||
llwarns << "Failed to deserialize LLSD. " << mURL << " [" << mStatus << "]: " << mReason << llendl;
|
||||
AICurlInterface::Stats::llsd_body_parse_error++;
|
||||
}
|
||||
// LLSDSerialize::fromXML destructed buffer, we can't initialize content now.
|
||||
// LLSDSerialize::fromXML destructed buffer, we can't initialize mContent now.
|
||||
return;
|
||||
}
|
||||
// Put the body in content as-is.
|
||||
// Put the body in mContent as-is.
|
||||
std::stringstream ss;
|
||||
buffer->writeChannelTo(ss, channels.in());
|
||||
content = ss.str();
|
||||
mContent = ss.str();
|
||||
#ifdef SHOW_ASSERT
|
||||
if (!should_be_llsd)
|
||||
{
|
||||
@@ -357,7 +357,7 @@ void LLHTTPClient::ResponderBase::decode_llsd_body(U32 status, std::string const
|
||||
LLSDSerialize::fromXML(dummy, ss) > 0;
|
||||
if (server_sent_llsd_with_http_error)
|
||||
{
|
||||
llwarns << "The server sent us a response with http status " << status << " and LLSD(!) body: \"" << ss.str() << "\"!" << llendl;
|
||||
llwarns << "The server sent us a response with http status " << mStatus << " and LLSD(!) body: \"" << ss.str() << "\"!" << llendl;
|
||||
}
|
||||
// This is not really an error, and it has been known to happen before. It just normally never happens (at the moment)
|
||||
// and therefore warrants an investigation. Linden Lab (or other grids) might start to send error messages
|
||||
@@ -370,14 +370,14 @@ void LLHTTPClient::ResponderBase::decode_llsd_body(U32 status, std::string const
|
||||
#endif
|
||||
}
|
||||
|
||||
void LLHTTPClient::ResponderBase::decode_raw_body(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer, std::string& content)
|
||||
void LLHTTPClient::ResponderBase::decode_raw_body(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer, std::string& content)
|
||||
{
|
||||
AICurlInterface::Stats::raw_body_count++;
|
||||
if (is_internal_http_error(status))
|
||||
if (is_internal_http_error(mStatus))
|
||||
{
|
||||
// In case of an internal error (ie, a curl error), a description of the (curl) error is the best we can do.
|
||||
// In any case, the body if anything was received at all, can not be relied upon.
|
||||
content = reason;
|
||||
content = mReason;
|
||||
return;
|
||||
}
|
||||
LLMutexLock lock(buffer->getMutex());
|
||||
@@ -409,19 +409,43 @@ std::string const& LLHTTPClient::ResponderBase::get_cookie(std::string const& ke
|
||||
return empty_dummy;
|
||||
}
|
||||
|
||||
std::string LLHTTPClient::ResponderBase::dumpResponse(void) const
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "[responder:" << getName() << "] "
|
||||
<< "[URL:" << mURL << "] "
|
||||
<< "[status:" << mStatus << "] "
|
||||
<< "[reason:" << mReason << "] ";
|
||||
|
||||
AIHTTPReceivedHeaders::range_type content_type;
|
||||
if (mReceivedHeaders.getValues("content-type", content_type))
|
||||
{
|
||||
for (AIHTTPReceivedHeaders::iterator_type iter = content_type.first; iter != content_type.second; ++iter)
|
||||
{
|
||||
s << "[content-type:" << iter->second << "] ";
|
||||
}
|
||||
}
|
||||
|
||||
if (mContent.isDefined())
|
||||
{
|
||||
s << "[content:" << LLSDOStreamer<LLSDXMLFormatter>(mContent, LLSDFormatter::OPTIONS_PRETTY) << "]";
|
||||
}
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
// Called with HTML body.
|
||||
// virtual
|
||||
void LLHTTPClient::ResponderWithCompleted::completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
void LLHTTPClient::ResponderWithCompleted::completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
LLSD content;
|
||||
decode_llsd_body(status, reason, channels, buffer, content);
|
||||
decode_llsd_body(channels, buffer);
|
||||
|
||||
// Allow derived class to override at this point.
|
||||
completed(status, reason, content);
|
||||
httpCompleted();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLHTTPClient::ResponderWithCompleted::completed(U32 status, std::string const& reason, LLSD const& content)
|
||||
void LLHTTPClient::ResponderWithCompleted::httpCompleted(void)
|
||||
{
|
||||
// Either completedRaw() or this method must be overridden by the derived class. Hence, we should never get here.
|
||||
llassert_always(false);
|
||||
@@ -431,36 +455,31 @@ void LLHTTPClient::ResponderWithCompleted::completed(U32 status, std::string con
|
||||
void LLHTTPClient::ResponderWithResult::finished(CURLcode code, U32 http_status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
mCode = code;
|
||||
mStatus = http_status;
|
||||
mReason = reason;
|
||||
|
||||
LLSD content;
|
||||
decode_llsd_body(http_status, reason, channels, buffer, content);
|
||||
// Fill mContent.
|
||||
decode_llsd_body(channels, buffer);
|
||||
|
||||
// HTTP status good?
|
||||
if (200 <= http_status && http_status < 300)
|
||||
if (isGoodStatus(http_status))
|
||||
{
|
||||
// Allow derived class to override at this point.
|
||||
result(content);
|
||||
httpSuccess();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Allow derived class to override at this point.
|
||||
errorWithContent(http_status, reason, content);
|
||||
httpFailure();
|
||||
}
|
||||
|
||||
mFinished = true;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLHTTPClient::ResponderWithResult::errorWithContent(U32 status, std::string const& reason, LLSD const&)
|
||||
void LLHTTPClient::ResponderWithResult::httpFailure(void)
|
||||
{
|
||||
// Allow derived class to override at this point.
|
||||
error(status, reason);
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLHTTPClient::ResponderWithResult::error(U32 status, std::string const& reason)
|
||||
{
|
||||
llinfos << mURL << " [" << status << "]: " << reason << llendl;
|
||||
llinfos << mURL << " [" << mStatus << "]: " << mReason << llendl;
|
||||
}
|
||||
|
||||
// Friend functions.
|
||||
@@ -482,22 +501,20 @@ void intrusive_ptr_release(LLHTTPClient::ResponderBase* responder)
|
||||
// Blocking Responders.
|
||||
//
|
||||
|
||||
class BlockingResponder : public LLHTTPClient::LegacyPolledResponder {
|
||||
class BlockingResponder : public LLHTTPClient::ResponderWithCompleted {
|
||||
private:
|
||||
LLCondition mSignal; // Wait condition to wait till mFinished is true.
|
||||
static LLSD LLSD_dummy;
|
||||
static std::string Raw_dummy;
|
||||
|
||||
public:
|
||||
void wait(void); // Blocks until mFinished is true.
|
||||
virtual LLSD const& getLLSD(void) const { llassert(false); return LLSD_dummy; }
|
||||
virtual std::string const& getRaw(void) const { llassert(false); return Raw_dummy; }
|
||||
/*virtual*/ LLSD const& getContent(void) const { llassert(false); return LLHTTPClient::ResponderWithCompleted::getContent(); }
|
||||
|
||||
protected:
|
||||
void wakeup(void); // Call this at the end of completedRaw.
|
||||
};
|
||||
|
||||
LLSD BlockingResponder::LLSD_dummy;
|
||||
std::string BlockingResponder::Raw_dummy;
|
||||
|
||||
void BlockingResponder::wait(void)
|
||||
@@ -532,14 +549,11 @@ void BlockingResponder::wakeup(void)
|
||||
}
|
||||
|
||||
class BlockingLLSDResponder : public BlockingResponder {
|
||||
private:
|
||||
LLSD mResponse;
|
||||
|
||||
protected:
|
||||
/*virtual*/ LLSD const& getLLSD(void) const { llassert(mFinished && mCode == CURLE_OK); return mResponse; }
|
||||
/*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
/*virtual*/ LLSD const& getContent(void) const { llassert(mFinished && mCode == CURLE_OK); return LLHTTPClient::ResponderWithCompleted::getContent(); }
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
decode_llsd_body(status, reason, channels, buffer, mResponse); // This puts the body asString() in mResponse in case of http error.
|
||||
decode_llsd_body(channels, buffer); // This puts the body asString() in mContent in case of http error.
|
||||
wakeup();
|
||||
}
|
||||
};
|
||||
@@ -550,9 +564,9 @@ private:
|
||||
|
||||
protected:
|
||||
/*virtual*/ std::string const& getRaw(void) const { llassert(mFinished && mCode == CURLE_OK); return mResponse; }
|
||||
/*virtual*/ void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
/*virtual*/ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
decode_raw_body(mCode, reason, channels, buffer, mResponse);
|
||||
decode_raw_body(channels, buffer, mResponse);
|
||||
wakeup();
|
||||
}
|
||||
};
|
||||
@@ -632,7 +646,7 @@ static LLSD blocking_request(
|
||||
|
||||
LLSD response = LLSD::emptyMap();
|
||||
CURLcode result = responder->result_code();
|
||||
S32 http_status = responder->http_status();
|
||||
S32 http_status = responder->getStatus();
|
||||
|
||||
bool http_success = http_status >= 200 && http_status < 300;
|
||||
if (result == CURLE_OK && http_success)
|
||||
@@ -643,7 +657,7 @@ static LLSD blocking_request(
|
||||
}
|
||||
else
|
||||
{
|
||||
response["body"] = responder->getLLSD();
|
||||
response["body"] = responder->getContent();
|
||||
}
|
||||
}
|
||||
else if (result == CURLE_OK && !is_internal_http_error(http_status))
|
||||
@@ -665,7 +679,7 @@ static LLSD blocking_request(
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "CURL ERROR BODY: " << responder->getLLSD().asString() << llendl;
|
||||
llwarns << "CURL ERROR BODY: " << responder->getContent().asString() << llendl;
|
||||
}
|
||||
}
|
||||
if (method == HTTP_RAW_GET)
|
||||
@@ -674,12 +688,12 @@ static LLSD blocking_request(
|
||||
}
|
||||
else
|
||||
{
|
||||
response["body"] = responder->getLLSD().asString();
|
||||
response["body"] = responder->getContent().asString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
response["body"] = responder->reason();
|
||||
response["body"] = responder->getReason();
|
||||
}
|
||||
|
||||
response["status"] = http_status;
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
/**
|
||||
* @brief return true if the status code indicates success.
|
||||
*/
|
||||
static bool isGoodStatus(U32 status)
|
||||
static bool isGoodStatus(S32 status)
|
||||
{
|
||||
return((200 <= status) && (status < 300));
|
||||
}
|
||||
@@ -156,11 +156,11 @@ public:
|
||||
ResponderBase(void);
|
||||
virtual ~ResponderBase();
|
||||
|
||||
// Read body from buffer and put it into content. If status indicates success, interpret it as LLSD, otherwise copy it as-is.
|
||||
void decode_llsd_body(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer, LLSD& content);
|
||||
// Read body from buffer and put it into mContent. If mStatus indicates success, interpret it as LLSD, otherwise copy it as-is.
|
||||
void decode_llsd_body(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);
|
||||
|
||||
// Read body from buffer and put it into content. Always copy it as-is.
|
||||
void decode_raw_body(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer, std::string& content);
|
||||
void decode_raw_body(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer, std::string& content);
|
||||
|
||||
protected:
|
||||
// Associated URL, used for debug output.
|
||||
@@ -172,6 +172,15 @@ public:
|
||||
// The curl result code.
|
||||
CURLcode mCode;
|
||||
|
||||
// HTTP status code, if any.
|
||||
S32 mStatus;
|
||||
|
||||
// Reason for error if mStatus is not good.
|
||||
std::string mReason;
|
||||
|
||||
// Content interpreted as LLSD.
|
||||
LLSD mContent;
|
||||
|
||||
// Set when the transaction finished (with or without errors).
|
||||
bool mFinished;
|
||||
|
||||
@@ -184,6 +193,29 @@ public:
|
||||
std::string const& getURL(void) const { return mURL; }
|
||||
CURLcode result_code(void) const { return mCode; }
|
||||
|
||||
protected:
|
||||
// Short cut.
|
||||
void setResult(S32 status, std::string const& reason, LLSD const& content) { mStatus = status; mReason = reason; mContent = content; mFinished = true; }
|
||||
|
||||
// Call these only from the httpSuccess/httpFailure/httpComplete methods of derived classes.
|
||||
|
||||
LLSD const& getContent(void) const { return mContent; }
|
||||
// You can just access mReceivedHeaders directly from derived classes, but added this accessor
|
||||
// for convenience because upstream introduced this method as part of a new API.
|
||||
AIHTTPReceivedHeaders const& getResponseHeaders(void) const
|
||||
{
|
||||
// If this fails then you need to add '/*virtual*/ bool needsHeaders(void) const { return true; }' to the most derived class.
|
||||
llassert(needsHeaders());
|
||||
return mReceivedHeaders;
|
||||
}
|
||||
// Another convenience method to match upstream.
|
||||
std::string dumpResponse(void) const;
|
||||
public:
|
||||
// The next two are public because blocking_request() needs access too.
|
||||
S32 getStatus(void) const { return mStatus; }
|
||||
std::string const& getReason(void) const { return mReason; }
|
||||
|
||||
public:
|
||||
// Called by BufferedCurlEasyRequest::timed_out or BufferedCurlEasyRequest::processOutput.
|
||||
virtual void finished(CURLcode code, U32 http_status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer) = 0;
|
||||
|
||||
@@ -226,7 +258,9 @@ public:
|
||||
// Called when the whole transaction is completed (also the body was received), but before the body is processed.
|
||||
/*virtual*/ void completed_headers(U32 status, std::string const& reason, AITransferInfo* info)
|
||||
{
|
||||
completedHeaders(status, reason, mReceivedHeaders);
|
||||
mStatus = status;
|
||||
mReason = reason;
|
||||
completedHeaders();
|
||||
}
|
||||
|
||||
// Extract cookie 'key' from mReceivedHeaders and return the string 'key=value', or an empty string if key does not exists.
|
||||
@@ -254,7 +288,7 @@ public:
|
||||
virtual AICapabilityType capability_type(void) const { return cap_other; }
|
||||
|
||||
// Timeout policy to use.
|
||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const = 0;
|
||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const;
|
||||
|
||||
// The name of the derived responder object. For debugging purposes.
|
||||
virtual char const* getName(void) const = 0;
|
||||
@@ -262,7 +296,7 @@ public:
|
||||
protected:
|
||||
// Derived classes can override this to get the HTML headers that were received, when the message is completed.
|
||||
// Only actually called for classes that implement a needsHeaders() that returns true.
|
||||
virtual void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||
virtual void completedHeaders(void)
|
||||
{
|
||||
// The default does nothing.
|
||||
}
|
||||
@@ -289,8 +323,10 @@ public:
|
||||
/*virtual*/ void finished(CURLcode code, U32 http_status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
mCode = code;
|
||||
mStatus = http_status;
|
||||
mReason = reason;
|
||||
// Allow classes derived from ResponderHeadersOnly to override completedHeaders.
|
||||
completedHeaders(http_status, reason, mReceivedHeaders);
|
||||
completedHeaders();
|
||||
mFinished = true;
|
||||
}
|
||||
|
||||
@@ -302,10 +338,9 @@ public:
|
||||
// warning when a class accidently tries to override them.
|
||||
enum YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS { };
|
||||
virtual void completedRaw(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void completed(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void result(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void errorWithContent(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void error(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void httpCompleted(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void httpSuccess(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
virtual void httpFailure(YOU_MAY_ONLY_OVERRIDE_COMPLETED_HEADERS) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -321,9 +356,11 @@ public:
|
||||
/*virtual*/ void finished(CURLcode code, U32 http_status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
mCode = code;
|
||||
mStatus = http_status;
|
||||
mReason = reason;
|
||||
// Allow classes derived from ResponderWithCompleted to override completedRaw
|
||||
// (if not they should override completed or be derived from ResponderWithResult instead).
|
||||
completedRaw(http_status, reason, channels, buffer);
|
||||
completedRaw(channels, buffer);
|
||||
mFinished = true;
|
||||
}
|
||||
|
||||
@@ -331,13 +368,17 @@ public:
|
||||
// Events generated by this class.
|
||||
|
||||
// Derived classes can override this to get the raw data of the body of the HTML message that was received.
|
||||
// The default is to interpret the content as LLSD and call completed().
|
||||
virtual void completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);
|
||||
// The default is to interpret the content as LLSD and call httpCompleted().
|
||||
virtual void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer);
|
||||
|
||||
// ... or, derived classes can override this to get LLSD content when the message is completed.
|
||||
// The default aborts, as it should never be called (can't make it pure virtual though, so
|
||||
// classes that override completedRaw don't need to implement this function, too).
|
||||
virtual void completed(U32 status, std::string const& reason, LLSD const& content);
|
||||
virtual void httpCompleted(void);
|
||||
|
||||
public:
|
||||
// Ugly LL API...
|
||||
void completeResult(S32 status, std::string const& reason, LLSD const& content) { mCode = CURLE_OK; setResult(status, reason, content); httpCompleted(); }
|
||||
|
||||
#ifdef SHOW_ASSERT
|
||||
// Responders derived from this class must override either completedRaw or completed.
|
||||
@@ -345,9 +386,8 @@ public:
|
||||
// Define those functions here with different parameters in order to cause a compile
|
||||
// warning when a class accidently tries to override them.
|
||||
enum YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS { };
|
||||
virtual void result(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
virtual void errorWithContent(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
virtual void error(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
virtual void httpSuccess(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
virtual void httpFailure(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -366,22 +406,18 @@ public:
|
||||
// Events generated by this class.
|
||||
|
||||
// Derived classes must override this to receive the content of a body upon success.
|
||||
virtual void result(LLSD const& content) = 0;
|
||||
|
||||
// Derived classes can override this to get informed when a bad HTML status code is received.
|
||||
// The default calls error().
|
||||
virtual void errorWithContent(U32 status, std::string const& reason, LLSD const& content);
|
||||
virtual void httpSuccess(void) = 0;
|
||||
|
||||
// ... or, derived classes can override this to get informed when a bad HTML status code is received.
|
||||
// The default prints the error to llinfos.
|
||||
virtual void error(U32 status, std::string const& reason);
|
||||
virtual void httpFailure(void);
|
||||
|
||||
public:
|
||||
// Called from LLSDMessage::ResponderAdapter::listener.
|
||||
// LLSDMessage::ResponderAdapter is a hack, showing among others by fact that it needs these functions.
|
||||
|
||||
void pubErrorWithContent(CURLcode code, U32 status, std::string const& reason, LLSD const& content) { mCode = code; errorWithContent(status, reason, content); mFinished = true; }
|
||||
void pubResult(LLSD const& content) { mCode = CURLE_OK; result(content); mFinished = true; }
|
||||
void failureResult(U32 status, std::string const& reason, LLSD const& content, CURLcode code = CURLE_OK) { mCode = code; setResult(status, reason, content); httpFailure(); }
|
||||
void successResult(LLSD const& content) { mCode = CURLE_OK; setResult(HTTP_OK, "", content); httpSuccess(); }
|
||||
|
||||
#ifdef SHOW_ASSERT
|
||||
// Responders derived from this class must override result, and either errorWithContent or error.
|
||||
@@ -390,48 +426,16 @@ public:
|
||||
// warning when a class accidently tries to override them.
|
||||
enum YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS { };
|
||||
virtual void completedRaw(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
virtual void completed(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
virtual void httpCompleted(YOU_ARE_DERIVING_FROM_THE_WRONG_CLASS) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* @class LegacyPolledResponder
|
||||
* @brief As ResponderWithCompleted but caches the result for polling.
|
||||
*
|
||||
* This class allows old polling code to poll if the transaction finished
|
||||
* by calling is_finished() (from the main the thread) and then access the
|
||||
* results-- as opposed to immediately digesting the results when any of
|
||||
* the virtual functions are called.
|
||||
*/
|
||||
class LegacyPolledResponder : public ResponderWithCompleted {
|
||||
protected:
|
||||
U32 mStatus;
|
||||
std::string mReason;
|
||||
|
||||
protected:
|
||||
// The responder finished. Do not override this function in derived classes.
|
||||
/*virtual*/ void finished(CURLcode code, U32 http_status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
mStatus = http_status;
|
||||
mReason = reason;
|
||||
// Call base class implementation.
|
||||
ResponderWithCompleted::finished(code, http_status, reason, channels, buffer);
|
||||
}
|
||||
|
||||
public:
|
||||
LegacyPolledResponder(void) : mStatus(HTTP_INTERNAL_ERROR_OTHER) { }
|
||||
|
||||
// Accessors.
|
||||
U32 http_status(void) const { return mStatus; }
|
||||
std::string const& reason(void) const { return mReason; }
|
||||
};
|
||||
|
||||
/**
|
||||
* @class ResponderIgnoreBody
|
||||
* @brief Base class for responders that ignore the result body.
|
||||
*/
|
||||
class ResponderIgnoreBody : public ResponderWithResult {
|
||||
void result(LLSD const&) { }
|
||||
void httpSuccess(void) { }
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,6 +78,8 @@ const U64 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
|
||||
|
||||
const U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
|
||||
|
||||
const U64 REGION_FLAGS_BLOCK_FLYOVER = (1 << 27);
|
||||
|
||||
const U64 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
|
||||
|
||||
const U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
|
||||
|
||||
@@ -99,14 +99,14 @@ void LLSDMessage::EventResponder::setTimeoutPolicy(std::string const& name)
|
||||
mHTTPTimeoutPolicy = AIHTTPTimeoutPolicy::getTimeoutPolicyByName(name);
|
||||
}
|
||||
|
||||
void LLSDMessage::EventResponder::result(const LLSD& data)
|
||||
void LLSDMessage::EventResponder::httpSuccess(void)
|
||||
{
|
||||
// If our caller passed an empty replyPump name, they're not
|
||||
// listening: this is a fire-and-forget message. Don't bother posting
|
||||
// to the pump whose name is "".
|
||||
if (! mReplyPump.empty())
|
||||
{
|
||||
LLSD response(data);
|
||||
LLSD response(mContent);
|
||||
mReqID.stamp(response);
|
||||
mPumps.obtain(mReplyPump).post(response);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ void LLSDMessage::EventResponder::result(const LLSD& data)
|
||||
}
|
||||
}
|
||||
|
||||
void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
|
||||
void LLSDMessage::EventResponder::httpFailure(void)
|
||||
{
|
||||
// If our caller passed an empty errorPump name, they're not
|
||||
// listening: "default error handling is acceptable." Only post to an
|
||||
@@ -129,9 +129,9 @@ void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string
|
||||
info["target"] = mTarget;
|
||||
info["message"] = mMessage;
|
||||
info["code"] = mCode;
|
||||
info["status"] = LLSD::Integer(status);
|
||||
info["reason"] = reason;
|
||||
info["content"] = content;
|
||||
info["status"] = LLSD::Integer(mStatus);
|
||||
info["reason"] = mReason;
|
||||
info["content"] = mContent;
|
||||
mPumps.obtain(mErrorPump).post(info);
|
||||
}
|
||||
else // default error handling
|
||||
@@ -139,8 +139,8 @@ void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string
|
||||
// convention seems to be to use llinfos, but that seems a bit casual?
|
||||
LL_WARNS("LLSDMessage::EventResponder")
|
||||
<< "'" << mMessage << "' to '" << mTarget
|
||||
<< "' failed with code " << status << ": " << reason << '\n'
|
||||
<< ll_pretty_print_sd(content)
|
||||
<< "' failed with code " << mStatus << ": " << mReason << '\n'
|
||||
<< ll_pretty_print_sd(mContent)
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
@@ -165,15 +165,15 @@ bool LLSDMessage::ResponderAdapter::listener(const LLSD& payload, bool success)
|
||||
LLHTTPClient::ResponderWithResult* responder = dynamic_cast<LLHTTPClient::ResponderWithResult*>(mResponder.get());
|
||||
// If this assertion fails then ResponderAdapter has been used for a ResponderWithCompleted derived class,
|
||||
// which is not allowed because ResponderAdapter can only work for classes derived from Responder that
|
||||
// implement result() and errorWithContent (or just error).
|
||||
// implement httpSuccess() and httpFailure().
|
||||
llassert_always(responder);
|
||||
if (success)
|
||||
{
|
||||
responder->pubResult(payload);
|
||||
responder->successResult(payload);
|
||||
}
|
||||
else
|
||||
{
|
||||
responder->pubErrorWithContent((CURLcode)payload["code"].asInteger(), payload["status"].asInteger(), payload["reason"], payload["content"]);
|
||||
responder->failureResult(payload["status"].asInteger(), payload["reason"], payload["content"], (CURLcode)payload["code"].asInteger());
|
||||
}
|
||||
|
||||
/*---------------- MUST BE LAST STATEMENT BEFORE RETURN ----------------*/
|
||||
|
||||
@@ -156,8 +156,8 @@ private:
|
||||
|
||||
void setTimeoutPolicy(std::string const& name);
|
||||
|
||||
/*virtual*/ void result(const LLSD& data);
|
||||
/*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return *mHTTPTimeoutPolicy; }
|
||||
/*virtual*/ char const* getName(void) const { return "EventResponder"; }
|
||||
|
||||
@@ -91,15 +91,17 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
|
||||
}
|
||||
|
||||
LLMsgBlkData *msg_block_data = iter->second;
|
||||
LLMsgVarData& vardata = msg_block_data->mMemberVarData[vnamep];
|
||||
LLMsgBlkData::msg_var_data_map_t &var_data_map = msg_block_data->mMemberVarData;
|
||||
|
||||
if (!vardata.getName())
|
||||
if (var_data_map.find(vnamep) == var_data_map.end())
|
||||
{
|
||||
llerrs << "Variable "<< vnamep << " not in message "
|
||||
<< mCurrentRMessageData->mName<< " block " << bnamep << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
LLMsgVarData& vardata = msg_block_data->mMemberVarData[vnamep];
|
||||
|
||||
if (size && size != vardata.getSize())
|
||||
{
|
||||
llerrs << "Msg " << mCurrentRMessageData->mName
|
||||
@@ -284,7 +286,7 @@ void LLTemplateMessageReader::getU8(const char *block, const char *var,
|
||||
void LLTemplateMessageReader::getBOOL(const char *block, const char *var,
|
||||
BOOL &b, S32 blocknum )
|
||||
{
|
||||
U8 value;
|
||||
U8 value(0);
|
||||
getData(block, var, &value, sizeof(U8), blocknum);
|
||||
b = (BOOL) value;
|
||||
}
|
||||
|
||||
@@ -116,20 +116,20 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
// don't spam when agent communication disconnected already
|
||||
if (status != 410)
|
||||
if (mStatus != 410)
|
||||
{
|
||||
LL_WARNS("Messaging") << "error status " << status
|
||||
LL_WARNS("Messaging") << "error status " << mStatus
|
||||
<< " for message " << mMessageName
|
||||
<< " reason " << reason << llendl;
|
||||
<< " reason " << mReason << llendl;
|
||||
}
|
||||
// TODO: Map status in to useful error code.
|
||||
// TODO: Map mStatus in to useful error code.
|
||||
if(NULL != mCallback) mCallback(mCallbackData, LL_ERR_TCP_TIMEOUT);
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if(NULL != mCallback) mCallback(mCallbackData, LL_ERR_NOERR);
|
||||
}
|
||||
|
||||
@@ -173,6 +173,11 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
if (!pos_source)
|
||||
{
|
||||
llwarns << "Unable to process mesh without position data; invalid model; invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
domPRef p = tri->getP();
|
||||
domListOfUInts& idx = p->getValue();
|
||||
@@ -182,19 +187,22 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
|
||||
domListOfFloats& tc = tc_source ? tc_source->getFloat_array()->getValue() : dummy ;
|
||||
domListOfFloats& n = norm_source ? norm_source->getFloat_array()->getValue() : dummy ;
|
||||
|
||||
if (pos_source)
|
||||
{
|
||||
face.mExtents[0].set(v[0], v[1], v[2]);
|
||||
face.mExtents[1].set(v[0], v[1], v[2]);
|
||||
}
|
||||
|
||||
LLVolumeFace::VertexMapData::PointMap point_map;
|
||||
|
||||
|
||||
U32 index_count = idx.getCount();
|
||||
U32 vertex_count = pos_source ? v.getCount() : 0;
|
||||
U32 tc_count = tc_source ? tc.getCount() : 0;
|
||||
U32 norm_count = norm_source ? n.getCount() : 0;
|
||||
|
||||
if (vertex_count == 0)
|
||||
{
|
||||
llwarns << "Unable to process mesh with empty position array; invalid model." << llendl;
|
||||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
|
||||
face.mExtents[0].set(v[0], v[1], v[2]);
|
||||
face.mExtents[1].set(v[0], v[1], v[2]);
|
||||
|
||||
for (U32 i = 0; i < index_count; i += idx_stride)
|
||||
{
|
||||
LLVolumeFace::VertexData cv;
|
||||
|
||||
@@ -74,6 +74,11 @@ set(llrender_HEADER_FILES
|
||||
set_source_files_properties(${llrender_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
# Workaround hack for clang bugs
|
||||
if (DARWIN)
|
||||
set_property(SOURCE llgl.cpp PROPERTY COMPILE_FLAGS -O1)
|
||||
endif (DARWIN)
|
||||
|
||||
list(APPEND llrender_SOURCE_FILES ${llrender_HEADER_FILES})
|
||||
|
||||
add_library (llrender ${llrender_SOURCE_FILES})
|
||||
|
||||
@@ -909,6 +909,19 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char)
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOL LLComboBox::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
if (mList->getVisible()) return mList->handleScrollWheel(x, y, clicks);
|
||||
if (mAllowTextEntry) // We might be editable
|
||||
if (!mList->getFirstSelected()) // We aren't in the list, don't kill their text
|
||||
return false;
|
||||
|
||||
setCurrentByIndex(llclamp(getCurrentIndex() + clicks, 0, getItemCount() - 1));
|
||||
prearrangeList();
|
||||
onCommit();
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLComboBox::setAllowTextEntry(BOOL allow, S32 max_chars, BOOL set_tentative)
|
||||
{
|
||||
mAllowTextEntry = allow;
|
||||
@@ -924,6 +937,7 @@ void LLComboBox::setTextEntry(const LLStringExplicit& text)
|
||||
if (mTextEntry)
|
||||
{
|
||||
mTextEntry->setText(text);
|
||||
mTextEntry->setCursor(0); // Singu Note: Move the cursor over to the beginning
|
||||
mHasAutocompletedText = FALSE;
|
||||
updateSelection();
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect);
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
virtual BOOL handleUnicodeCharHere(llwchar uni_char);
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
// LLUICtrl interface
|
||||
virtual void clear(); // select nothing
|
||||
|
||||
@@ -571,6 +571,9 @@ void LLFloater::open() /* Flawfinder: ignore */
|
||||
setVisibleAndFrontmost(mAutoFocus);
|
||||
}
|
||||
|
||||
if (!getControlName().empty())
|
||||
setControlValue(true);
|
||||
|
||||
onOpen();
|
||||
}
|
||||
|
||||
@@ -633,6 +636,9 @@ void LLFloater::close(bool app_quitting)
|
||||
}
|
||||
}
|
||||
|
||||
if (!app_quitting && !getControlName().empty())
|
||||
setControlValue(false);
|
||||
|
||||
// Let floater do cleanup.
|
||||
onClose(app_quitting);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ if (LINUX)
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLRENDER_LIBRARIES}
|
||||
${LLVFS_LIBRARIES}
|
||||
${LLWINDOW_LIBRARIES}
|
||||
${LLXML_LIBRARIES}
|
||||
${UI_LIBRARIES} # for GTK
|
||||
${SDL_LIBRARY}
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file lldxhardware.cpp
|
||||
* @brief LLDXHardware implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -40,9 +34,12 @@
|
||||
#include <dxdiag.h>
|
||||
#undef INITGUID
|
||||
|
||||
#include <wbemidl.h>
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
|
||||
#include "lldxhardware.h"
|
||||
|
||||
#include "llerror.h"
|
||||
|
||||
#include "llstring.h"
|
||||
@@ -59,11 +56,160 @@ LLDXHardware gDXHardware;
|
||||
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
||||
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||||
|
||||
std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
|
||||
typedef BOOL ( WINAPI* PfnCoSetProxyBlanket )( IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc,
|
||||
OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel,
|
||||
RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities );
|
||||
|
||||
HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam )
|
||||
{
|
||||
HRESULT hr;
|
||||
HRESULT hr;
|
||||
bool bGotMemory = false;
|
||||
HRESULT hrCoInitialize = S_OK;
|
||||
IWbemLocator* pIWbemLocator = nullptr;
|
||||
IWbemServices* pIWbemServices = nullptr;
|
||||
BSTR pNamespace = nullptr;
|
||||
|
||||
*pdwAdapterRam = 0;
|
||||
hrCoInitialize = CoInitialize( 0 );
|
||||
|
||||
hr = CoCreateInstance( CLSID_WbemLocator,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_IWbemLocator,
|
||||
( LPVOID* )&pIWbemLocator );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: CoCreateInstance failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
|
||||
if( SUCCEEDED( hr ) && pIWbemLocator )
|
||||
{
|
||||
// Using the locator, connect to WMI in the given namespace.
|
||||
pNamespace = SysAllocString( L"\\\\.\\root\\cimv2" );
|
||||
|
||||
hr = pIWbemLocator->ConnectServer( pNamespace, nullptr, nullptr, 0L,
|
||||
0L, nullptr, nullptr, &pIWbemServices );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: pIWbemLocator->ConnectServer failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
if( SUCCEEDED( hr ) && pIWbemServices != 0 )
|
||||
{
|
||||
HINSTANCE hinstOle32 = nullptr;
|
||||
|
||||
hinstOle32 = LoadLibraryW( L"ole32.dll" );
|
||||
if( hinstOle32 )
|
||||
{
|
||||
PfnCoSetProxyBlanket pfnCoSetProxyBlanket = nullptr;
|
||||
|
||||
pfnCoSetProxyBlanket = ( PfnCoSetProxyBlanket )GetProcAddress( hinstOle32, "CoSetProxyBlanket" );
|
||||
if( pfnCoSetProxyBlanket != 0 )
|
||||
{
|
||||
// Switch security level to IMPERSONATE.
|
||||
pfnCoSetProxyBlanket( pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr,
|
||||
RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, nullptr, 0 );
|
||||
}
|
||||
|
||||
FreeLibrary( hinstOle32 );
|
||||
}
|
||||
|
||||
IEnumWbemClassObject* pEnumVideoControllers = nullptr;
|
||||
BSTR pClassName = nullptr;
|
||||
|
||||
pClassName = SysAllocString( L"Win32_VideoController" );
|
||||
|
||||
hr = pIWbemServices->CreateInstanceEnum( pClassName, 0,
|
||||
nullptr, &pEnumVideoControllers );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: pIWbemServices->CreateInstanceEnum failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
|
||||
if( SUCCEEDED( hr ) && pEnumVideoControllers )
|
||||
{
|
||||
IWbemClassObject* pVideoControllers[10] = {0};
|
||||
DWORD uReturned = 0;
|
||||
BSTR pPropName = nullptr;
|
||||
|
||||
// Get the first one in the list
|
||||
pEnumVideoControllers->Reset();
|
||||
hr = pEnumVideoControllers->Next( 5000, // timeout in 5 seconds
|
||||
10, // return the first 10
|
||||
pVideoControllers,
|
||||
&uReturned );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) ) wprintf( L"WMI: pEnumVideoControllers->Next failed: 0x%0.8x\n", hr );
|
||||
if( uReturned == 0 ) wprintf( L"WMI: pEnumVideoControllers uReturned == 0\n" );
|
||||
#endif
|
||||
|
||||
VARIANT var;
|
||||
if( SUCCEEDED( hr ) )
|
||||
{
|
||||
bool bFound = false;
|
||||
for( UINT iController = 0; iController < uReturned; iController++ )
|
||||
{
|
||||
if ( !pVideoControllers[iController] )
|
||||
continue;
|
||||
|
||||
pPropName = SysAllocString( L"PNPDeviceID" );
|
||||
hr = pVideoControllers[iController]->Get( pPropName, 0L, &var, nullptr, nullptr );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) )
|
||||
wprintf( L"WMI: pVideoControllers[iController]->Get PNPDeviceID failed: 0x%0.8x\n", hr );
|
||||
#endif
|
||||
if( SUCCEEDED( hr ) )
|
||||
{
|
||||
if( wcsstr( var.bstrVal, strInputDeviceID ) != 0 )
|
||||
bFound = true;
|
||||
}
|
||||
VariantClear( &var );
|
||||
if( pPropName ) SysFreeString( pPropName );
|
||||
|
||||
if( bFound )
|
||||
{
|
||||
pPropName = SysAllocString( L"AdapterRAM" );
|
||||
hr = pVideoControllers[iController]->Get( pPropName, 0L, &var, nullptr, nullptr );
|
||||
#ifdef PRINTF_DEBUGGING
|
||||
if( FAILED( hr ) )
|
||||
wprintf( L"WMI: pVideoControllers[iController]->Get AdapterRAM failed: 0x%0.8x\n",
|
||||
hr );
|
||||
#endif
|
||||
if( SUCCEEDED( hr ) )
|
||||
{
|
||||
bGotMemory = true;
|
||||
*pdwAdapterRam = var.ulVal;
|
||||
}
|
||||
VariantClear( &var );
|
||||
if( pPropName ) SysFreeString( pPropName );
|
||||
break;
|
||||
}
|
||||
SAFE_RELEASE( pVideoControllers[iController] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( pClassName )
|
||||
SysFreeString( pClassName );
|
||||
SAFE_RELEASE( pEnumVideoControllers );
|
||||
}
|
||||
|
||||
if( pNamespace )
|
||||
SysFreeString( pNamespace );
|
||||
SAFE_RELEASE( pIWbemServices );
|
||||
}
|
||||
|
||||
SAFE_RELEASE( pIWbemLocator );
|
||||
|
||||
if( SUCCEEDED( hrCoInitialize ) )
|
||||
CoUninitialize();
|
||||
|
||||
if( bGotMemory )
|
||||
return S_OK;
|
||||
else
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void get_wstring(IDxDiagContainer* containerp, WCHAR* wszPropName, WCHAR* wszPropValue, int outputSize)
|
||||
{
|
||||
HRESULT hr;
|
||||
VARIANT var;
|
||||
WCHAR wszPropValue[256];
|
||||
|
||||
VariantInit( &var );
|
||||
hr = containerp->GetProp(wszPropName, &var );
|
||||
@@ -82,13 +228,19 @@ std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
|
||||
wcscpy( wszPropValue, (var.boolVal) ? L"true" : L"false" ); /* Flawfinder: ignore */
|
||||
break;
|
||||
case VT_BSTR:
|
||||
wcsncpy( wszPropValue, var.bstrVal, 255 ); /* Flawfinder: ignore */
|
||||
wszPropValue[255] = 0;
|
||||
wcsncpy( wszPropValue, var.bstrVal, outputSize-1 ); /* Flawfinder: ignore */
|
||||
wszPropValue[outputSize-1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Clear the variant (this is needed to free BSTR memory)
|
||||
VariantClear( &var );
|
||||
}
|
||||
|
||||
std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
|
||||
{
|
||||
WCHAR wszPropValue[256];
|
||||
get_wstring(containerp, wszPropName, wszPropValue, 256);
|
||||
|
||||
return utf16str_to_utf8str(wszPropValue);
|
||||
}
|
||||
@@ -126,7 +278,7 @@ BOOL LLVersion::set(const std::string &version_string)
|
||||
}
|
||||
if (count < 4)
|
||||
{
|
||||
//llwarns << "Potentially bogus version string!" << version_string << llendl;
|
||||
//LL_WARNS() << "Potentially bogus version string!" << version_string << LL_ENDL;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
mFields[i] = 0;
|
||||
@@ -177,6 +329,7 @@ std::string LLDXDriverFile::dump()
|
||||
LLDXDevice::~LLDXDevice()
|
||||
{
|
||||
for_each(mDriverFiles.begin(), mDriverFiles.end(), DeletePairedPointer());
|
||||
mDriverFiles.clear();
|
||||
}
|
||||
|
||||
std::string LLDXDevice::dump()
|
||||
@@ -236,6 +389,7 @@ LLDXHardware::LLDXHardware()
|
||||
void LLDXHardware::cleanup()
|
||||
{
|
||||
// for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer());
|
||||
// mDevices.clear();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -365,8 +519,18 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
|
||||
goto LCleanup;
|
||||
}
|
||||
|
||||
// Get the English VRAM string
|
||||
DWORD vram = 0;
|
||||
|
||||
WCHAR deviceID[512];
|
||||
|
||||
get_wstring(device_containerp, L"szDeviceID", deviceID, 512);
|
||||
|
||||
if (SUCCEEDED(GetVideoMemoryViaWMI(deviceID, &vram)))
|
||||
{
|
||||
mVRAM = vram/(1024*1024);
|
||||
}
|
||||
else
|
||||
{ // Get the English VRAM string
|
||||
std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish");
|
||||
|
||||
// We don't need the device any more
|
||||
|
||||
@@ -125,7 +125,9 @@ bool LLWindowSDL::ll_try_gtk_init(void)
|
||||
if (!tried_gtk_init)
|
||||
{
|
||||
tried_gtk_init = TRUE;
|
||||
#if !GLIB_CHECK_VERSION(2, 32, 0)
|
||||
if (!g_thread_supported ()) g_thread_init (NULL);
|
||||
#endif
|
||||
maybe_lock_display();
|
||||
gtk_is_good = gtk_init_check(NULL, NULL);
|
||||
maybe_unlock_display();
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
// Linden library includes
|
||||
#include "llerror.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llgl.h"
|
||||
#include "llstring.h"
|
||||
#include "lldir.h"
|
||||
@@ -58,8 +59,6 @@
|
||||
#include <dinput.h>
|
||||
#include <Dbt.h.>
|
||||
|
||||
#include "llfasttimer.h"
|
||||
|
||||
// culled from winuser.h
|
||||
#ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */
|
||||
const S32 WM_MOUSEWHEEL = 0x020A;
|
||||
@@ -87,6 +86,18 @@ void show_window_creation_error(const std::string& title)
|
||||
LL_WARNS("Window") << title << LL_ENDL;
|
||||
}
|
||||
|
||||
HGLRC SafeCreateContext(HDC hdc)
|
||||
{
|
||||
__try
|
||||
{
|
||||
return wglCreateContext(hdc);
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
BOOL LLWindowWin32::sIsClassRegistered = FALSE;
|
||||
|
||||
@@ -163,7 +174,6 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
|
||||
// Check system metrics
|
||||
if ( !GetSystemMetrics( SM_DBCSENABLED ) )
|
||||
return;
|
||||
|
||||
|
||||
mHImmDll = LoadLibraryA("Imm32");
|
||||
if (mHImmDll != NULL)
|
||||
@@ -205,7 +215,7 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
|
||||
// the case, since it is very unusual; these APIs are available from
|
||||
// the beginning, and all versions of IMM32.DLL should have them all.
|
||||
// Unfortunately, this code may be executed before initialization of
|
||||
// the logging channel (llwarns), and we can't do it here... Yes, this
|
||||
// the logging channel (LL_WARNS()), and we can't do it here... Yes, this
|
||||
// is one of disadvantages to use static constraction to DLL loading.
|
||||
FreeLibrary(mHImmDll);
|
||||
mHImmDll = NULL;
|
||||
@@ -554,6 +564,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
|
||||
if (closest_refresh == 0)
|
||||
{
|
||||
LL_WARNS("Window") << "Couldn't find display mode " << width << " by " << height << " at " << BITS_PER_PIXEL << " bits per pixel" << LL_ENDL;
|
||||
//success = FALSE;
|
||||
|
||||
if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode))
|
||||
{
|
||||
@@ -1012,7 +1023,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
dw_ex_style = WS_EX_APPWINDOW;
|
||||
dw_style = WS_POPUP;
|
||||
|
||||
// Move window borders out not to cover window contents
|
||||
// Move window borders out not to cover window contents.
|
||||
// This converts client rect to window rect, i.e. expands it by the window border size.
|
||||
AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
|
||||
}
|
||||
// If it failed, we don't want to run fullscreen
|
||||
@@ -1059,7 +1071,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
mhInstance,
|
||||
NULL);
|
||||
|
||||
LL_INFOS("Window") << "window is created." << llendl ;
|
||||
LL_INFOS("Window") << "window is created." << LL_ENDL ;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Create GL drawing context
|
||||
@@ -1092,7 +1104,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Device context retrieved." << llendl ;
|
||||
LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ;
|
||||
|
||||
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
|
||||
{
|
||||
@@ -1102,7 +1114,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Pixel format chosen." << llendl ;
|
||||
LL_INFOS("Window") << "Pixel format chosen." << LL_ENDL ;
|
||||
|
||||
// Verify what pixel format we actually received.
|
||||
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
|
||||
@@ -1115,35 +1127,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
}
|
||||
|
||||
// (EXP-1765) dump pixel data to see if there is a pattern that leads to unreproducible crash
|
||||
LL_INFOS("Window") << "--- begin pixel format dump ---" << llendl ;
|
||||
LL_INFOS("Window") << "pixel_format is " << pixel_format << llendl ;
|
||||
LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << llendl ;
|
||||
LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << llendl ;
|
||||
LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << llendl ;
|
||||
LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << llendl ;
|
||||
LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << llendl ;
|
||||
LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << llendl ;
|
||||
LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << llendl ;
|
||||
LL_INFOS("Window") << "--- end pixel format dump ---" << llendl ;
|
||||
LL_INFOS("Window") << "--- begin pixel format dump ---" << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pixel_format is " << pixel_format << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
|
||||
|
||||
if (pfd.cColorBits < 32)
|
||||
{
|
||||
@@ -1169,7 +1181,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(mhRC = wglCreateContext(mhDC)))
|
||||
if (!(mhRC = SafeCreateContext(mhDC)))
|
||||
{
|
||||
close();
|
||||
OSMessageBox(mCallbacks->translateString("MBGLContextErr"),
|
||||
@@ -1185,7 +1197,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Drawing context is created." << llendl ;
|
||||
LL_INFOS("Window") << "Drawing context is created." << LL_ENDL ;
|
||||
|
||||
gGLManager.initWGL();
|
||||
|
||||
@@ -1323,142 +1335,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "pixel formats done." << llendl ;
|
||||
|
||||
/*for(int i = 0; i <= num_formats-1; ++i)
|
||||
{
|
||||
GLint query[] = { WGL_SAMPLE_BUFFERS_ARB,
|
||||
WGL_SAMPLES_ARB,
|
||||
WGL_NUMBER_PIXEL_FORMATS_ARB,
|
||||
WGL_DRAW_TO_WINDOW_ARB,
|
||||
WGL_DRAW_TO_BITMAP_ARB,
|
||||
WGL_ACCELERATION_ARB,
|
||||
WGL_NEED_PALETTE_ARB,
|
||||
WGL_NEED_SYSTEM_PALETTE_ARB,
|
||||
WGL_SWAP_LAYER_BUFFERS_ARB,
|
||||
WGL_SWAP_METHOD_ARB,
|
||||
WGL_NUMBER_OVERLAYS_ARB,
|
||||
WGL_NUMBER_UNDERLAYS_ARB,
|
||||
WGL_TRANSPARENT_ARB,
|
||||
WGL_TRANSPARENT_RED_VALUE_ARB,
|
||||
WGL_TRANSPARENT_GREEN_VALUE_ARB,
|
||||
WGL_TRANSPARENT_BLUE_VALUE_ARB,
|
||||
WGL_TRANSPARENT_ALPHA_VALUE_ARB,
|
||||
WGL_TRANSPARENT_INDEX_VALUE_ARB,
|
||||
WGL_SHARE_DEPTH_ARB,
|
||||
WGL_SHARE_STENCIL_ARB,
|
||||
WGL_SHARE_ACCUM_ARB,
|
||||
WGL_SUPPORT_GDI_ARB,
|
||||
WGL_SUPPORT_OPENGL_ARB,
|
||||
WGL_DOUBLE_BUFFER_ARB,
|
||||
WGL_STEREO_ARB,
|
||||
WGL_PIXEL_TYPE_ARB,
|
||||
WGL_COLOR_BITS_ARB,
|
||||
WGL_RED_BITS_ARB,
|
||||
WGL_RED_SHIFT_ARB,
|
||||
WGL_GREEN_BITS_ARB,
|
||||
WGL_GREEN_SHIFT_ARB,
|
||||
WGL_BLUE_BITS_ARB,
|
||||
WGL_BLUE_SHIFT_ARB,
|
||||
WGL_ALPHA_BITS_ARB,
|
||||
WGL_ALPHA_SHIFT_ARB,
|
||||
WGL_ACCUM_BITS_ARB,
|
||||
WGL_ACCUM_RED_BITS_ARB,
|
||||
WGL_ACCUM_GREEN_BITS_ARB,
|
||||
WGL_ACCUM_BLUE_BITS_ARB,
|
||||
WGL_ACCUM_ALPHA_BITS_ARB,
|
||||
WGL_DEPTH_BITS_ARB,
|
||||
WGL_STENCIL_BITS_ARB,
|
||||
WGL_AUX_BUFFERS_ARB};
|
||||
std::string names[] = { "WGL_SAMPLE_BUFFERS_ARB",
|
||||
"WGL_SAMPLES_ARB",
|
||||
"WGL_NUMBER_PIXEL_FORMATS_ARB",
|
||||
"WGL_DRAW_TO_WINDOW_ARB",
|
||||
"WGL_DRAW_TO_BITMAP_ARB",
|
||||
"WGL_ACCELERATION_ARB",
|
||||
"WGL_NEED_PALETTE_ARB",
|
||||
"WGL_NEED_SYSTEM_PALETTE_ARB",
|
||||
"WGL_SWAP_LAYER_BUFFERS_ARB",
|
||||
"WGL_SWAP_METHOD_ARB",
|
||||
"WGL_NUMBER_OVERLAYS_ARB",
|
||||
"WGL_NUMBER_UNDERLAYS_ARB",
|
||||
"WGL_TRANSPARENT_ARB",
|
||||
"WGL_TRANSPARENT_RED_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_GREEN_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_BLUE_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_ALPHA_VALUE_ARB",
|
||||
"WGL_TRANSPARENT_INDEX_VALUE_ARB",
|
||||
"WGL_SHARE_DEPTH_ARB",
|
||||
"WGL_SHARE_STENCIL_ARB",
|
||||
"WGL_SHARE_ACCUM_ARB",
|
||||
"WGL_SUPPORT_GDI_ARB",
|
||||
"WGL_SUPPORT_OPENGL_ARB",
|
||||
"WGL_DOUBLE_BUFFER_ARB",
|
||||
"WGL_STEREO_ARB",
|
||||
"WGL_PIXEL_TYPE_ARB",
|
||||
"WGL_COLOR_BITS_ARB",
|
||||
"WGL_RED_BITS_ARB",
|
||||
"WGL_RED_SHIFT_ARB",
|
||||
"WGL_GREEN_BITS_ARB",
|
||||
"WGL_GREEN_SHIFT_ARB",
|
||||
"WGL_BLUE_BITS_ARB",
|
||||
"WGL_BLUE_SHIFT_ARB",
|
||||
"WGL_ALPHA_BITS_ARB",
|
||||
"WGL_ALPHA_SHIFT_ARB",
|
||||
"WGL_ACCUM_BITS_ARB",
|
||||
"WGL_ACCUM_RED_BITS_ARB",
|
||||
"WGL_ACCUM_GREEN_BITS_ARB",
|
||||
"WGL_ACCUM_BLUE_BITS_ARB",
|
||||
"WGL_ACCUM_ALPHA_BITS_ARB",
|
||||
"WGL_DEPTH_BITS_ARB",
|
||||
"WGL_STENCIL_BITS_ARB",
|
||||
"WGL_AUX_BUFFERS_ARB"};
|
||||
S32 results[sizeof(query)/sizeof(query[0])]={0};
|
||||
|
||||
if(wglGetPixelFormatAttribivARB(mhDC, pixel_formats[i], 0, sizeof(query)/sizeof(query[0]), query, results))
|
||||
{
|
||||
llinfos << i << ":" << llendl;
|
||||
for(int j = 0; j < sizeof(query)/sizeof(query[0]); ++j)
|
||||
{
|
||||
switch(results[j])
|
||||
{
|
||||
case WGL_NO_ACCELERATION_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_NO_ACCELERATION_ARB" << llendl;
|
||||
break;
|
||||
case WGL_GENERIC_ACCELERATION_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_GENERIC_ACCELERATION_ARB" << llendl;
|
||||
break;
|
||||
case WGL_FULL_ACCELERATION_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_FULL_ACCELERATION_ARB" << llendl;
|
||||
break;
|
||||
case WGL_SWAP_EXCHANGE_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_SWAP_EXCHANGE_ARB" << llendl;
|
||||
break;
|
||||
case WGL_SWAP_COPY_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_SWAP_COPY_ARB" << llendl;
|
||||
break;
|
||||
case WGL_SWAP_UNDEFINED_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_SWAP_UNDEFINED_ARB" << llendl;
|
||||
break;
|
||||
case WGL_TYPE_RGBA_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_TYPE_RGBA_ARB" << llendl;
|
||||
break;
|
||||
case WGL_TYPE_COLORINDEX_ARB:
|
||||
llinfos << " " << names[j] << " = " << "WGL_TYPE_COLORINDEX_ARB" << llendl;
|
||||
break;
|
||||
default:
|
||||
llinfos << " " << names[j] << " = " << results[j] << llendl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
LL_INFOS("Window") << "pixel formats done." << LL_ENDL ;
|
||||
|
||||
//Singu note: Reversed order of this loop. Generally, choosepixelformat returns an array with the closer matches towards the start.
|
||||
S32 swap_method = 0;
|
||||
S32 cur_format = 0;//num_formats-1;
|
||||
GLint swap_query = WGL_SWAP_METHOD_ARB;
|
||||
|
||||
BOOL found_format = FALSE;
|
||||
|
||||
while (!found_format && wglGetPixelFormatAttribivARB(mhDC, pixel_formats[cur_format], 0, 1, &swap_query, &swap_method))
|
||||
{
|
||||
if (swap_method == WGL_SWAP_UNDEFINED_ARB /*|| cur_format <= 0*/)
|
||||
@@ -1507,7 +1392,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
mhInstance,
|
||||
NULL);
|
||||
|
||||
LL_INFOS("Window") << "recreate window done." << llendl ;
|
||||
LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
|
||||
|
||||
if (!(mhDC = GetDC(mWindowHandle)))
|
||||
{
|
||||
@@ -1747,6 +1632,7 @@ BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// Inform the application of the new mouse position (needed for per-frame
|
||||
// hover/picking to function).
|
||||
mCallbacks->handleMouseMove(this, position.convert(), (MASK)0);
|
||||
@@ -1996,6 +1882,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
// This helps prevent avatar walking after maximizing the window by double-clicking the title bar.
|
||||
static bool sHandleLeftMouseUp = true;
|
||||
|
||||
// Ignore the double click received right after activating app.
|
||||
// This is to avoid triggering double click teleport after returning focus (see MAINT-3786).
|
||||
static bool sHandleDoubleClick = true;
|
||||
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr(h_wnd, GWLP_USERDATA);
|
||||
|
||||
|
||||
@@ -2123,6 +2013,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
}
|
||||
}
|
||||
|
||||
if (!activating)
|
||||
{
|
||||
sHandleDoubleClick = false;
|
||||
}
|
||||
|
||||
window_imp->mCallbacks->handleActivateApp(window_imp, activating);
|
||||
|
||||
break;
|
||||
@@ -2347,6 +2242,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_NCLBUTTONDOWN");
|
||||
// A click in a non-client area, e.g. title bar or window border.
|
||||
sHandleLeftMouseUp = false;
|
||||
sHandleDoubleClick = true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2391,6 +2287,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
||||
//case WM_RBUTTONDBLCLK:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDBLCLK");
|
||||
|
||||
if (!sHandleDoubleClick)
|
||||
{
|
||||
sHandleDoubleClick = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Because we move the cursor position in the app, we need to query
|
||||
// to find out where the cursor at the time the event is handled.
|
||||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
|
||||
@@ -594,7 +594,8 @@ void parse_string();
|
||||
"REGION_FLAG_SANDBOX" { count(); yylval.ival = REGION_FLAGS_SANDBOX; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_DISABLE_COLLISIONS" { count(); yylval.ival = REGION_FLAGS_SKIP_COLLISIONS; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_DISABLE_PHYSICS" { count(); yylval.ival = REGION_FLAGS_SKIP_PHYSICS; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_BLOCK_FLY" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLY; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_BLOCK_FLY" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLY; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_BLOCK_FLYOVER" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLYOVER; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_ALLOW_DIRECT_TELEPORT" { count(); yylval.ival = REGION_FLAGS_ALLOW_DIRECT_TELEPORT; return(INTEGER_CONSTANT); }
|
||||
"REGION_FLAG_RESTRICT_PUSHOBJECT" { count(); yylval.ival = REGION_FLAGS_RESTRICT_PUSHOBJECT; return(INTEGER_CONSTANT); }
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloateractivespeakers.cpp
|
||||
llfloaterauction.cpp
|
||||
llfloaterautoreplacesettings.cpp
|
||||
llfloateravatar.cpp
|
||||
llfloateravatarinfo.cpp
|
||||
llfloateravatarlist.cpp
|
||||
llfloateravatarpicker.cpp
|
||||
@@ -204,6 +205,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloatercolorpicker.cpp
|
||||
llfloatercustomize.cpp
|
||||
llfloaterdaycycle.cpp
|
||||
llfloaterdestinations.cpp
|
||||
llfloaterdirectory.cpp
|
||||
llfloaterdisplayname.cpp
|
||||
llfloatereditui.cpp
|
||||
@@ -216,6 +218,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterfriends.cpp
|
||||
llfloatergesture.cpp
|
||||
llfloatergodtools.cpp
|
||||
llfloatergroupbulkban.cpp
|
||||
llfloatergroupinfo.cpp
|
||||
llfloatergroupinvite.cpp
|
||||
llfloatergroups.cpp
|
||||
@@ -231,6 +234,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterlandholdings.cpp
|
||||
llfloaterlandmark.cpp
|
||||
llfloatermap.cpp
|
||||
llfloatermediafilter.cpp
|
||||
llfloatermediasettings.cpp
|
||||
llfloatermemleak.cpp
|
||||
llfloatermessagelog.cpp
|
||||
@@ -333,6 +337,7 @@ set(viewer_SOURCE_FILES
|
||||
llmaterialmgr.cpp
|
||||
llmediactrl.cpp
|
||||
llmediadataclient.cpp
|
||||
llmediafilter.cpp
|
||||
llmediaremotectrl.cpp
|
||||
llmenucommands.cpp
|
||||
llmenuoptionpathfindingrebakenavmesh.cpp
|
||||
@@ -368,6 +373,8 @@ set(viewer_SOURCE_FILES
|
||||
llpanelface.cpp
|
||||
llpanelgeneral.cpp
|
||||
llpanelgroup.cpp
|
||||
llpanelgroupbulk.cpp
|
||||
llpanelgroupbulkban.cpp
|
||||
llpanelgroupgeneral.cpp
|
||||
llpanelgroupinvite.cpp
|
||||
llpanelgrouplandmoney.cpp
|
||||
@@ -591,7 +598,6 @@ set(viewer_SOURCE_FILES
|
||||
sgversion.cpp
|
||||
shcommandhandler.cpp
|
||||
shfloatermediaticker.cpp
|
||||
slfloatermediafilter.cpp
|
||||
wlfPanel_AdvSettings.cpp
|
||||
)
|
||||
|
||||
@@ -706,6 +712,7 @@ set(viewer_HEADER_FILES
|
||||
llfloateractivespeakers.h
|
||||
llfloaterauction.h
|
||||
llfloaterautoreplacesettings.h
|
||||
llfloateravatar.h
|
||||
llfloateravatarinfo.h
|
||||
llfloateravatarlist.h
|
||||
llfloateravatarpicker.h
|
||||
@@ -727,6 +734,7 @@ set(viewer_HEADER_FILES
|
||||
llfloatercolorpicker.h
|
||||
llfloatercustomize.h
|
||||
llfloaterdaycycle.h
|
||||
llfloaterdestinations.h
|
||||
llfloaterdirectory.h
|
||||
llfloaterdisplayname.h
|
||||
llfloatereditui.h
|
||||
@@ -739,6 +747,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterfriends.h
|
||||
llfloatergesture.h
|
||||
llfloatergodtools.h
|
||||
llfloatergroupbulkban.h
|
||||
llfloatergroupinfo.h
|
||||
llfloatergroupinvite.h
|
||||
llfloatergroups.h
|
||||
@@ -754,6 +763,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterlandholdings.h
|
||||
llfloaterlandmark.h
|
||||
llfloatermap.h
|
||||
llfloatermediafilter.h
|
||||
llfloatermediasettings.h
|
||||
llfloatermemleak.h
|
||||
llfloatermessagelog.h
|
||||
@@ -856,6 +866,7 @@ set(viewer_HEADER_FILES
|
||||
llmaterialmgr.h
|
||||
llmediactrl.h
|
||||
llmediadataclient.h
|
||||
llmediafilter.h
|
||||
llmediaremotectrl.h
|
||||
llmenucommands.h
|
||||
llmenuoptionpathfindingrebakenavmesh.h
|
||||
@@ -891,6 +902,9 @@ set(viewer_HEADER_FILES
|
||||
llpanelface.h
|
||||
llpanelgeneral.h
|
||||
llpanelgroup.h
|
||||
llpanelgroupbulk.h
|
||||
llpanelgroupbulkban.h
|
||||
llpanelgroupbulkimpl.h
|
||||
llpanelgroupgeneral.h
|
||||
llpanelgroupinvite.h
|
||||
llpanelgrouplandmoney.h
|
||||
@@ -1117,12 +1131,12 @@ set(viewer_HEADER_FILES
|
||||
rlvinventory.h
|
||||
rlvlocks.h
|
||||
rlvui.h
|
||||
roles_constants.h
|
||||
scriptcounter.h
|
||||
sgmemstat.h
|
||||
sgversion.h
|
||||
shcommandhandler.h
|
||||
shfloatermediaticker.h
|
||||
slfloatermediafilter.h
|
||||
wlfPanel_AdvSettings.h
|
||||
VertexCache.h
|
||||
VorbisFramework.h
|
||||
@@ -1284,6 +1298,7 @@ if (WINDOWS)
|
||||
shell32
|
||||
user32
|
||||
Vfw32
|
||||
Wbemuuid
|
||||
winspool
|
||||
)
|
||||
|
||||
|
||||
@@ -489,6 +489,15 @@ PRIM_PHYSICS_SHAPE_PRIM Use the normal prim shape for physics (th
|
||||
PRIM_PHYSICS_SHAPE_NONE Use the convex hull of the prim shape for physics (this is the default for mesh objects)
|
||||
PRIM_PHYSICS_SHAPE_CONVEX Ignore this prim in the physics shape. This cannot be applied to the root prim.
|
||||
|
||||
PRIM_SPECULAR Used to get or set the specular map texture settings of a prim's face.
|
||||
PRIM_NORMAL Used to get or set the normal map texture settings of a prim's face.
|
||||
|
||||
PRIM_ALPHA_MODE Used to specify how the alpha channel of the diffuse texture should affect rendering of a prim<69>s face.
|
||||
PRIM_ALPHA_MODE_NONE Render the diffuse texture as though the alpha channel were nonexistent.
|
||||
PRIM_ALPHA_MODE_BLEND Render the diffuse texture with alpha-blending.
|
||||
PRIM_ALPHA_MODE_MASK Render the prim face in alpha-masked mode.
|
||||
PRIM_ALPHA_MODE_EMISSIVE Render the prim face in emissivity mode.
|
||||
|
||||
MASK_BASE Base permissions
|
||||
MASK_OWNER Owner permissions
|
||||
MASK_GROUP Group permissions
|
||||
@@ -554,6 +563,7 @@ REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a r
|
||||
REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions
|
||||
REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics
|
||||
REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying
|
||||
REGION_FLAG_BLOCK_FLYOVER Used with llGetRegionFlags to find if a region enforces higher altitude parcel access rules
|
||||
REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports
|
||||
REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls
|
||||
|
||||
|
||||
@@ -287,6 +287,16 @@
|
||||
<map/>
|
||||
<key>osRegexIsMatch</key>
|
||||
<map/>
|
||||
<key>osForceCreateLink</key>
|
||||
<map/>
|
||||
<key>osForceBreakLink</key>
|
||||
<map/>
|
||||
<key>osForceBreakAllLinks</key>
|
||||
<map/>
|
||||
<key>osGetRegionSize</key>
|
||||
<map/>
|
||||
<key>osGetPhysicsEngineType</key>
|
||||
<map/>
|
||||
|
||||
<!-- OSSL Functions Aurora-Sim Unique -->
|
||||
<key>osReturnObject</key>
|
||||
|
||||
@@ -243,6 +243,22 @@
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FloaterAvatarRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Avatar picker floater position</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>30</integer>
|
||||
<integer>505</integer>
|
||||
<integer>580</integer>
|
||||
<integer>275</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>FloaterAvatarTextRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -345,17 +361,6 @@
|
||||
</array>
|
||||
</map>
|
||||
|
||||
<key>MediaEnableFilter</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Enable media domain filtering</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>MediaFilterRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -558,17 +563,6 @@
|
||||
<key>Value</key>
|
||||
<string />
|
||||
</map>
|
||||
<key>ShowcaseURLDefault</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>URL to load for the Showcase tab in Second Life</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://secondlife.com/app/showcase/index.php?</string>
|
||||
</map>
|
||||
|
||||
<key>CheckForGridUpdates</key>
|
||||
<map>
|
||||
@@ -1021,6 +1015,17 @@ Found in Advanced->Rendering->Info Displays</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LiruShowTransactionThreshold</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Threshold of money changes before which transaction notifications will not be shown.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LiruUseAdvancedMenuShortcut</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -3150,6 +3155,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<key>AvatarPickerURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Avatar picker contents</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://lecs-viewer-web-components.s3.amazonaws.com/v3.0/[GRID_LOWERCASE]/avatars.html</string>
|
||||
</map>
|
||||
<key>AvatarRotateThresholdSlow</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -3172,17 +3188,6 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<key>AvatarRotateThresholdMouselook</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Angle between avatar facing and camera facing at which avatar turns to face same direction as camera, when in mouselook (degrees)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>120</real>
|
||||
</map>
|
||||
<key>AvatarBakedTextureUploadTimeout</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -6091,6 +6096,44 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<string>89556747-24cb-43ed-920b-47caed15465f</string>
|
||||
</map>
|
||||
<key>DestinationGuideRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Rectangle for destination guide</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>30</integer>
|
||||
<integer>505</integer>
|
||||
<integer>580</integer>
|
||||
<integer>275</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>DestinationGuideShown</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show destination guide</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DestinationGuideURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Destination guide contents</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://lecs-viewer-web-components.s3.amazonaws.com/v3.0/[GRID_LOWERCASE]/guide.html</string>
|
||||
</map>
|
||||
<key>DisableCameraConstraints</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -14711,6 +14754,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowAvatarFloater</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Display avatar picker floater on login</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowAxes</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -17909,6 +17963,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>GenericErrorPageURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>URL to set as a property on LLMediaControl to navigate to if the a page completes with a 400-499 HTTP status code</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/404.html</string>
|
||||
</map>
|
||||
<key>WebProfileFloaterRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -18583,6 +18648,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MediaFilterEnable</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Enable media domain filtering (0 = Off, 1 = Blacklist only, 2 = Prompt)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
||||
|
||||
@@ -102,6 +102,17 @@
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AlchemyConnectToNeighbors</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If false, disconnect from neighboring regions and all further neighbors on teleport</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AlchemyLookAtLines</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1008,6 +1019,17 @@
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleAvatar</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for default avatars is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleBeacons</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1162,6 +1184,17 @@
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleDestinations</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for destinations is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleDisplayName</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1384,6 +1417,17 @@
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleJoystick</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for joystick configuration is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleLagMeter</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -90,6 +90,17 @@
|
||||
<key>Value</key>
|
||||
<string>+</string>
|
||||
</map>
|
||||
<key>RLVaDebugDeprecateExplicitPoint</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Ignore attachment point names on inventory items and categories (incomplete)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>RLVaDebugHideUnsetDuplicate</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -129,6 +129,7 @@ void LLPrefsAscentVan::refreshValues()
|
||||
mUnfocusedFloatersOpaque = gSavedSettings.getBOOL("FloaterUnfocusedBackgroundOpaque");
|
||||
mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles");
|
||||
mScriptErrorsStealFocus = gSavedSettings.getBOOL("LiruScriptErrorsStealFocus");
|
||||
mConnectToNeighbors = gSavedSettings.getBOOL("AlchemyConnectToNeighbors");
|
||||
|
||||
//Tags\Colors ----------------------------------------------------------------------------
|
||||
mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag");
|
||||
@@ -199,6 +200,7 @@ void LLPrefsAscentVan::cancel()
|
||||
gSavedSettings.setBOOL("FloaterUnfocusedBackgroundOpaque", mUnfocusedFloatersOpaque);
|
||||
gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles);
|
||||
gSavedSettings.setBOOL("LiruScriptErrorsStealFocus", mScriptErrorsStealFocus);
|
||||
gSavedSettings.setBOOL("AlchemyConnectToNeighbors", mConnectToNeighbors);
|
||||
|
||||
//Tags\Colors ----------------------------------------------------------------------------
|
||||
gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag);
|
||||
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
bool mUnfocusedFloatersOpaque;
|
||||
bool mCompleteNameProfiles;
|
||||
bool mScriptErrorsStealFocus;
|
||||
bool mConnectToNeighbors;
|
||||
//Tags\Colors
|
||||
bool mAscentBroadcastTag;
|
||||
std::string mReportClientUUID;
|
||||
|
||||
@@ -3563,7 +3563,7 @@
|
||||
<volume_morph
|
||||
name="BELLY"
|
||||
scale="0.075 0.04 0.03"
|
||||
pos="0.07 0 -0.02"/>
|
||||
pos="0.07 0 -0.07"/>
|
||||
<volume_morph
|
||||
name="PELVIS"
|
||||
scale="0.075 0.04 0.03"
|
||||
@@ -4008,7 +4008,7 @@
|
||||
label_min="Big Pectorals"
|
||||
label_max="Sunken Chest"
|
||||
value_default="0"
|
||||
value_min="-1.0"
|
||||
value_min="-0.5"
|
||||
value_max="1.1"
|
||||
camera_elevation=".3"
|
||||
camera_distance="1.2">
|
||||
|
||||
@@ -33,12 +33,14 @@
|
||||
|
||||
#include "chatbar_as_cmdline.h"
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llcalc.h"
|
||||
|
||||
#include "llchatbar.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llagentui.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llworld.h"
|
||||
#include "lleventtimer.h"
|
||||
@@ -215,6 +217,12 @@ struct ProfCtrlListAccum : public LLControlGroup::ApplyFunctor
|
||||
std::vector<std::pair<std::string, U32> > mVariableList;
|
||||
};
|
||||
#endif //PROF_CTRL_CALLS
|
||||
void spew_key_to_name(const LLUUID& targetKey, const LLAvatarName& av_name)
|
||||
{
|
||||
std::string object_name;
|
||||
LLAvatarNameCache::getPNSName(av_name, object_name);
|
||||
cmdline_printchat(llformat("%s: %s", targetKey.asString().c_str(), object_name.c_str()));
|
||||
}
|
||||
bool cmd_line_chat(std::string revised_text, EChatType type)
|
||||
{
|
||||
static LLCachedControl<bool> sAscentCmdLine(gSavedSettings, "AscentCmdLine");
|
||||
@@ -251,17 +259,16 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
|
||||
{
|
||||
if (i >> y)
|
||||
{
|
||||
if (i >> z)
|
||||
if (!(i >> z))
|
||||
z = gAgent.getPositionAgent().mV[VZ];
|
||||
|
||||
if (LLViewerRegion* agentRegionp = gAgent.getRegion())
|
||||
{
|
||||
LLViewerRegion* agentRegionp = gAgent.getRegion();
|
||||
if(agentRegionp)
|
||||
{
|
||||
LLVector3 targetPos(x,y,z);
|
||||
LLVector3d pos_global = from_region_handle(agentRegionp->getHandle());
|
||||
pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]);
|
||||
gAgent.teleportViaLocation(pos_global);
|
||||
return false;
|
||||
}
|
||||
LLVector3 targetPos(x,y,z);
|
||||
LLVector3d pos_global = from_region_handle(agentRegionp->getHandle());
|
||||
pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]);
|
||||
gAgent.teleportViaLocation(pos_global);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -289,11 +296,13 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
|
||||
LLUUID targetKey;
|
||||
if(i >> targetKey)
|
||||
{
|
||||
std::string object_name;
|
||||
gCacheName->getFullName(targetKey, object_name);
|
||||
char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */
|
||||
snprintf(buffer,sizeof(buffer),"%s: (%s)",targetKey.asString().c_str(), object_name.c_str());
|
||||
cmdline_printchat(std::string(buffer));
|
||||
LLAvatarName av_name;
|
||||
if (!LLAvatarNameCache::get(targetKey, &av_name))
|
||||
{
|
||||
LLAvatarNameCache::get(targetKey, boost::bind(spew_key_to_name, _1, _2));
|
||||
return false;
|
||||
}
|
||||
spew_key_to_name(targetKey, av_name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -428,7 +437,14 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
|
||||
{
|
||||
if (revised_text.length() > command.length() + 1)
|
||||
{
|
||||
LLUrlAction::clickAction(revised_text.substr(command.length()+1));
|
||||
const std::string sub(revised_text.substr(command.length()+1));
|
||||
LLUUID id;
|
||||
if (id.parseUUID(sub, &id))
|
||||
{
|
||||
LLAvatarActions::showProfile(id);
|
||||
return false;
|
||||
}
|
||||
LLUrlAction::clickAction(sub);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ list ATI_Mobility_Radeon_9600
|
||||
Disregard96DefaultDrawDistance 1 0
|
||||
|
||||
list NVIDIA_GeForce_8600
|
||||
RenderTextureMemoryMultiple 1 0.375
|
||||
RenderTextureMemoryMultiple 1 1
|
||||
RenderUseImpostors 0 0
|
||||
UseOcclusion 0 0
|
||||
|
||||
|
||||
@@ -84,20 +84,20 @@ class LLIamHereVoice : public LLHTTPClient::ResponderWithResult
|
||||
mParent = parentIn;
|
||||
};
|
||||
|
||||
/*virtual*/ void result( const LLSD& content )
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( mParent )
|
||||
mParent->setSiteIsAlive( true );
|
||||
};
|
||||
|
||||
/*virtual*/ void error( U32 status, const std::string& reason )
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
if ( mParent )
|
||||
{
|
||||
// *HACK: For purposes of this alive check, 302 Found
|
||||
// (aka Moved Temporarily) is considered alive. The web site
|
||||
// redirects this link to a "cache busting" temporary URL. JC
|
||||
bool alive = (status == HTTP_FOUND);
|
||||
bool alive = (mStatus == HTTP_FOUND);
|
||||
mParent->setSiteIsAlive( alive );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -304,6 +304,10 @@ Intel HD Graphics 3000 .*Intel.*HD Graphics 3000.* 2 1
|
||||
Intel HD Graphics 3000 .*Intel.*Sandybridge.* 2 1
|
||||
Intel HD Graphics 4000 .*Intel.*HD Graphics 4000.* 2 1
|
||||
Intel HD Graphics 4000 .*Intel.*Ivybridge.* 2 1
|
||||
Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 2 1
|
||||
Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 2 1
|
||||
Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 2 1
|
||||
Intel Intel Iris Pro OpenGL Engine .*Intel.*Iris Pro OpenGL.* 3 1
|
||||
Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 2 1
|
||||
Intel HD Graphics 5000 .*Intel.*Haswell.* 2 1
|
||||
Intel HD Graphics .*Intel.*HD Graphics.* 2 1
|
||||
|
||||
@@ -153,7 +153,7 @@ void HippoGridInfo::setGridNick(std::string gridNick)
|
||||
{
|
||||
mIsInProductionGrid = true;
|
||||
}
|
||||
if(gridNick == "avination")
|
||||
else if(gridNick == "avination")
|
||||
{
|
||||
mIsInAvination = true;
|
||||
}
|
||||
@@ -177,12 +177,12 @@ void HippoGridInfo::setLoginUri(const std::string& loginUri)
|
||||
useHttps();
|
||||
setPlatform(PLATFORM_SECONDLIFE);
|
||||
}
|
||||
if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.aditi.lindenlab.com")
|
||||
else if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.aditi.lindenlab.com")
|
||||
{
|
||||
useHttps();
|
||||
setPlatform(PLATFORM_SECONDLIFE);
|
||||
}
|
||||
if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.com" ||
|
||||
else if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.com" ||
|
||||
utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.net")
|
||||
{
|
||||
mIsInAvination = true;
|
||||
@@ -260,99 +260,6 @@ void HippoGridInfo::setDirectoryFee(int fee)
|
||||
// ********************************************************************
|
||||
// Grid Info
|
||||
|
||||
std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const
|
||||
{
|
||||
// Don't worry about whether or not mSearchUrl is empty here anymore -- MC
|
||||
if (is_web)
|
||||
{
|
||||
if (mPlatform == PLATFORM_SECONDLIFE)
|
||||
{
|
||||
// Second Life defaults
|
||||
if (ty == SEARCH_ALL_EMPTY)
|
||||
{
|
||||
return gSavedSettings.getString("SearchURLDefault");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_QUERY)
|
||||
{
|
||||
return gSavedSettings.getString("SearchURLQuery");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_TEMPLATE)
|
||||
{
|
||||
return gSavedSettings.getString("SearchURLSuffix2");
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else if (!mSearchUrl.empty())
|
||||
{
|
||||
// Search url sent to us in the login response
|
||||
if (ty == SEARCH_ALL_EMPTY)
|
||||
{
|
||||
return (mSearchUrl);
|
||||
}
|
||||
else if (ty == SEARCH_ALL_QUERY)
|
||||
{
|
||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_TEMPLATE)
|
||||
{
|
||||
return "lang=[LANG]&mat=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]";
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// OpenSim and other web search defaults
|
||||
if (ty == SEARCH_ALL_EMPTY)
|
||||
{
|
||||
return gSavedSettings.getString("SearchURLDefaultOpenSim");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_QUERY)
|
||||
{
|
||||
return gSavedSettings.getString("SearchURLQueryOpenSim");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_TEMPLATE)
|
||||
{
|
||||
return gSavedSettings.getString("SearchURLSuffixOpenSim");
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use the old search all
|
||||
if (ty == SEARCH_ALL_EMPTY)
|
||||
{
|
||||
return (mSearchUrl + "panel=All&");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_QUERY)
|
||||
{
|
||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_TEMPLATE)
|
||||
{
|
||||
return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]";
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//static
|
||||
void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts)
|
||||
{
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
PLATFORM_SECONDLIFE,
|
||||
PLATFORM_LAST
|
||||
};
|
||||
enum SearchType {
|
||||
SEARCH_ALL_EMPTY,
|
||||
SEARCH_ALL_QUERY,
|
||||
SEARCH_ALL_TEMPLATE
|
||||
};
|
||||
|
||||
explicit HippoGridInfo(const std::string& gridName);
|
||||
|
||||
@@ -58,7 +53,6 @@ public:
|
||||
const std::string& getSearchUrl() const { return mSearchUrl; }
|
||||
const std::string& getGridMessage() const { return mGridMessage; }
|
||||
const std::string& getVoiceConnector() const { return mVoiceConnector; }
|
||||
std::string getSearchUrl(SearchType ty, bool is_web) const;
|
||||
bool isRenderCompat() const { return mRenderCompat; }
|
||||
std::string getGridNick() const;
|
||||
int getMaxAgentGroups() const { return mMaxAgentGroups; }
|
||||
|
||||
@@ -210,7 +210,8 @@ Function CloseSecondLife
|
||||
Push $0
|
||||
FindWindow $0 "Second Life" ""
|
||||
IntCmp $0 0 DONE
|
||||
MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL
|
||||
MessageBox MB_YESNOCANCEL $(CloseSecondLifeInstMB) IDYES CLOSE IDNO DONE
|
||||
Goto CANCEL_INSTALL ; IDCANCEL
|
||||
|
||||
CANCEL_INSTALL:
|
||||
Quit
|
||||
@@ -436,7 +437,8 @@ Function un.CloseSecondLife
|
||||
Push $0
|
||||
FindWindow $0 "Second Life" ""
|
||||
IntCmp $0 0 DONE
|
||||
MessageBox MB_OKCANCEL $(CloseSecondLifeUnInstMB) IDOK CLOSE IDCANCEL CANCEL_UNINSTALL
|
||||
MessageBox MB_YESNOCANCEL $(CloseSecondLifeUnInstMB) IDYES CLOSE IDNO DONE
|
||||
Goto CANCEL_UNINSTALL ; IDCANCEL
|
||||
|
||||
CANCEL_UNINSTALL:
|
||||
Quit
|
||||
|
||||
Binary file not shown.
@@ -29,7 +29,7 @@
|
||||
LFFloaterInvPanel::LFFloaterInvPanel(const LLUUID& cat_id, LLInventoryModel* model, const std::string& name)
|
||||
: LLInstanceTracker<LFFloaterInvPanel, LLUUID>(cat_id)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("InvPanel.Search", boost::bind(&LFFloaterInvPanel::onSearch, this, _2));
|
||||
mCommitCallbackRegistrar.add("InvPanel.Search", boost::bind(&LLInventoryPanel::setFilterSubString, boost::ref(mPanel), _2));
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inv_panel.xml");
|
||||
LLPanel* panel = getChild<LLPanel>("placeholder_panel");
|
||||
mPanel = new LLInventoryPanel("inv_panel", LLInventoryPanel::DEFAULT_SORT_ORDER, cat_id.asString(), panel->getRect(), model, true);
|
||||
@@ -83,8 +83,3 @@ BOOL LFFloaterInvPanel::handleKeyHere(KEY key, MASK mask)
|
||||
|
||||
return LLFloater::handleKeyHere(key, mask);
|
||||
}
|
||||
|
||||
void LFFloaterInvPanel::onSearch(const LLSD& val)
|
||||
{
|
||||
mPanel->setFilterSubString(val.asString());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ public:
|
||||
static void closeAll(); // Called when not allowed to have inventory open
|
||||
|
||||
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
|
||||
void onSearch(const LLSD& val);
|
||||
|
||||
private:
|
||||
class LLInventoryPanel* mPanel;
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
LFSimFeatureHandler::LFSimFeatureHandler()
|
||||
: mSupportsExport(false)
|
||||
, mDestinationGuideURL(gSavedSettings.getString("DestinationGuideURL"))
|
||||
, mSearchURL(gSavedSettings.getString("SearchURL"))
|
||||
, mSayRange(20)
|
||||
, mShoutRange(100)
|
||||
, mWhisperRange(10)
|
||||
@@ -54,57 +56,82 @@ void LFSimFeatureHandler::handleRegionChange()
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void has_feature_or_default(SignaledType<T>& type, const LLSD& features, const std::string& feature)
|
||||
{
|
||||
type = (features.has(feature)) ? static_cast<T>(features[feature]) : type.getDefault();
|
||||
}
|
||||
template<>
|
||||
void has_feature_or_default(SignaledType<U32>& type, const LLSD& features, const std::string& feature)
|
||||
{
|
||||
type = (features.has(feature)) ? features[feature].asInteger() : type.getDefault();
|
||||
}
|
||||
|
||||
void LFSimFeatureHandler::setSupportedFeatures()
|
||||
{
|
||||
if (LLViewerRegion* region = gAgent.getRegion())
|
||||
{
|
||||
LLSD info;
|
||||
region->getSimulatorFeatures(info);
|
||||
//bool hg(); // Singu Note: There should probably be a flag for this some day.
|
||||
if (info.has("OpenSimExtras")) // OpenSim specific sim features
|
||||
{
|
||||
// For definition of OpenSimExtras please see
|
||||
// http://opensimulator.org/wiki/SimulatorFeatures_Extras
|
||||
const LLSD& extras(info["OpenSimExtras"]);
|
||||
mSupportsExport = extras.has("ExportSupported") ? extras["ExportSupported"].asBoolean() : false;
|
||||
mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : "";
|
||||
mSearchURL = extras.has("search-server-url") ? extras["search-server-url"].asString() : "";
|
||||
mSayRange = extras.has("say-range") ? extras["say-range"].asInteger() : 20;
|
||||
mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100;
|
||||
mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10;
|
||||
has_feature_or_default(mSupportsExport, extras, "ExportSupported");
|
||||
//if (hg)
|
||||
{
|
||||
has_feature_or_default(mDestinationGuideURL, extras, "destination-guide-url");
|
||||
mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : "";
|
||||
has_feature_or_default(mSearchURL, extras, "search-server-url");
|
||||
}
|
||||
has_feature_or_default(mSayRange, extras, "say-range");
|
||||
has_feature_or_default(mShoutRange, extras, "shout-range");
|
||||
has_feature_or_default(mWhisperRange, extras, "whisper-range");
|
||||
}
|
||||
else // OpenSim specifics are unsupported reset all to default
|
||||
{
|
||||
mSupportsExport = false;
|
||||
mMapServerURL = "";
|
||||
mSearchURL = "";
|
||||
mSayRange = 20;
|
||||
mShoutRange = 100;
|
||||
mWhisperRange = 10;
|
||||
mSupportsExport.reset();
|
||||
//if (hg)
|
||||
{
|
||||
mDestinationGuideURL.reset();
|
||||
mMapServerURL = "";
|
||||
mSearchURL.reset();
|
||||
}
|
||||
mSayRange.reset();
|
||||
mShoutRange.reset();
|
||||
mWhisperRange.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const SignaledType<bool>::slot_t& slot)
|
||||
{
|
||||
return mSupportsExport.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
boost::signals2::connection LFSimFeatureHandler::setDestinationGuideURLCallback(const SignaledType<std::string>::slot_t& slot)
|
||||
{
|
||||
return mDestinationGuideURL.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const SignaledType<std::string>::slot_t& slot)
|
||||
{
|
||||
return mSearchURL.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const SignaledType<U32>::slot_t& slot)
|
||||
{
|
||||
return mSayRange.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const SignaledType<U32>::slot_t& slot)
|
||||
{
|
||||
return mShoutRange.connect(slot);
|
||||
}
|
||||
|
||||
boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const boost::signals2::signal<void()>::slot_type& slot)
|
||||
boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const SignaledType<U32>::slot_t& slot)
|
||||
{
|
||||
return mWhisperRange.connect(slot);
|
||||
}
|
||||
|
||||
@@ -21,29 +21,33 @@
|
||||
#include "llsingleton.h"
|
||||
#include "llpermissions.h" // ExportPolicy
|
||||
|
||||
template<typename Type, typename Signal = boost::signals2::signal<void()> >
|
||||
template<typename Type, typename Signal = boost::signals2::signal<void(const Type&)> >
|
||||
class SignaledType
|
||||
{
|
||||
public:
|
||||
SignaledType() : mValue() {}
|
||||
SignaledType(Type b) : mValue(b) {}
|
||||
SignaledType() : mValue(), mDefaultValue() {}
|
||||
SignaledType(Type b) : mValue(b), mDefaultValue(b) {}
|
||||
|
||||
boost::signals2::connection connect(const typename Signal::slot_type& slot) { return mSignal.connect(slot); }
|
||||
typedef typename Signal::slot_type slot_t;
|
||||
boost::signals2::connection connect(const slot_t& slot) { return mSignal.connect(slot); }
|
||||
|
||||
SignaledType& operator =(Type val)
|
||||
{
|
||||
if (val != mValue)
|
||||
{
|
||||
mValue = val;
|
||||
mSignal();
|
||||
mSignal(val);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
operator Type() const { return mValue; }
|
||||
void reset() { *this = mDefaultValue; }
|
||||
const Type& getDefault() const { return mDefaultValue; }
|
||||
|
||||
private:
|
||||
Signal mSignal;
|
||||
Type mValue;
|
||||
const Type mDefaultValue;
|
||||
};
|
||||
|
||||
class LFSimFeatureHandler : public LLSingleton<LFSimFeatureHandler>
|
||||
@@ -57,14 +61,16 @@ public:
|
||||
void setSupportedFeatures();
|
||||
|
||||
// Connection setters
|
||||
boost::signals2::connection setSupportsExportCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setSearchURLCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setSayRangeCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setShoutRangeCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setWhisperRangeCallback(const boost::signals2::signal<void()>::slot_type& slot);
|
||||
boost::signals2::connection setSupportsExportCallback(const SignaledType<bool>::slot_t& slot);
|
||||
boost::signals2::connection setDestinationGuideURLCallback(const SignaledType<std::string>::slot_t& slot);
|
||||
boost::signals2::connection setSearchURLCallback(const SignaledType<std::string>::slot_t& slot);
|
||||
boost::signals2::connection setSayRangeCallback(const SignaledType<U32>::slot_t& slot);
|
||||
boost::signals2::connection setShoutRangeCallback(const SignaledType<U32>::slot_t& slot);
|
||||
boost::signals2::connection setWhisperRangeCallback(const SignaledType<U32>::slot_t& slot);
|
||||
|
||||
// Accessors
|
||||
bool simSupportsExport() const { return mSupportsExport; }
|
||||
std::string destinationGuideURL() const { return mDestinationGuideURL; }
|
||||
std::string mapServerURL() const { return mMapServerURL; }
|
||||
std::string searchURL() const { return mSearchURL; }
|
||||
U32 sayRange() const { return mSayRange; }
|
||||
@@ -75,6 +81,7 @@ public:
|
||||
private:
|
||||
// SignaledTypes
|
||||
SignaledType<bool> mSupportsExport;
|
||||
SignaledType<std::string> mDestinationGuideURL;
|
||||
std::string mMapServerURL;
|
||||
SignaledType<std::string> mSearchURL;
|
||||
SignaledType<U32> mSayRange;
|
||||
|
||||
@@ -58,8 +58,6 @@ public:
|
||||
EmeraldDicDownloader(lggDicDownloadFloater* spanel, std::string sname);
|
||||
~EmeraldDicDownloader() { }
|
||||
/*virtual*/ void completedRaw(
|
||||
U32 status,
|
||||
const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return emeraldDicDownloader_timeout; }
|
||||
@@ -167,9 +165,9 @@ EmeraldDicDownloader::EmeraldDicDownloader(lggDicDownloadFloater* spanel, std::s
|
||||
}
|
||||
|
||||
|
||||
void EmeraldDicDownloader::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const buffer_ptr_t& buffer)
|
||||
void EmeraldDicDownloader::completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer)
|
||||
{
|
||||
if (status < 200 || status >= 300)
|
||||
if (!isGoodStatus(mStatus))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include "llcurl.h"
|
||||
#include "llhttpclient.h"
|
||||
|
||||
class AIHTTPTimeoutPolicy;
|
||||
extern AIHTTPTimeoutPolicy accountingCostResponder_timeout;
|
||||
|
||||
//===============================================================================
|
||||
LLAccountingCostManager::LLAccountingCostManager()
|
||||
{
|
||||
@@ -60,34 +57,34 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void error( U32 statusNum, const std::string& reason )
|
||||
void httpFailure(void)
|
||||
{
|
||||
llwarns << "Transport error [status:" << statusNum << "]: " << reason << llendl;
|
||||
llwarns << "Transport error [status:" << mStatus << "]: " << mReason << llendl;
|
||||
clearPendingRequests();
|
||||
|
||||
LLAccountingCostObserver* observer = mObserverHandle.get();
|
||||
if (observer && observer->getTransactionID() == mTransactionID)
|
||||
{
|
||||
observer->setErrorStatus(statusNum, reason);
|
||||
observer->setErrorStatus(mStatus, mReason);
|
||||
}
|
||||
}
|
||||
|
||||
void result( const LLSD& content )
|
||||
void httpSuccess(void)
|
||||
{
|
||||
//Check for error
|
||||
if ( !content.isMap() || content.has("error") )
|
||||
if ( !mContent.isMap() || mContent.has("error") )
|
||||
{
|
||||
llwarns << "Error on fetched data"<< llendl;
|
||||
}
|
||||
else if (content.has("selected"))
|
||||
else if (mContent.has("selected"))
|
||||
{
|
||||
F32 physicsCost = 0.0f;
|
||||
F32 networkCost = 0.0f;
|
||||
F32 simulationCost = 0.0f;
|
||||
|
||||
physicsCost = content["selected"]["physics"].asReal();
|
||||
networkCost = content["selected"]["streaming"].asReal();
|
||||
simulationCost = content["selected"]["simulation"].asReal();
|
||||
physicsCost = mContent["selected"]["physics"].asReal();
|
||||
networkCost = mContent["selected"]["streaming"].asReal();
|
||||
simulationCost = mContent["selected"]["simulation"].asReal();
|
||||
|
||||
SelectionCost selectionCost( /*transactionID,*/ physicsCost, networkCost, simulationCost );
|
||||
|
||||
@@ -101,7 +98,6 @@ public:
|
||||
clearPendingRequests();
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return accountingCostResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLAccountingCostResponder"; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -1293,25 +1293,12 @@ F32 LLAgent::clampPitchToLimits(F32 angle)
|
||||
|
||||
LLVector3 skyward = getReferenceUpVector();
|
||||
|
||||
F32 look_down_limit;
|
||||
F32 look_up_limit = 10.f * DEG_TO_RAD;
|
||||
static const LLCachedControl<bool> useRealisticMouselook(gSavedSettings, "UseRealisticMouselook", false);
|
||||
const F32 look_down_limit = (useRealisticMouselook ? 160.f : (isAgentAvatarValid() && gAgentAvatarp->isSitting() ? 130.f : 179.f)) * DEG_TO_RAD;
|
||||
const F32 look_up_limit = (useRealisticMouselook ? 20.f : 1.f) * DEG_TO_RAD;;
|
||||
|
||||
F32 angle_from_skyward = acos( mFrameAgent.getAtAxis() * skyward );
|
||||
|
||||
if (gAgentCamera.cameraMouselook() && gSavedSettings.getBOOL("UseRealisticMouselook"))
|
||||
{
|
||||
look_down_limit = 160.f * DEG_TO_RAD;
|
||||
look_up_limit = 20.f * DEG_TO_RAD;
|
||||
}
|
||||
else if (isAgentAvatarValid() && gAgentAvatarp->isSitting())
|
||||
{
|
||||
look_down_limit = 130.f * DEG_TO_RAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
look_down_limit = 170.f * DEG_TO_RAD;
|
||||
}
|
||||
|
||||
// clamp pitch to limits
|
||||
if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit))
|
||||
{
|
||||
@@ -2587,8 +2574,8 @@ public:
|
||||
LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity);
|
||||
virtual ~LLMaturityPreferencesResponder();
|
||||
|
||||
/*virtual*/ void result(const LLSD &pContent);
|
||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return maturityPreferences_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; }
|
||||
@@ -2612,25 +2599,25 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder()
|
||||
{
|
||||
}
|
||||
|
||||
void LLMaturityPreferencesResponder::result(const LLSD &pContent)
|
||||
void LLMaturityPreferencesResponder::httpSuccess(void)
|
||||
{
|
||||
U8 actualMaturity = parseMaturityFromServerResponse(pContent);
|
||||
U8 actualMaturity = parseMaturityFromServerResponse(mContent);
|
||||
|
||||
if (actualMaturity != mPreferredMaturity)
|
||||
{
|
||||
llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
|
||||
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '"
|
||||
<< LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast<U32>(actualMaturity) << ", llsd:"
|
||||
<< pContent << "]" << llendl;
|
||||
<< mContent << "]" << llendl;
|
||||
}
|
||||
mAgent->handlePreferredMaturityResult(actualMaturity);
|
||||
}
|
||||
|
||||
void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReason)
|
||||
void LLMaturityPreferencesResponder::httpFailure(void)
|
||||
{
|
||||
llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
|
||||
<< "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error because '"
|
||||
<< pReason << "' [status:" << pStatus << "]" << llendl;
|
||||
<< mReason << "' [status:" << mStatus << "]" << llendl;
|
||||
mAgent->handlePreferredMaturityError();
|
||||
}
|
||||
|
||||
@@ -2820,7 +2807,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
|
||||
// If we don't have a region, report it as an error
|
||||
if (getRegion() == NULL)
|
||||
{
|
||||
responderPtr->error(0U, "region is not defined");
|
||||
responderPtr->failureResult(0U, "region is not defined", LLSD());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2830,7 +2817,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
|
||||
// If the capability is not defined, report it as an error
|
||||
if (url.empty())
|
||||
{
|
||||
responderPtr->error(0U, "capability 'UpdateAgentInformation' is not defined for region");
|
||||
responderPtr->failureResult(0U, "capability 'UpdateAgentInformation' is not defined for region", LLSD());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -940,6 +940,8 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction)
|
||||
F32 max_distance = /*llmin(mDrawDistance*/ INT_MAX - DIST_FUDGE//,
|
||||
/*LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE )*/;
|
||||
|
||||
max_distance = llmin(max_distance, current_distance * 4.f); //Scaled max relative to current distance. MAINT-3154
|
||||
|
||||
if (new_distance > max_distance)
|
||||
{
|
||||
// <edit> screw cam constraints
|
||||
@@ -1177,7 +1179,7 @@ void LLAgentCamera::updateCamera()
|
||||
|
||||
validateFocusObject();
|
||||
|
||||
bool realistic_ml(gSavedSettings.getBOOL("UseRealisticMouselook"));
|
||||
static const LLCachedControl<bool> realistic_ml("UseRealisticMouselook");
|
||||
if (isAgentAvatarValid() &&
|
||||
!realistic_ml &&
|
||||
gAgentAvatarp->isSitting() &&
|
||||
@@ -1491,16 +1493,14 @@ void LLAgentCamera::updateCamera()
|
||||
if (realistic_ml)
|
||||
{
|
||||
LLQuaternion agent_rot(gAgent.getFrameAgent().getQuaternion());
|
||||
if (isAgentAvatarValid())
|
||||
if (LLViewerObject* parent = static_cast<LLViewerObject*>(gAgentAvatarp->getParent()))
|
||||
if (static_cast<LLViewerObject*>(gAgentAvatarp->getRoot())->flagCameraDecoupled())
|
||||
agent_rot *= parent->getRenderRotation();
|
||||
if (LLViewerObject* parent = static_cast<LLViewerObject*>(gAgentAvatarp->getParent()))
|
||||
if (static_cast<LLViewerObject*>(gAgentAvatarp->getRoot())->flagCameraDecoupled())
|
||||
agent_rot *= parent->getRenderRotation();
|
||||
LLViewerCamera::getInstance()->updateCameraLocation(head_pos, mCameraUpVector, gAgentAvatarp->mHeadp->getWorldPosition() + LLVector3(1.0, 0.0, 0.0) * agent_rot);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVector3 diff = mCameraPositionAgent - head_pos;
|
||||
diff = diff * ~gAgentAvatarp->mRoot->getWorldRotation();
|
||||
const LLVector3 diff((mCameraPositionAgent - head_pos) * ~gAgentAvatarp->mRoot->getWorldRotation());
|
||||
gAgentAvatarp->mPelvisp->setPosition(gAgentAvatarp->mPelvisp->getPosition() + diff);
|
||||
}
|
||||
|
||||
|
||||
@@ -3506,10 +3506,10 @@ public:
|
||||
}
|
||||
|
||||
// Successful completion.
|
||||
/* virtual */ void result(const LLSD& content)
|
||||
/* virtual */ void httpSuccess(void)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL;
|
||||
if (content["success"].asBoolean())
|
||||
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(mContent) << LL_ENDL;
|
||||
if (mContent["success"].asBoolean())
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
|
||||
}
|
||||
@@ -3520,11 +3520,10 @@ public:
|
||||
}
|
||||
|
||||
// Error
|
||||
/*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl;
|
||||
LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL;
|
||||
onFailure(status);
|
||||
llwarns << "appearance update request failed, " << dumpResponse() << llendl;
|
||||
onFailure(mStatus);
|
||||
}
|
||||
|
||||
void onFailure(U32 status)
|
||||
@@ -4465,7 +4464,9 @@ public:
|
||||
LLFolderType::FT_CLOTHING,
|
||||
"Quick Appearance");
|
||||
LLSD::UUID folder_uuid = query_map["folder_id"].asUUID();
|
||||
if ( gInventory.getCategory( folder_uuid ) != NULL )
|
||||
if ( gInventory.getCategory( folder_uuid ) != NULL &&
|
||||
folder_uuid != gInventory.getRootFolderID() &&
|
||||
folder_uuid != gInventory.getLibraryRootFolderID() )
|
||||
{
|
||||
LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false);
|
||||
|
||||
|
||||
@@ -133,11 +133,13 @@ LLAppViewerLinux::~LLAppViewerLinux()
|
||||
|
||||
bool LLAppViewerLinux::init()
|
||||
{
|
||||
#if !GLIB_CHECK_VERSION(2, 32, 0)
|
||||
// g_thread_init() must be called before *any* use of glib, *and*
|
||||
// before any mutexes are held, *and* some of our third-party
|
||||
// libraries likes to use glib functions; in short, do this here
|
||||
// really early in app startup!
|
||||
if (!g_thread_supported ()) g_thread_init (NULL);
|
||||
#endif
|
||||
|
||||
bool success = LLAppViewer::init();
|
||||
|
||||
@@ -277,7 +279,9 @@ bool LLAppViewerLinux::initSLURLHandler()
|
||||
return false; // failed
|
||||
}
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 36, 0)
|
||||
g_type_init();
|
||||
#endif
|
||||
|
||||
//ViewerAppAPI *api_server = (ViewerAppAPI*)
|
||||
g_object_new(viewerappapi_get_type(), NULL);
|
||||
@@ -297,7 +301,9 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)
|
||||
DBusGConnection *bus;
|
||||
GError *error = NULL;
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 36, 0)
|
||||
g_type_init();
|
||||
#endif
|
||||
|
||||
bus = lldbus_g_bus_get (DBUS_BUS_SESSION, &error);
|
||||
if (bus)
|
||||
|
||||
@@ -75,10 +75,10 @@ public:
|
||||
delete mData;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "Error: " << reason << llendl;
|
||||
LLUpdateTaskInventoryResponder::error(statusNum, reason);
|
||||
llwarns << "Error: " << mReason << llendl;
|
||||
LLUpdateTaskInventoryResponder::httpFailure();
|
||||
LLAssetUploadQueue *queue = mSupplier->get();
|
||||
if (queue)
|
||||
{
|
||||
@@ -86,15 +86,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
LLUpdateTaskInventoryResponder::result(content);
|
||||
LLUpdateTaskInventoryResponder::httpSuccess();
|
||||
LLAssetUploadQueue *queue = mSupplier->get();
|
||||
if (queue)
|
||||
{
|
||||
// Responder is reused across 2 phase upload,
|
||||
// so only start next upload after 2nd phase complete.
|
||||
std::string state = content["state"];
|
||||
std::string state = mContent["state"];
|
||||
if(state == "complete")
|
||||
{
|
||||
queue->request(&mSupplier);
|
||||
|
||||
@@ -223,12 +223,12 @@ LLAssetUploadResponder::~LLAssetUploadResponder()
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
|
||||
void LLAssetUploadResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "LLAssetUploadResponder::error " << statusNum
|
||||
<< " reason: " << reason << llendl;
|
||||
llinfos << "LLAssetUploadResponder::error " << mStatus
|
||||
<< " reason: " << mReason << llendl;
|
||||
LLSD args;
|
||||
switch(statusNum)
|
||||
switch(mStatus)
|
||||
{
|
||||
case 400:
|
||||
args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
|
||||
@@ -248,15 +248,15 @@ void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLAssetUploadResponder::result(const LLSD& content)
|
||||
void LLAssetUploadResponder::httpSuccess(void)
|
||||
{
|
||||
lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl;
|
||||
|
||||
std::string state = content["state"];
|
||||
std::string state = mContent["state"];
|
||||
|
||||
if (state == "upload")
|
||||
{
|
||||
uploadUpload(content);
|
||||
uploadUpload(mContent);
|
||||
}
|
||||
else if (state == "complete")
|
||||
{
|
||||
@@ -264,14 +264,14 @@ void LLAssetUploadResponder::result(const LLSD& content)
|
||||
if (mFileName.empty())
|
||||
{
|
||||
// rename the file in the VFS to the actual asset id
|
||||
// llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
|
||||
gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType);
|
||||
// llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl;
|
||||
gVFS->renameFile(mVFileID, mAssetType, mContent["new_asset"].asUUID(), mAssetType);
|
||||
}
|
||||
uploadComplete(content);
|
||||
uploadComplete(mContent);
|
||||
}
|
||||
else
|
||||
{
|
||||
uploadFailure(content);
|
||||
uploadFailure(mContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,13 +332,13 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLNewAgentInventoryResponder::error(U32 statusNum, const std::string& reason)
|
||||
void LLNewAgentInventoryResponder::httpFailure(void)
|
||||
{
|
||||
if (mCallBack)
|
||||
{
|
||||
(*mCallBack)(false, mUserData);
|
||||
}
|
||||
LLAssetUploadResponder::error(statusNum, reason);
|
||||
LLAssetUploadResponder::httpFailure();
|
||||
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE);
|
||||
}
|
||||
|
||||
@@ -498,9 +498,9 @@ void LLSendTexLayerResponder::uploadComplete(const LLSD& content)
|
||||
}
|
||||
}
|
||||
|
||||
void LLSendTexLayerResponder::error(U32 statusNum, const std::string& reason)
|
||||
void LLSendTexLayerResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "status: " << statusNum << " reason: " << reason << llendl;
|
||||
llinfos << "status: " << mStatus << " reason: " << mReason << llendl;
|
||||
|
||||
// Invoke the original callback with an error result
|
||||
LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
|
||||
@@ -1020,20 +1020,17 @@ LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResp
|
||||
delete mImpl;
|
||||
}
|
||||
|
||||
void LLNewAgentInventoryVariablePriceResponder::errorWithContent(
|
||||
U32 statusNum,
|
||||
const std::string& reason,
|
||||
const LLSD& content)
|
||||
void LLNewAgentInventoryVariablePriceResponder::httpFailure(void)
|
||||
{
|
||||
lldebugs
|
||||
<< "LLNewAgentInventoryVariablePrice::error " << statusNum
|
||||
<< " reason: " << reason << llendl;
|
||||
<< "LLNewAgentInventoryVariablePrice::error " << mStatus
|
||||
<< " reason: " << mReason << llendl;
|
||||
|
||||
if ( content.has("error") )
|
||||
if ( mContent.has("error") )
|
||||
{
|
||||
static const std::string _ERROR = "error";
|
||||
|
||||
mImpl->onTransportError(content[_ERROR]);
|
||||
mImpl->onTransportError(mContent[_ERROR]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1041,7 +1038,7 @@ void LLNewAgentInventoryVariablePriceResponder::errorWithContent(
|
||||
}
|
||||
}
|
||||
|
||||
void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
void LLNewAgentInventoryVariablePriceResponder::httpSuccess(void)
|
||||
{
|
||||
// Parse out application level errors and the appropriate
|
||||
// responses for them
|
||||
@@ -1056,13 +1053,13 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
static const std::string _RSVP = "rsvp";
|
||||
|
||||
// Check for application level errors
|
||||
if (content.has(_ERROR))
|
||||
if (mContent.has(_ERROR))
|
||||
{
|
||||
onApplicationLevelError(content[_ERROR]);
|
||||
onApplicationLevelError(mContent[_ERROR]);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string state = content[_STATE];
|
||||
std::string state = mContent[_STATE];
|
||||
LLAssetType::EType asset_type = mImpl->getAssetType();
|
||||
|
||||
if (_COMPLETE == state)
|
||||
@@ -1071,11 +1068,11 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
if (mImpl->getFilename().empty())
|
||||
{
|
||||
// rename the file in the VFS to the actual asset id
|
||||
// llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
|
||||
// llinfos << "Changing uploaded asset UUID to " << mContent["new_asset"].asUUID() << llendl;
|
||||
gVFS->renameFile(
|
||||
mImpl->getVFileID(),
|
||||
asset_type,
|
||||
content["new_asset"].asUUID(),
|
||||
mContent["new_asset"].asUUID(),
|
||||
asset_type);
|
||||
}
|
||||
|
||||
@@ -1086,8 +1083,8 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
mImpl->getFolderID(),
|
||||
mImpl->getItemName(),
|
||||
mImpl->getItemDescription(),
|
||||
content,
|
||||
content[_UPLOAD_PRICE].asInteger());
|
||||
mContent,
|
||||
mContent[_UPLOAD_PRICE].asInteger());
|
||||
|
||||
// TODO* Add bulk (serial) uploading or add
|
||||
// a super class of this that does so
|
||||
@@ -1095,9 +1092,9 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
|
||||
else if ( _CONFIRM_UPLOAD == state )
|
||||
{
|
||||
showConfirmationDialog(
|
||||
content[_UPLOAD_PRICE].asInteger(),
|
||||
content[_RESOURCE_COST].asInteger(),
|
||||
content[_RSVP].asString());
|
||||
mContent[_UPLOAD_PRICE].asInteger(),
|
||||
mContent[_RESOURCE_COST].asInteger(),
|
||||
mContent[_RSVP].asString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
const std::string& file_name,
|
||||
LLAssetType::EType asset_type);
|
||||
~LLAssetUploadResponder();
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return assetUploadResponder_timeout; }
|
||||
|
||||
virtual void uploadUpload(const LLSD& content);
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
const LLSD& post_data,
|
||||
const std::string& file_name,
|
||||
LLAssetType::EType asset_type);
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
virtual void uploadComplete(const LLSD& content);
|
||||
virtual void uploadFailure(const LLSD& content);
|
||||
/*virtual*/ char const* getName(void) const { return "LLNewAgentInventoryResponder"; }
|
||||
@@ -116,11 +116,8 @@ public:
|
||||
const LLSD& inventory_info);
|
||||
virtual ~LLNewAgentInventoryVariablePriceResponder();
|
||||
|
||||
/*virtual*/ void errorWithContent(
|
||||
U32 statusNum,
|
||||
const std::string& reason,
|
||||
const LLSD& content);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return newAgentInventoryVariablePriceResponder_timeout; }
|
||||
|
||||
virtual void onApplicationLevelError(
|
||||
@@ -148,7 +145,7 @@ public:
|
||||
~LLSendTexLayerResponder();
|
||||
|
||||
/*virtual*/ void uploadComplete(const LLSD& content);
|
||||
/*virtual*/ void error(U32 statusNum, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ char const* getName(void) const { return "LLSendTexLayerResponder"; }
|
||||
|
||||
LLBakedUploadData * mBakedUploadData;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "llagent.h"
|
||||
#include "llcallingcard.h" // for LLAvatarTracker
|
||||
#include "llfloateravatarinfo.h"
|
||||
#include "llfloatergroupbulkban.h"
|
||||
#include "llfloatergroupinvite.h"
|
||||
#include "llfloatergroups.h"
|
||||
#include "llfloaterwebprofile.h"
|
||||
@@ -747,6 +748,24 @@ bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response,
|
||||
return false;
|
||||
}
|
||||
|
||||
// <singu> Ban from group functions
|
||||
void callback_ban_from_group(const LLUUID& group, uuid_vec_t& ids)
|
||||
{
|
||||
LLFloaterGroupBulkBan::showForGroup(group, &ids);
|
||||
}
|
||||
|
||||
void ban_from_group(const uuid_vec_t& ids)
|
||||
{
|
||||
if (LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(ids.front())) // It'd be cool if LLSD could be formed from uuid_vec_t
|
||||
{
|
||||
widget->center();
|
||||
widget->setPowersMask(GP_GROUP_BAN_ACCESS);
|
||||
widget->removeNoneOption();
|
||||
widget->setSelectGroupCallback(boost::bind(callback_ban_from_group, _1, ids));
|
||||
}
|
||||
}
|
||||
// </singu>
|
||||
|
||||
// static
|
||||
void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id)
|
||||
{
|
||||
|
||||
@@ -50,16 +50,16 @@ mClassifiedID(classified_id)
|
||||
{
|
||||
}
|
||||
/*virtual*/
|
||||
void LLClassifiedStatsResponder::result(const LLSD& content)
|
||||
void LLClassifiedStatsResponder::httpSuccess(void)
|
||||
{
|
||||
S32 teleport = content["teleport_clicks"].asInteger();
|
||||
S32 map = content["map_clicks"].asInteger();
|
||||
S32 profile = content["profile_clicks"].asInteger();
|
||||
S32 search_teleport = content["search_teleport_clicks"].asInteger();
|
||||
S32 search_map = content["search_map_clicks"].asInteger();
|
||||
S32 search_profile = content["search_profile_clicks"].asInteger();
|
||||
S32 teleport = mContent["teleport_clicks"].asInteger();
|
||||
S32 map = mContent["map_clicks"].asInteger();
|
||||
S32 profile = mContent["profile_clicks"].asInteger();
|
||||
S32 search_teleport = mContent["search_teleport_clicks"].asInteger();
|
||||
S32 search_map = mContent["search_map_clicks"].asInteger();
|
||||
S32 search_profile = mContent["search_profile_clicks"].asInteger();
|
||||
|
||||
LLPanelClassified* classified_panelp = (LLPanelClassified*)mClassifiedPanelHandle.get();
|
||||
LLPanelClassifiedInfo* classified_panelp = (LLPanelClassifiedInfo*)mClassifiedPanelHandle.get();
|
||||
|
||||
if(classified_panelp)
|
||||
{
|
||||
@@ -73,10 +73,9 @@ void LLClassifiedStatsResponder::result(const LLSD& content)
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLClassifiedStatsResponder::error(U32 status, const std::string& reason)
|
||||
void LLClassifiedStatsResponder::httpFailure(void)
|
||||
{
|
||||
llinfos << "LLClassifiedStatsResponder::error("
|
||||
<< status << ": " << reason << ")" << llendl;
|
||||
llinfos << "httpFailure: " << dumpResponse() << llendl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ class LLClassifiedStatsResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
LLClassifiedStatsResponder(LLHandle<LLView> classified_panel_handle, LLUUID classified_id);
|
||||
//If we get back a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
//If we get back an error (not found, etc...), handle it here
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return classifiedStatsResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLClassifiedStatsResponder"; }
|
||||
|
||||
|
||||
@@ -56,23 +56,23 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void error(U32 status, const std::string& reason)
|
||||
virtual void httpFailure(void)
|
||||
{
|
||||
llwarns << "Crash report sending failed: " << reason << llendl;
|
||||
llwarns << "Crash report sending failed: " << mReason << llendl;
|
||||
}
|
||||
|
||||
virtual void result(const LLSD& content)
|
||||
virtual void httpSuccess(void)
|
||||
{
|
||||
std::string msg = "Crash report successfully sent";
|
||||
if (content.has("message"))
|
||||
if (mContent.has("message"))
|
||||
{
|
||||
msg += ": " + content["message"].asString();
|
||||
msg += ": " + mContent["message"].asString();
|
||||
}
|
||||
llinfos << msg << llendl;
|
||||
|
||||
if (content.has("report_id"))
|
||||
if (mContent.has("report_id"))
|
||||
{
|
||||
gSavedSettings.setS32("CrashReportID", content["report_id"].asInteger());
|
||||
gSavedSettings.setS32("CrashReportID", mContent["report_id"].asInteger());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -265,9 +265,9 @@ bool LLCurrencyUIManager::Impl::checkTransaction()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->http_status() < 200 || mResponder->http_status() >= 400)
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->getStatus() < 200 || mResponder->getStatus() >= 400)
|
||||
{
|
||||
setError(mResponder->reason(), mResponder->getURL());
|
||||
setError(mResponder->getReason(), mResponder->getURL());
|
||||
}
|
||||
else {
|
||||
switch (mTransactionType)
|
||||
|
||||
@@ -301,7 +301,8 @@ void LLFacePool::removeFaceReference(LLFace *facep)
|
||||
if (idx != -1)
|
||||
{
|
||||
facep->setReferenceIndex(-1);
|
||||
std::vector<LLFace*>::iterator iter = vector_replace_with_last(mReferences, mReferences.begin() + idx);
|
||||
std::vector<LLFace*>::iterator face_it(mReferences.begin() + idx);
|
||||
std::vector<LLFace*>::iterator iter = vector_replace_with_last(mReferences, face_it);
|
||||
if(iter != mReferences.end())
|
||||
(*iter)->setReferenceIndex(idx);
|
||||
}
|
||||
|
||||
@@ -118,16 +118,16 @@ class LLEstateChangeInfoResponder : public LLHTTPClient::ResponderWithResult
|
||||
public:
|
||||
|
||||
// if we get a normal response, handle it here
|
||||
/*virtual*/ void result(const LLSD& content)
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
llinfos << "Committed estate info" << llendl;
|
||||
LLEstateInfoModel::instance().notifyCommit();
|
||||
}
|
||||
|
||||
// if we get an error response
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
llwarns << "Failed to commit estate info (" << status << "): " << reason << llendl;
|
||||
llwarns << "Failed to commit estate info (" << mStatus << "): " << mReason << llendl;
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; }
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace
|
||||
|
||||
|
||||
void handleMessage(const LLSD& content);
|
||||
/*virtual*/ void error(U32 status, const std::string& reason);
|
||||
/*virtual*/ void result(const LLSD& content);
|
||||
/*virtual*/ void httpFailure(void);
|
||||
/*virtual*/ void httpSuccess(void);
|
||||
/*virtual*/ bool is_event_poll(void) const { return true; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return eventPollResponder_timeout; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLEventPollResponder"; }
|
||||
@@ -179,13 +179,13 @@ namespace
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLEventPollResponder::error(U32 status, const std::string& reason)
|
||||
void LLEventPollResponder::httpFailure(void)
|
||||
{
|
||||
if (mDone) return;
|
||||
|
||||
// A HTTP_BAD_GATEWAY (502) error is our standard timeout response
|
||||
// we get this when there are no events.
|
||||
if ( status == HTTP_BAD_GATEWAY )
|
||||
if ( mStatus == HTTP_BAD_GATEWAY )
|
||||
{
|
||||
mErrorCount = 0;
|
||||
makeRequest();
|
||||
@@ -199,12 +199,12 @@ namespace
|
||||
+ mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC
|
||||
, this);
|
||||
|
||||
llwarns << "Unexpected HTTP error. status: " << status << ", reason: " << reason << llendl;
|
||||
llwarns << "Unexpected HTTP error. status: " << mStatus << ", reason: " << mReason << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "LLEventPollResponder::error: <" << mCount << "> got "
|
||||
<< status << ": " << reason
|
||||
<< mStatus << ": " << mReason
|
||||
<< (mDone ? " -- done" : "") << llendl;
|
||||
stop();
|
||||
|
||||
@@ -226,25 +226,25 @@ namespace
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLEventPollResponder::result(const LLSD& content)
|
||||
void LLEventPollResponder::httpSuccess(void)
|
||||
{
|
||||
lldebugs << "LLEventPollResponder::result <" << mCount << ">"
|
||||
<< (mDone ? " -- done" : "") << ll_pretty_print_sd(content) << llendl;
|
||||
<< (mDone ? " -- done" : "") << ll_pretty_print_sd(mContent) << llendl;
|
||||
|
||||
if (mDone) return;
|
||||
|
||||
mErrorCount = 0;
|
||||
|
||||
if (!content.get("events") ||
|
||||
!content.get("id"))
|
||||
if (!mContent.get("events") ||
|
||||
!mContent.get("id"))
|
||||
{
|
||||
//llwarns << "received event poll with no events or id key" << llendl;
|
||||
makeRequest();
|
||||
return;
|
||||
}
|
||||
|
||||
mAcknowledge = content["id"];
|
||||
LLSD events = content["events"];
|
||||
mAcknowledge = mContent["id"];
|
||||
LLSD events = mContent["events"];
|
||||
|
||||
if(mAcknowledge.isUndefined())
|
||||
{
|
||||
|
||||
@@ -80,7 +80,8 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD
|
||||
|
||||
LLVolumeImplFlexible::~LLVolumeImplFlexible()
|
||||
{
|
||||
std::vector<LLVolumeImplFlexible*>::iterator iter = vector_replace_with_last(sInstanceList, sInstanceList.begin() + mInstanceIndex);
|
||||
std::vector<LLVolumeImplFlexible*>::iterator flex_it(sInstanceList.begin() + mInstanceIndex);
|
||||
std::vector<LLVolumeImplFlexible*>::iterator iter = vector_replace_with_last(sInstanceList, flex_it);
|
||||
if(iter != sInstanceList.end())
|
||||
(*iter)->mInstanceIndex = mInstanceIndex;
|
||||
std::vector<U32>::iterator update_it(sUpdateDelay.begin() + mInstanceIndex);
|
||||
|
||||
65
indra/newview/llfloateravatar.cpp
Normal file
65
indra/newview/llfloateravatar.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @file llfloateravatar.h
|
||||
* @author Leyla Farazha
|
||||
* @brief floater for the avatar changer
|
||||
*
|
||||
* $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$
|
||||
*/
|
||||
|
||||
/**
|
||||
* Floater that appears when buying an object, giving a preview
|
||||
* of its contents and their permissions.
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloateravatar.h"
|
||||
#include "llmediactrl.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llweb.h"
|
||||
|
||||
|
||||
LLFloaterAvatar::LLFloaterAvatar(const LLSD& key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar.xml", NULL, false);
|
||||
}
|
||||
|
||||
LLFloaterAvatar::~LLFloaterAvatar()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLFloaterAvatar::postBuild()
|
||||
{
|
||||
enableResizeCtrls(true, true, false);
|
||||
LLMediaCtrl* avatar_picker = findChild<LLMediaCtrl>("avatar_picker_contents");
|
||||
if (avatar_picker)
|
||||
{
|
||||
avatar_picker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
|
||||
std::string url = gSavedSettings.getString("AvatarPickerURL");
|
||||
url = LLWeb::expandURLSubstitutions(url, LLSD());
|
||||
avatar_picker->navigateTo(url, "text/html");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
44
indra/newview/llfloateravatar.h
Normal file
44
indra/newview/llfloateravatar.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @file llfloateravatar.h
|
||||
* @author Leyla Farazha
|
||||
* @brief floater for the avatar changer
|
||||
*
|
||||
* $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$
|
||||
*/
|
||||
|
||||
#ifndef LL_FLOATER_AVATAR_H
|
||||
#define LL_FLOATER_AVATAR_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLFloaterAvatar:
|
||||
public LLFloater
|
||||
, public LLFloaterSingleton<LLFloaterAvatar>
|
||||
{
|
||||
friend class LLUISingleton<LLFloaterAvatar, VisibilityPolicy<LLFloater> >;
|
||||
private:
|
||||
LLFloaterAvatar(const LLSD& key);
|
||||
/*virtual*/ ~LLFloaterAvatar();
|
||||
/*virtual*/ BOOL postBuild();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -419,24 +419,24 @@ public:
|
||||
|
||||
LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { }
|
||||
|
||||
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||
/*virtual*/ void httpCompleted(void)
|
||||
{
|
||||
//std::ostringstream ss;
|
||||
//LLSDSerialize::toPrettyXML(content, ss);
|
||||
//LLSDSerialize::toPrettyXML(mContent, ss);
|
||||
//llinfos << ss.str() << llendl;
|
||||
|
||||
// in case of invalid characters, the avatar picker returns a 400
|
||||
// just set it to process so it displays 'not found'
|
||||
if (isGoodStatus(status) || status == 400)
|
||||
if (isGoodStatus(mStatus) || mStatus == 400)
|
||||
{
|
||||
if (LLFloaterAvatarPicker::instanceExists())
|
||||
{
|
||||
LLFloaterAvatarPicker::getInstance()->processResponse(mQueryID, content);
|
||||
LLFloaterAvatarPicker::getInstance()->processResponse(mQueryID, mContent);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "avatar picker failed " << status << " reason " << reason << llendl;
|
||||
llwarns << "avatar picker failed " << mStatus << " reason " << mReason << llendl;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,9 +863,9 @@ bool LLFloaterBuyLandUI::checkTransaction()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->http_status() < 200 || mResponder->http_status() >= 400)
|
||||
if (mResponder->result_code() != CURLE_OK || mResponder->getStatus() < 200 || mResponder->getStatus() >= 400)
|
||||
{
|
||||
tellUserError(mResponder->reason(), mResponder->getURL());
|
||||
tellUserError(mResponder->getReason(), mResponder->getURL());
|
||||
}
|
||||
else {
|
||||
switch (mTransactionType)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user