merge -r62831:64079 branches/maintenance to release

master
Kelly Washington 2007-06-21 22:40:22 +00:00
parent 2638f12f95
commit e03bb0606a
171 changed files with 3039 additions and 773 deletions

View File

@ -4,30 +4,41 @@ along with the issue identifier corresponding to the patches we've
received from them. To see more about these contributions, visit
http://jira.secondlife.com/ and enter the issue identifier.
Alissa Sabre - VWR-81, VWR-83, VWR-414, VWR-415
Able Whitman - VWR-650
Alissa Sabre - VWR-81, VWR-83, VWR-171, VWR-251, VWR-414, VWR-415, VWR-459, VWR-606, VWR-652
Argent Stonecutter - VWR-68
Benja Kepler - VWR-746
Blakar Ogre - VWR-881
blino Nakamura - VWR-17
bushing Spatula - VWR-424
Drewan Keats - VWR-28, VWR-412
bushing Spatula - VWR-424, VWR-119
Dale Glass - VWR-120, VWR-560
Drewan Keats - VWR-28, VWR-248, VWR-412
Duckless Vandyke - VWR-383
Dylan Haskell - VWR-72
Dzonatas Sol - VWR-198, VWR-878
Eddy Stryker - VWR-15, VWR-23
Gigs Taggart - VWR-71, VWR-326
Gigs Taggart - VWR-71, VWR-326, VWR-1217
Ginko Bayliss - VWR-4
Hikkoshi Sakai - VWR-429
Hiro Sommambulist - VWR-66, VWR-97, VWR-100, VWR-105, VWR-108, VWR-118, VWR-136
Jacek Antonelli - VWR-165, VWR-188
Hiro Sommambulist - VWR-66, VWR-97, VWR-100, VWR-105, VWR-108, VWR-118, VWR-132, VWR-136, VWR-143
Jacek Antonelli - VWR-165, VWR-188, VWR-427, VWR-597
Joannah Cramer - VWR-53
Joghert LeSabre - VWR-64
Kage Pixel - VWR-11
Kunnis Basiat - VWR-82
Nicholaz Beresford - VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-869, VWR-870, VWR-871, VWR-908, VWR-966
Nicholaz Beresford - VWR-132, VWR-176, VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-869, VWR-870, VWR-871, VWR-873, VWR-908, VWR-966
Paul Churchill - VWR-20
Paula Innis - VWR-30
Peekay Semyorka - VWR-7, VWR-19, VWR-49
Paula Innis - VWR-30, VWR-1049
Peekay Semyorka - VWR-7, VWR-19, VWR-49, VWR-79
Ryozu Kojima - VWR-287
SignpostMarv Martin - VWR-154, VWR-155
Simon Nolan - VWR-409
SpacedOut Frye - VWR-57, VWR-94, VWR-121, VWR-123
Stevex Janus - VWR-1182
Still Defiant - VWR-207, VWR-446
Strife Onizuka - SVC-9, VWR-74, VWR-85, VWR-148
Zi Ree - VWR-671, VWR-682
tenebrous pau - VWR-247
TBBle Kurosawa - VWR-938, VWR-941, VWR-944
Zi Ree - VWR-671, VWR-682, VWR-1140
Zipherius Turas - VWR-76, VWR-77

View File

@ -526,6 +526,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
{
if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration())
{
posep->setWeight(0.f);
deactivateMotion(motionp);
}
continue;
@ -552,6 +553,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
}
else
{
posep->setWeight(0.f);
deactivateMotion(motionp);
continue;
}
@ -802,7 +804,6 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time)
//-----------------------------------------------------------------------------
BOOL LLMotionController::deactivateMotion(LLMotion *motion)
{
motion->getPose()->setWeight(0.f);
motion->deactivate();
mActiveMotions.remove(motion);

View File

@ -15,7 +15,7 @@
#include <sys/param.h> // Need PATH_MAX in APR headers...
#endif
#include "boost/noncopyable.hpp"
#include <boost/noncopyable.hpp>
#include "apr-1/apr_thread_proc.h"
#include "apr-1/apr_thread_mutex.h"

View File

@ -1,5 +1,5 @@
/**
* @file indra_constants.h
* @file llavatarconstants.h
* @brief some useful short term constants for Indra
*
* Copyright (c) 2001-$CurrentYear$, Linden Research, Inc.

View File

@ -30,7 +30,8 @@ typedef enum e_chat_type
CHAT_TYPE_START = 4,
CHAT_TYPE_STOP = 5,
CHAT_TYPE_DEBUG_MSG = 6,
CHAT_TYPE_REGION = 7
CHAT_TYPE_REGION = 7,
CHAT_TYPE_OWNER = 8
} EChatType;
typedef enum e_chat_audible_level

View File

@ -35,13 +35,15 @@ const U32 SOUTHWEST = 6;
const U32 SOUTHEAST = 7;
const U32 MIDDLE = 8;
const U8 LL_SOUND_FLAG_NONE = 0x00;
const U8 LL_SOUND_FLAG_LOOP = 0x01;
const U8 LL_SOUND_FLAG_SYNC_MASTER = 0x02;
const U8 LL_SOUND_FLAG_SYNC_SLAVE = 0x04;
const U8 LL_SOUND_FLAG_SYNC_PENDING = 0x08;
const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
const U8 LL_SOUND_FLAG_QUEUE = 0x10;
const U8 EAST_MASK = 0x1<<EAST;
const U8 NORTH_MASK = 0x1<<NORTH;
const U8 WEST_MASK = 0x1<<WEST;
const U8 SOUTH_MASK = 0x1<<SOUTH;
const U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
const U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
const U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
const U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
const U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
const U32 gDirAdjacent[8][2] = {
@ -67,15 +69,6 @@ const S32 gDirAxes[8][2] = {
{ 1,-1}, // se
};
const U8 EAST_MASK = 1;
const U8 NORTH_MASK = 2;
const U8 WEST_MASK = 4;
const U8 SOUTH_MASK = 8;
const U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
const U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
const U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
const U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
const S32 gDirMasks[8] = {
EAST_MASK,
NORTH_MASK,
@ -113,6 +106,14 @@ const U32 RIGHT_SIDE = 4;
const U32 TOP_SIDE = 5;
const U32 BOTTOM_SIDE = 6;
const U8 LL_SOUND_FLAG_NONE = 0x0;
const U8 LL_SOUND_FLAG_LOOP = 1<<0;
const U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
const U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
const U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
const U8 LL_SOUND_FLAG_QUEUE = 1<<4;
const U8 LL_SOUND_FLAG_STOP = 1<<5;
const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
//
// *NOTE: These values may be used as hard-coded numbers in scanf() variants.

View File

@ -9,6 +9,7 @@
* $License$
*/
#include "linden_common.h"
#include "llfile.h"
#include "llstring.h"
#include "llerror.h"

View File

@ -5,6 +5,7 @@
* $License$
*/
#include "linden_common.h"
#include "llmortician.h"
#include <list>

View File

@ -433,7 +433,7 @@ bool CProcessor::AnalyzeIntelProcessor()
case 3: // Model = 8, Brand id = 3: Pentium III Xeon (on-die L2 cache) processor model
strncat(strCPUName, "Intel Pentium III Xeon (0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/
break;
default: // ...²
default: // ...
strncat(strCPUName, "Intel Pentium III core (unknown model, 0.18 micron process) with internal L2 cache", sizeof(strCPUName)-(strlen(strCPUName)-1)); /*Flawfinder: ignore*/
break;
}
@ -644,8 +644,8 @@ bool CProcessor::AnalyzeAMDProcessor()
mov dword ptr [tmp+44], edx
}
// And copy it to the brand id string
strncpy(CPUInfo.strBrandID, tmp,sizeof(CPUInfo.strBrandID-1)); /* Flawfinder: ignore */
CPUInfo.strBrandID[sizeof(CPUInfo.strBrandID-1)]='\0';
strncpy(CPUInfo.strBrandID, tmp,sizeof(CPUInfo.strBrandID)-1);
CPUInfo.strBrandID[sizeof(CPUInfo.strBrandID)-1]='\0';
}
else
{
@ -1260,17 +1260,17 @@ void CProcessor::DecodeProcessorConfiguration(unsigned int cfg)
CPUInfo._L1.Data.uiAssociativeWays = 4;
CPUInfo._L1.Data.uiLineSize = 64;
break;
case 0x70: // cfg = 0x70: trace L1 cache present, 12 KµOPs, 4 ways
case 0x70: // cfg = 0x70: trace L1 cache present, 12 KuOPs, 4 ways
CPUInfo._Trace.bPresent = true;
strcpy(CPUInfo._Trace.strSize, "12 K-micro-ops"); /* Flawfinder: ignore */
CPUInfo._Trace.uiAssociativeWays = 4;
break;
case 0x71: // cfg = 0x71: trace L1 cache present, 16 KµOPs, 4 ways
case 0x71: // cfg = 0x71: trace L1 cache present, 16 KuOPs, 4 ways
CPUInfo._Trace.bPresent = true;
strcpy(CPUInfo._Trace.strSize, "16 K-micro-ops"); /* Flawfinder: ignore */
CPUInfo._Trace.uiAssociativeWays = 4;
break;
case 0x72: // cfg = 0x72: trace L1 cache present, 32 KµOPs, 4 ways
case 0x72: // cfg = 0x72: trace L1 cache present, 32 KuOPs, 4 ways
CPUInfo._Trace.bPresent = true;
strcpy(CPUInfo._Trace.strSize, "32 K-micro-ops"); /* Flawfinder: ignore */
CPUInfo._Trace.uiAssociativeWays = 4;

View File

@ -6,6 +6,7 @@
* $License$
*/
#include "linden_common.h"
#include "llsd.h"
#include <sstream>

View File

@ -378,7 +378,10 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
status = XML_ParseBuffer(mParser, 0, true);
if (status == XML_STATUS_ERROR && !mGracefullStop)
{
((char*) buffer)[count? count - 1 : 0] = '\0';
if (buffer)
{
((char*) buffer)[count ? count - 1 : 0] = '\0';
}
llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl;
data = LLSD();
return -1;

View File

@ -277,4 +277,4 @@ char* ll_pretty_print_sd(const LLSD& sd)
strncpy(buffer, stream.str().c_str(), bufferSize);
buffer[bufferSize - 1] = '\0';
return buffer;
}
}

View File

@ -6,6 +6,8 @@
* $License$
*/
#include "linden_common.h"
#include <iostream>
#include <string>

View File

@ -653,6 +653,26 @@ std::string mbcsstring_makeASCII(const std::string& wstr)
}
return out_str;
}
std::string utf8str_removeCRLF(const std::string& utf8str)
{
if (0 == utf8str.length())
{
return std::string();
}
const char CR = 13;
std::string out;
out.reserve(utf8str.length());
const S32 len = (S32)utf8str.length();
for( S32 i = 0; i < len; i++ )
{
if( utf8str[i] != CR )
{
out.push_back(utf8str[i]);
}
}
return out;
}
#if LL_WINDOWS
/* If the size of the passed in buffer is not large enough to hold the string,

View File

@ -437,6 +437,9 @@ std::string utf8str_makeASCII(const std::string& utf8str);
// Hack - used for evil notecards.
std::string mbcsstring_makeASCII(const std::string& str);
std::string utf8str_removeCRLF(const std::string& utf8str);
template <class T>
std::ostream& operator<<(std::ostream &s, const LLStringBase<T> &str)
{

View File

@ -168,6 +168,55 @@ LLURI::LLURI(const std::string& escaped_str)
}
}
static BOOL isDefault(const std::string& scheme, U16 port)
{
if (scheme == "http")
return port == 80;
if (scheme == "https")
return port == 443;
if (scheme == "ftp")
return port == 21;
return FALSE;
}
LLURI::LLURI(const std::string& scheme,
const std::string& userName,
const std::string& password,
const std::string& hostName,
U16 port,
const std::string& escapedPath,
const std::string& escapedQuery)
: mScheme(scheme),
mEscapedPath(escapedPath),
mEscapedQuery(escapedQuery)
{
std::ostringstream auth;
std::ostringstream opaque;
opaque << "//";
if (!userName.empty())
{
auth << escape(userName);
if (!password.empty())
{
auth << ':' << escape(password);
}
auth << '@';
}
auth << hostName;
if (!isDefault(scheme, port))
{
auth << ':' << port;
}
mEscapedAuthority = auth.str();
opaque << mEscapedAuthority << escapedPath << escapedQuery;
mEscapedOpaque = opaque.str();
}
LLURI::~LLURI()
{
}
@ -427,6 +476,35 @@ std::string LLURI::hostName() const
return unescape(host);
}
std::string LLURI::userName() const
{
std::string user, userPass, host, port;
findAuthorityParts(mEscapedAuthority, userPass, host, port);
std::string::size_type pos = userPass.find(':');
if (pos != std::string::npos)
{
user = userPass.substr(0, pos);
}
return unescape(user);
}
std::string LLURI::password() const
{
std::string pass, userPass, host, port;
findAuthorityParts(mEscapedAuthority, userPass, host, port);
std::string::size_type pos = userPass.find(':');
if (pos != std::string::npos)
{
pass = userPass.substr(pos + 1);
}
return unescape(pass);
}
BOOL LLURI::defaultPort() const
{
return isDefault(mScheme, hostPort());
}
U16 LLURI::hostPort() const
{
std::string user, host, port;

View File

@ -28,6 +28,14 @@ class LLURI
public:
LLURI();
LLURI(const std::string& escaped_str);
LLURI(const std::string& scheme,
const std::string& userName,
const std::string& password,
const std::string& hostName,
U16 hostPort,
const std::string& escapedPath,
const std::string& escapedQuery);
// construct from escaped string, as would be transmitted on the net
~LLURI();
@ -48,8 +56,6 @@ public:
const U32& port,
const LLSD& path,
const LLSD& query);
std::string asString() const;
// the whole URI, escaped as needed
@ -64,10 +70,15 @@ public:
// for schemes that follow path like syntax (http, https, ftp)
std::string authority() const; // ex.: "host.com:80"
std::string hostName() const; // ex.: "host.com"
std::string userName() const;
std::string password() const;
U16 hostPort() const; // ex.: 80, will include implicit port
BOOL defaultPort() const; // true if port is default for scheme
const std::string& escapedPath() const { return mEscapedPath; }
std::string path() const; // ex.: "/abc/def", includes leading slash
// LLSD pathArray() const; // above decoded into an array of strings
std::string query() const; // ex.: "x=34", section after "?"
const std::string& escapedQuery() const { return mEscapedQuery; }
LLSD queryMap() const; // above decoded into a map
static LLSD queryMap(std::string escaped_query_string);
static std::string mapToQueryString(const LLSD& queryMap);

View File

@ -2,7 +2,7 @@
* @file string_table.h
* @brief Legacy wrapper header.
*
* Copyright (c) 2000-$CurrentYear$ Linden Research, Inc.
* Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#include "llstringtable.h"

View File

@ -2,7 +2,7 @@
* @file timer.h
* @brief Legacy wrapper header.
*
* Copyright (c) 2000-$CurrentYear$ Linden Research, Inc.
* Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#include "lltimer.h"

View File

@ -2,6 +2,6 @@
* @file timing.cpp
* @brief This file will be deprecated in the future.
*
* Copyright (c) 2000-$CurrentYear$ Linden Research, Inc.
* Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.
* $License$
*/

View File

@ -1085,7 +1085,8 @@ file_extensions[] =
{ "jpg", IMG_CODEC_JPEG },
{ "jpeg", IMG_CODEC_JPEG },
{ "mip", IMG_CODEC_DXT },
{ "dxt", IMG_CODEC_DXT }
{ "dxt", IMG_CODEC_DXT },
{ "png", IMG_CODEC_PNG }
};
#define NUM_FILE_EXTENSIONS sizeof(file_extensions)/sizeof(file_extensions[0])

View File

@ -47,7 +47,8 @@ enum
IMG_CODEC_TGA = 4,
IMG_CODEC_JPEG = 5,
IMG_CODEC_DXT = 6,
IMG_CODEC_EOF = 7
IMG_CODEC_PNG = 7,
IMG_CODEC_EOF = 8
};
//============================================================================

View File

@ -0,0 +1,127 @@
/*
* @file llimagepng.cpp
* @brief LLImageFormatted glue to encode / decode PNG files.
*
* Copyright (c) 2007 Peekay Semyorka.
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#include "linden_common.h"
#include "stdtypes.h"
#include "llerror.h"
#include "llimage.h"
#include "llpngwrapper.h"
#include "llimagepng.h"
// ---------------------------------------------------------------------------
// LLImagePNG
// ---------------------------------------------------------------------------
LLImagePNG::LLImagePNG()
: LLImageFormatted(IMG_CODEC_PNG),
mTmpWriteBuffer(NULL)
{
}
LLImagePNG::~LLImagePNG()
{
if (mTmpWriteBuffer)
{
delete[] mTmpWriteBuffer;
}
}
// Virtual
// Parse PNG image information and set the appropriate
// width, height and component (channel) information.
BOOL LLImagePNG::updateData()
{
resetLastError();
// Check to make sure that this instance has been initialized with data
if (!getData() || (0 == getDataSize()))
{
setLastError("Uninitialized instance of LLImagePNG");
return FALSE;
}
// Decode the PNG data and extract sizing information
LLPngWrapper pngWrapper;
LLPngWrapper::ImageInfo infop;
if (! pngWrapper.readPng(getData(), NULL, &infop))
{
setLastError(pngWrapper.getErrorMessage());
return FALSE;
}
setSize(infop.mWidth, infop.mHeight, infop.mComponents);
return TRUE;
}
// Virtual
// Decode an in-memory PNG image into the raw RGB or RGBA format
// used within SecondLife.
BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time)
{
llassert_always(raw_image);
resetLastError();
// Check to make sure that this instance has been initialized with data
if (!getData() || (0 == getDataSize()))
{
setLastError("LLImagePNG trying to decode an image with no data!");
return FALSE;
}
// Decode the PNG data into the raw image
LLPngWrapper pngWrapper;
if (! pngWrapper.readPng(getData(), raw_image))
{
setLastError(pngWrapper.getErrorMessage());
return FALSE;
}
return TRUE;
}
// Virtual
// Encode the in memory RGB image into PNG format.
BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
{
llassert_always(raw_image);
resetLastError();
// Image logical size
setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents());
// Temporary buffer to hold the encoded image. Note: the final image
// size should be much smaller due to compression.
if (mTmpWriteBuffer)
{
delete[] mTmpWriteBuffer;
}
U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024;
U8* mTmpWriteBuffer = new U8[ bufferSize ];
// Delegate actual encoding work to wrapper
LLPngWrapper pngWrapper;
if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer))
{
setLastError(pngWrapper.getErrorMessage());
return FALSE;
}
// Resize internal buffer and copy from temp
U32 encodedSize = pngWrapper.getFinalSize();
allocateData(encodedSize);
memcpy(getData(), mTmpWriteBuffer, encodedSize);
delete[] mTmpWriteBuffer;
return TRUE;
}

View File

@ -0,0 +1,31 @@
/*
* @file llimagepng.h
*
* Copyright (c) 2007 Peekay Semyorka.
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#ifndef LL_LLIMAGEPNG_H
#define LL_LLIMAGEPNG_H
#include "stdtypes.h"
#include "llimage.h"
class LLImagePNG : public LLImageFormatted
{
protected:
~LLImagePNG();
public:
LLImagePNG();
BOOL updateData();
BOOL decode(LLImageRaw* raw_image, F32 decode_time = 0.0);
BOOL encode(const LLImageRaw* raw_image, F32 encode_time = 0.0);
private:
U8* mTmpWriteBuffer;
};
#endif

View File

@ -1,5 +1,5 @@
/**
* @file llimage.cpp
* @file llimageworker.cpp
* @brief Base class for images.
*
* Copyright (c) 2001-$CurrentYear$, Linden Research, Inc.

View File

@ -0,0 +1,368 @@
/*
* @file llpngwrapper.cpp
* @brief Encapsulates libpng read/write functionality.
*
* Copyright (c) 2007 Peekay Semyorka.
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#include "linden_common.h"
#include "stdtypes.h"
#include "llerror.h"
#include "llimage.h"
#include "llpngwrapper.h"
// ---------------------------------------------------------------------------
// LLPngWrapper
// ---------------------------------------------------------------------------
LLPngWrapper::LLPngWrapper()
: mReadPngPtr( NULL ),
mReadInfoPtr( NULL ),
mWritePngPtr( NULL ),
mWriteInfoPtr( NULL ),
mRowPointers( NULL ),
mBitDepth( 0 ),
mColorType( 0 ),
mChannels( 0 ),
mInterlaceType( 0 ),
mCompressionType( 0 ),
mFilterMethod( 0 ),
mFinalSize( 0 )
{
}
LLPngWrapper::~LLPngWrapper()
{
releaseResources();
}
// Checks the src for a valid PNG header
BOOL LLPngWrapper::isValidPng(U8* src)
{
const int PNG_BYTES_TO_CHECK = 8;
int sig = png_sig_cmp((png_bytep)src, (png_size_t)0, PNG_BYTES_TO_CHECK);
if (sig != 0)
{
mErrorMessage = "Invalid or corrupt PNG file";
return FALSE;
}
return TRUE;
}
// Called by the libpng library when a fatal encoding or decoding error
// occurs. We simply throw the error message and let our try/catch
// block clean up.
void LLPngWrapper::errorHandler(png_structp png_ptr, png_const_charp msg)
{
throw msg;
}
// Called by the libpng library when reading (decoding) the PNG file. We
// copy the PNG data from our internal buffer into the PNG's data buffer.
void LLPngWrapper::readDataCallback(png_structp png_ptr, png_bytep dest, png_size_t length)
{
PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr);
U8 *src = &dataInfo->mData[dataInfo->mOffset];
memcpy(dest, src, length);
dataInfo->mOffset += static_cast<U32>(length);
}
// Called by the libpng library when writing (encoding) the PNG file. We
// copy the encoded result into our data buffer.
void LLPngWrapper::writeDataCallback(png_structp png_ptr, png_bytep src, png_size_t length)
{
PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr);
U8 *dest = &dataInfo->mData[dataInfo->mOffset];
memcpy(dest, src, length);
dataInfo->mOffset += static_cast<U32>(length);
}
// Flush the write output pointer
void LLPngWrapper::writeFlush(png_structp png_ptr)
{
// no-op since we're just writing to memory
}
// Read the PNG file using the libpng. The low-level interface is used here
// because we want to do various transformations (including setting the
// matte background if any, and applying gama) which can't be done with
// the high-level interface. The scanline also begins at the bottom of
// the image (per SecondLife conventions) instead of at the top, so we
// must assign row-pointers in "reverse" order.
BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop)
{
try
{
// Create and initialize the png structures
mReadPngPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
this, &errorHandler, NULL);
if (mReadPngPtr == NULL)
{
throw "Problem creating png read structure";
}
// Allocate/initialize the memory for image information.
mReadInfoPtr = png_create_info_struct(mReadPngPtr);
// Set up the input control
PngDataInfo dataPtr;
dataPtr.mData = src;
dataPtr.mOffset = 0;
png_set_read_fn(mReadPngPtr, &dataPtr, &readDataCallback);
png_set_sig_bytes(mReadPngPtr, 0);
// setup low-level read and get header information
png_read_info(mReadPngPtr, mReadInfoPtr);
png_get_IHDR(mReadPngPtr, mReadInfoPtr, &mWidth, &mHeight,
&mBitDepth, &mColorType, &mInterlaceType,
&mCompressionType, &mFilterMethod);
// Normalize the image, then get updated image information
// after transformations have been applied
normalizeImage();
updateMetaData();
// If a raw object is supplied, read the PNG image into its
// data space
if (rawImage != NULL)
{
rawImage->resize(static_cast<U16>(mWidth),
static_cast<U16>(mHeight), mChannels);
U8 *dest = rawImage->getData();
int offset = mWidth * mChannels;
// Set up the row pointers and read the image
mRowPointers = new U8* [mHeight];
for (U32 i=0; i < mHeight; i++)
{
mRowPointers[i] = &dest[(mHeight-i-1)*offset];
}
png_read_image(mReadPngPtr, mRowPointers);
// Finish up, ensures all metadata are updated
png_read_end(mReadPngPtr, NULL);
}
// If an info object is supplied, copy the relevant info
if (infop != NULL)
{
infop->mHeight = static_cast<U16>(mHeight);
infop->mWidth = static_cast<U16>(mWidth);
infop->mComponents = mChannels;
}
mFinalSize = dataPtr.mOffset;
}
catch (png_const_charp msg)
{
mErrorMessage = msg;
releaseResources();
return (FALSE);
}
// Clean up and return
releaseResources();
return (TRUE);
}
// Do transformations to normalize the input to 8-bpp RGBA
void LLPngWrapper::normalizeImage()
{
// 1. Expand any palettes
// 2. Convert grayscales to RGB
// 3. Create alpha layer from transparency
// 4. Ensure 8-bpp for all images
// 5. Apply background matte if any
// 6. Set (or guess) gamma
if (mColorType == PNG_COLOR_TYPE_PALETTE)
{
png_set_palette_to_rgb(mReadPngPtr);
}
if (mColorType == PNG_COLOR_TYPE_GRAY && mBitDepth < 8)
{
png_set_gray_1_2_4_to_8(mReadPngPtr);
}
if (mColorType == PNG_COLOR_TYPE_GRAY
|| mColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
{
png_set_gray_to_rgb(mReadPngPtr);
}
if (png_get_valid(mReadPngPtr, mReadInfoPtr, PNG_INFO_tRNS))
{
png_set_tRNS_to_alpha(mReadPngPtr);
}
if (mBitDepth < 8)
{
png_set_packing(mReadPngPtr);
}
else if (mBitDepth == 16)
{
png_set_strip_16(mReadPngPtr);
}
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
if (mHasBKGD)
{
png_set_background(mReadPngPtr, mBackgroundColor,
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
}
#if LL_DARWIN
const F64 SCREEN_GAMMA = 1.8;
#else
const F64 SCREEN_GAMMA = 2.2;
#endif
if (png_get_gAMA(mReadPngPtr, mReadInfoPtr, &mGamma))
{
png_set_gamma(mReadPngPtr, SCREEN_GAMMA, mGamma);
}
else
{
png_set_gamma(mReadPngPtr, SCREEN_GAMMA, 1/SCREEN_GAMMA);
}
}
// Read out the image meta-data
void LLPngWrapper::updateMetaData()
{
png_read_update_info(mReadPngPtr, mReadInfoPtr);
mWidth = png_get_image_width(mReadPngPtr, mReadInfoPtr);
mHeight = png_get_image_height(mReadPngPtr, mReadInfoPtr);
mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr);
mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr);
mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr);
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
}
// Method to write raw image into PNG at dest. The raw scanline begins
// at the bottom of the image per SecondLife conventions.
BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest)
{
try
{
S8 numComponents = rawImage->getComponents();
switch (numComponents)
{
case 1:
mColorType = PNG_COLOR_TYPE_GRAY;
break;
case 2:
mColorType = PNG_COLOR_TYPE_GRAY_ALPHA;
break;
case 3:
mColorType = PNG_COLOR_TYPE_RGB;
break;
case 4:
mColorType = PNG_COLOR_TYPE_RGB_ALPHA;
break;
default:
mColorType = -1;
}
if (mColorType == -1)
{
throw "Unsupported image: unexpected number of channels";
}
mWritePngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
NULL, &errorHandler, NULL);
if (!mWritePngPtr)
{
throw "Problem creating png write structure";
}
mWriteInfoPtr = png_create_info_struct(mWritePngPtr);
// Setup write function
PngDataInfo dataPtr;
dataPtr.mData = dest;
dataPtr.mOffset = 0;
png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush);
// Setup image params
mWidth = rawImage->getWidth();
mHeight = rawImage->getHeight();
mBitDepth = 8; // Fixed to 8-bpp in SL
mChannels = numComponents;
mInterlaceType = PNG_INTERLACE_NONE;
mCompressionType = PNG_COMPRESSION_TYPE_DEFAULT;
mFilterMethod = PNG_FILTER_TYPE_DEFAULT;
// Write header
png_set_IHDR(mWritePngPtr, mWriteInfoPtr, mWidth, mHeight,
mBitDepth, mColorType, mInterlaceType,
mCompressionType, mFilterMethod);
// Get data and compute row size
const U8* data = rawImage->getData();
int offset = mWidth * mChannels;
// Ready to write, start with the header
png_write_info(mWritePngPtr, mWriteInfoPtr);
// Write image (sorry, must const-cast for libpng)
const U8 * rowPointer;
for (U32 i=0; i < mHeight; i++)
{
rowPointer = &data[(mHeight-1-i)*offset];
png_write_row(mWritePngPtr, const_cast<png_bytep>(rowPointer));
}
// Finish up
png_write_end(mWritePngPtr, mWriteInfoPtr);
mFinalSize = dataPtr.mOffset;
}
catch (png_const_charp msg)
{
mErrorMessage = msg;
releaseResources();
return (FALSE);
}
releaseResources();
return TRUE;
}
// Cleanup various internal structures
void LLPngWrapper::releaseResources()
{
if (mReadPngPtr || mReadInfoPtr)
{
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL);
mReadPngPtr = NULL;
mReadInfoPtr = NULL;
}
if (mWritePngPtr || mWriteInfoPtr)
{
png_destroy_write_struct(&mWritePngPtr, &mWriteInfoPtr);
mWritePngPtr = NULL;
mWriteInfoPtr = NULL;
}
if (mRowPointers)
{
delete[] mRowPointers;
mRowPointers = NULL;
}
}
// Get final image size after compression
U32 LLPngWrapper::getFinalSize()
{
return mFinalSize;
}
// Get last error message, if any
LLString LLPngWrapper::getErrorMessage()
{
return mErrorMessage;
}

View File

@ -0,0 +1,82 @@
/*
* @file llpngwrapper.h
*
* Copyright (c) 2007 Peekay Semyorka.
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#ifndef LL_LLPNGWRAPPER_H
#define LL_LLPNGWRAPPER_H
#include "libpng12/png.h"
#include "llimage.h"
class LLPngWrapper
{
public:
LLPngWrapper();
virtual ~LLPngWrapper();
public:
struct ImageInfo
{
U16 mWidth;
U16 mHeight;
S8 mComponents;
};
BOOL isValidPng(U8* src);
BOOL readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop = NULL);
BOOL writePng(const LLImageRaw* rawImage, U8* dst);
U32 getFinalSize();
LLString getErrorMessage();
protected:
void normalizeImage();
void updateMetaData();
private:
// Structure for writing/reading PNG data to/from memory
// as opposed to using a file.
struct PngDataInfo
{
U8 *mData;
U32 mOffset;
};
static void writeFlush(png_structp png_ptr);
static void errorHandler(png_structp png_ptr, png_const_charp msg);
static void readDataCallback(png_structp png_ptr, png_bytep dest, png_size_t length);
static void writeDataCallback(png_structp png_ptr, png_bytep src, png_size_t length);
void releaseResources();
png_structp mReadPngPtr;
png_infop mReadInfoPtr;
png_structp mWritePngPtr;
png_infop mWriteInfoPtr;
U8 **mRowPointers;
png_uint_32 mWidth;
png_uint_32 mHeight;
S32 mBitDepth;
S32 mColorType;
S32 mChannels;
S32 mInterlaceType;
S32 mCompressionType;
S32 mFilterMethod;
U32 mFinalSize;
BOOL mHasBKGD;
png_color_16p mBackgroundColor;
F64 mGamma;
LLString mErrorMessage;
};
#endif

View File

@ -1211,24 +1211,6 @@ BOOL LLParcel::exportStream(std::ostream& output_stream)
return TRUE;
}
// virtual
LLSD LLParcel::asLLSD() const
{
LLSD p;
p["parcel-id"] = getID();
p["name"] = getName();
p["desc"] = getDesc();
p["owner-id"] = getOwnerID();
p["group-id"] = getGroupID();
p["group-owned"] = (bool)getIsGroupOwned();
p["auction-id"] = (S32)getAuctionID();
p["snapshot-id"] = getSnapshotID();
p["authorized-buyer-id"] = getAuthorizedBuyerID();
p["sale-price"] = getSalePrice();
p["parcel-flags"] = (S32)getParcelFlags();
// NOTE: This list is incomplete, as this is used only for search. JC
return p;
}
// Assumes we are in a block "ParcelData"
void LLParcel::packMessage(LLMessageSystem* msg)

View File

@ -244,7 +244,6 @@ public:
BOOL importStream(std::istream& input_stream);
BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry);
BOOL exportStream(std::ostream& output_stream);
virtual LLSD asLLSD() const;
void packMessage(LLMessageSystem* msg);
void unpackMessage(LLMessageSystem* msg);

View File

@ -120,7 +120,7 @@ public:
const LLUUID& getOwner() const { return mOwner; }
// return the group_id of the group associated with the
// object. group_id == owner_id if the object is group owned.
// object.
const LLUUID& getGroup() const { return mGroup; }
// return the agent_id of the last agent owner. Only returns

View File

@ -1,5 +1,5 @@
/**
* @file lluserrealations.cpp
* @file lluserrelations.cpp
* @author Phoenix
* @date 2006-10-12
* @brief Implementation of a simple cache of user relations.

View File

@ -1,5 +1,5 @@
/**
* @file llluserrelations.h
* @file lluserrelations.h
* @author Phoenix
* @date 2006-10-12
* @brief Declaration of a class for handling granted rights.

View File

@ -2,7 +2,7 @@
* @file camera.h
* @brief Legacy wrapper header.
*
* Copyright (c) 2000-$CurrentYear$ Linden Research, Inc.
* Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.
* $License$
*/

View File

@ -2,7 +2,7 @@
* @file coordframe.h
* @brief Legacy wrapper header.
*
* Copyright (c) 2000-$CurrentYear$ Linden Research, Inc.
* Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.
* $License$
*/

View File

@ -1,5 +1,5 @@
/**
* @file qmath.cpp
* @file llquaternion.cpp
* @brief LLQuaternion class implementation.
*
* Copyright (c) 2000-$CurrentYear$, Linden Research, Inc.

View File

@ -1779,6 +1779,8 @@ void LLVolume::createVolumeFaces()
// sculpt replaces generate() for sculpted surfaces
void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
{
U8 sculpt_type = mParams.getSculptType();
BOOL data_is_empty = FALSE;
if (sculpt_width == 0 || sculpt_height == 0 || sculpt_data == NULL)
@ -1860,6 +1862,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
line += sizeT;
}
}
else
{
S32 line = 0;
@ -1874,18 +1877,52 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width);
U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height);
if (y == sculpt_height) // stitch bottom row
if (y == 0) // top row stitching
{
y = sculpt_height - 1;
x = sculpt_width / 2;
// pinch?
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
{
x = sculpt_width / 2;
}
}
if (x == sculpt_width) // stitch sides
x = 0;
if (y == sculpt_height) // bottom row stitching
{
// wrap?
if (sculpt_type == LL_SCULPT_TYPE_TORUS)
{
y = 0;
}
else
{
y = sculpt_height - 1;
}
if (y == 0) // stitch top row
x = sculpt_width / 2;
// pinch?
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
{
x = sculpt_width / 2;
}
}
if (x == sculpt_width) // side stitching
{
// wrap?
if ((sculpt_type == LL_SCULPT_TYPE_SPHERE) ||
(sculpt_type == LL_SCULPT_TYPE_TORUS) ||
(sculpt_type == LL_SCULPT_TYPE_CYLINDER))
{
x = 0;
}
else
{
x = sculpt_width - 1;
}
}
U32 index = (x + y * sculpt_width) * sculpt_components;
pt.mPos.mV[0] = sculpt_data[index ] / 256.f - 0.5f;
pt.mPos.mV[1] = sculpt_data[index+1] / 256.f - 0.5f;
@ -4595,84 +4632,132 @@ BOOL LLVolumeFace::createSide()
}
}
// adjust normals based on wrapping and stitching
BOOL s_bottom_converges = ((mVertices[0].mPosition - mVertices[mNumS*(mNumT-2)].mPosition).magVecSquared() < 0.000001f);
BOOL s_top_converges = ((mVertices[mNumS-1].mPosition - mVertices[mNumS*(mNumT-2)+mNumS-1].mPosition).magVecSquared() < 0.000001f);
if (mVolumep->getPath().isOpen() == FALSE) { //wrap normals on T
for (S32 i = 0; i < mNumS; i++) {
LLVector3 norm = mVertices[i].mNormal + mVertices[mNumS*(mNumT-1)+i].mNormal;
mVertices[i].mNormal = norm;
mVertices[mNumS*(mNumT-1)+i].mNormal = norm;
}
}
U8 sculpt_type = mVolumep->getParams().getSculptType();
if ((mVolumep->getProfile().isOpen() == FALSE) &&
!(s_bottom_converges))
if (sculpt_type == LL_SCULPT_TYPE_NONE) // logic for non-sculpt volumes
{
if (mVolumep->getPath().isOpen() == FALSE)
{ //wrap normals on T
for (S32 i = 0; i < mNumS; i++)
{
LLVector3 norm = mVertices[i].mNormal + mVertices[mNumS*(mNumT-1)+i].mNormal;
mVertices[i].mNormal = norm;
mVertices[mNumS*(mNumT-1)+i].mNormal = norm;
}
}
if ((mVolumep->getProfile().isOpen() == FALSE) && !(s_bottom_converges))
{ //wrap normals on S
for (S32 i = 0; i < mNumT; i++) {
for (S32 i = 0; i < mNumT; i++)
{
LLVector3 norm = mVertices[mNumS*i].mNormal + mVertices[mNumS*i+mNumS-1].mNormal;
mVertices[mNumS * i].mNormal = norm;
mVertices[mNumS * i+mNumS-1].mNormal = norm;
}
}
if (mVolumep->getPathType() == LL_PCODE_PATH_CIRCLE &&
((mVolumep->getProfileType() & LL_PCODE_PROFILE_MASK) == LL_PCODE_PROFILE_CIRCLE_HALF))
{
if (s_bottom_converges)
{ //all lower S have same normal
for (S32 i = 0; i < mNumT; i++) {
mVertices[mNumS*i].mNormal = LLVector3(1,0,0);
if (mVolumep->getPathType() == LL_PCODE_PATH_CIRCLE &&
((mVolumep->getProfileType() & LL_PCODE_PROFILE_MASK) == LL_PCODE_PROFILE_CIRCLE_HALF))
{
if (s_bottom_converges)
{ //all lower S have same normal
for (S32 i = 0; i < mNumT; i++)
{
mVertices[mNumS*i].mNormal = LLVector3(1,0,0);
}
}
}
if (s_top_converges)
{ //all upper S have same normal
for (S32 i = 0; i < mNumT; i++) {
mVertices[mNumS*i+mNumS-1].mNormal = LLVector3(-1,0,0);
if (s_top_converges)
{ //all upper S have same normal
for (S32 i = 0; i < mNumT; i++)
{
mVertices[mNumS*i+mNumS-1].mNormal = LLVector3(-1,0,0);
}
}
}
}
U8 sculpt_type = mVolumep->getParams().getSculptType();
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
else // logic for sculpt volumes
{
// average normals for north pole
BOOL average_poles = FALSE;
BOOL wrap_s = FALSE;
BOOL wrap_t = FALSE;
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
average_poles = TRUE;
if ((sculpt_type == LL_SCULPT_TYPE_SPHERE) ||
(sculpt_type == LL_SCULPT_TYPE_TORUS) ||
(sculpt_type == LL_SCULPT_TYPE_CYLINDER))
wrap_s = TRUE;
if (sculpt_type == LL_SCULPT_TYPE_TORUS)
wrap_t = TRUE;
LLVector3 average(0.0, 0.0, 0.0);
for (S32 i = 0; i < mNumS; i++)
if (average_poles)
{
average += mVertices[i].mNormal;
}
// set average
for (S32 i = 0; i < mNumS; i++)
{
mVertices[i].mNormal = average;
}
}
if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
{
// average normals for south pole
// average normals for north pole
LLVector3 average(0.0, 0.0, 0.0);
for (S32 i = 0; i < mNumS; i++)
{
average += mVertices[i + mNumS * (mNumT - 1)].mNormal;
LLVector3 average(0.0, 0.0, 0.0);
for (S32 i = 0; i < mNumS; i++)
{
average += mVertices[i].mNormal;
}
// set average
for (S32 i = 0; i < mNumS; i++)
{
mVertices[i].mNormal = average;
}
// average normals for south pole
average = LLVector3(0.0, 0.0, 0.0);
for (S32 i = 0; i < mNumS; i++)
{
average += mVertices[i + mNumS * (mNumT - 1)].mNormal;
}
// set average
for (S32 i = 0; i < mNumS; i++)
{
mVertices[i + mNumS * (mNumT - 1)].mNormal = average;
}
}
// set average
for (S32 i = 0; i < mNumS; i++)
if (wrap_s)
{
mVertices[i + mNumS * (mNumT - 1)].mNormal = average;
for (S32 i = 0; i < mNumT; i++)
{
LLVector3 norm = mVertices[mNumS*i].mNormal + mVertices[mNumS*i+mNumS-1].mNormal;
mVertices[mNumS * i].mNormal = norm;
mVertices[mNumS * i+mNumS-1].mNormal = norm;
}
}
if (wrap_t)
{
for (S32 i = 0; i < mNumS; i++)
{
LLVector3 norm = mVertices[i].mNormal + mVertices[mNumS*(mNumT-1)+i].mNormal;
mVertices[i].mNormal = norm;
mVertices[mNumS*(mNumT-1)+i].mNormal = norm;
}
}
}
//normalize normals and binormals here so the meshes that reference
//this volume data don't have to
for (U32 i = 0; i < mVertices.size(); i++)

View File

@ -154,7 +154,7 @@ const LLFaceID LL_FACE_OUTER_SIDE_3 = 0x1 << 8;
const U8 LL_SCULPT_TYPE_NONE = 0;
const U8 LL_SCULPT_TYPE_SPHERE = 1;
const U8 LL_SCULPT_TYPE_TORUS = 2;
const U8 LL_SCULPT_TYPE_PLAIN = 3;
const U8 LL_SCULPT_TYPE_PLANE = 3;
const U8 LL_SCULPT_TYPE_CYLINDER = 4;
@ -840,9 +840,6 @@ public:
BOOL isUnique() const { return mUnique; }
S32 getSculptLevel() const { return mSculptLevel; }
void setSculptLevel(S32 level) { mSculptLevel = level; }
U8 getSculptType() const { return mSculptType; }
S32 *getTriangleIndices(U32 &num_indices) const;
void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, std::vector<S32> &segments, const LLVector3& view_vec,
@ -888,7 +885,6 @@ protected:
BOOL mUnique;
F32 mDetail;
S32 mSculptLevel;
U8 mSculptType;
LLVolumeParams mParams;
LLPath *mPathp;

View File

@ -90,4 +90,4 @@ void LLColor3::calcHSL(F32* hue, F32* saturation, F32* luminance) const
if (hue) *hue = H;
if (saturation) *saturation = S;
if (luminance) *luminance = L;
}
}

View File

@ -1,5 +1,5 @@
/**
* @file llblowcipher.cpp
* @file llblowfishcipher.cpp
* @brief Wrapper around OpenSSL Blowfish encryption algorithm.
*
* We do not have OpenSSL headers or libraries on Windows, so this
@ -65,33 +65,33 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
<< " iv_len " << iv_length
<< llendl;
int output_len = 0;
int temp_len = 0;
if (!EVP_EncryptUpdate(&context,
dst,
&output_len,
src,
src_len))
{
llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl;
goto ERROR;
}
// There may be some final data left to encrypt if the input is
// not an exact multiple of the block size.
if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len))
{
llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl;
goto ERROR;
}
output_len += temp_len;
EVP_CIPHER_CTX_cleanup(&context);
return output_len;
ERROR:
EVP_CIPHER_CTX_cleanup(&context);
return 0;
int output_len = 0;
int temp_len = 0;
if (!EVP_EncryptUpdate(&context,
dst,
&output_len,
src,
src_len))
{
llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl;
goto ERROR;
}
// There may be some final data left to encrypt if the input is
// not an exact multiple of the block size.
if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len))
{
llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl;
goto ERROR;
}
output_len += temp_len;
EVP_CIPHER_CTX_cleanup(&context);
return output_len;
ERROR:
EVP_CIPHER_CTX_cleanup(&context);
return 0;
}
// virtual

View File

@ -46,132 +46,130 @@ LLCacheName* gCacheName = NULL;
/// class LLCacheNameEntry
/// ---------------------------------------------------------------------------
namespace {
class LLCacheNameEntry
{
public:
LLCacheNameEntry();
class LLCacheNameEntry
{
public:
LLCacheNameEntry();
public:
bool mIsGroup;
U32 mCreateTime; // unix time_t
char mFirstName[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
char mLastName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
char mGroupName[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
};
public:
bool mIsGroup;
U32 mCreateTime; // unix time_t
char mFirstName[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
char mLastName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
char mGroupName[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
};
LLCacheNameEntry::LLCacheNameEntry()
{
mFirstName[0] = '\0';
mLastName[0] = '\0';
mGroupName[0] = '\0';
}
LLCacheNameEntry::LLCacheNameEntry()
{
mFirstName[0] = '\0';
mLastName[0] = '\0';
mGroupName[0] = '\0';
}
class PendingReply
{
public:
LLUUID mID;
LLCacheNameCallback mCallback;
LLHost mHost;
void* mData;
PendingReply(const LLUUID& id, LLCacheNameCallback callback, void* data = NULL)
: mID(id), mCallback(callback), mData(data)
{ }
PendingReply(const LLUUID& id, const LLHost& host)
: mID(id), mCallback(0), mHost(host)
{ }
void done() { mID.setNull(); }
bool isDone() const { return mID.isNull() != FALSE; }
};
class ReplySender
{
public:
ReplySender(LLMessageSystem* msg);
~ReplySender();
void send(const LLUUID& id,
const LLCacheNameEntry& entry, const LLHost& host);
private:
void flush();
LLMessageSystem* mMsg;
bool mPending;
bool mCurrIsGroup;
LLHost mCurrHost;
};
ReplySender::ReplySender(LLMessageSystem* msg)
: mMsg(msg), mPending(false)
class PendingReply
{
public:
LLUUID mID;
LLCacheNameCallback mCallback;
LLHost mHost;
void* mData;
PendingReply(const LLUUID& id, LLCacheNameCallback callback, void* data = NULL)
: mID(id), mCallback(callback), mData(data)
{ }
ReplySender::~ReplySender()
PendingReply(const LLUUID& id, const LLHost& host)
: mID(id), mCallback(0), mHost(host)
{ }
void done() { mID.setNull(); }
bool isDone() const { return mID.isNull() != FALSE; }
};
class ReplySender
{
public:
ReplySender(LLMessageSystem* msg);
~ReplySender();
void send(const LLUUID& id,
const LLCacheNameEntry& entry, const LLHost& host);
private:
void flush();
LLMessageSystem* mMsg;
bool mPending;
bool mCurrIsGroup;
LLHost mCurrHost;
};
ReplySender::ReplySender(LLMessageSystem* msg)
: mMsg(msg), mPending(false)
{ }
ReplySender::~ReplySender()
{
flush();
}
void ReplySender::send(const LLUUID& id,
const LLCacheNameEntry& entry, const LLHost& host)
{
if (mPending)
{
flush();
}
void ReplySender::send(const LLUUID& id,
const LLCacheNameEntry& entry, const LLHost& host)
{
if (mPending)
{
if (mCurrIsGroup != entry.mIsGroup
|| mCurrHost != host)
{
flush();
}
}
if (!mPending)
{
mPending = true;
mCurrIsGroup = entry.mIsGroup;
mCurrHost = host;
if(mCurrIsGroup)
mMsg->newMessageFast(_PREHASH_UUIDGroupNameReply);
else
mMsg->newMessageFast(_PREHASH_UUIDNameReply);
}
mMsg->nextBlockFast(_PREHASH_UUIDNameBlock);
mMsg->addUUIDFast(_PREHASH_ID, id);
if(mCurrIsGroup)
{
mMsg->addStringFast(_PREHASH_GroupName, entry.mGroupName);
}
else
{
mMsg->addStringFast(_PREHASH_FirstName, entry.mFirstName);
mMsg->addStringFast(_PREHASH_LastName, entry.mLastName);
}
if(mMsg->isSendFullFast(_PREHASH_UUIDNameBlock))
if (mCurrIsGroup != entry.mIsGroup
|| mCurrHost != host)
{
flush();
}
}
void ReplySender::flush()
if (!mPending)
{
if (mPending)
{
mMsg->sendReliable(mCurrHost);
mPending = false;
}
mPending = true;
mCurrIsGroup = entry.mIsGroup;
mCurrHost = host;
if(mCurrIsGroup)
mMsg->newMessageFast(_PREHASH_UUIDGroupNameReply);
else
mMsg->newMessageFast(_PREHASH_UUIDNameReply);
}
mMsg->nextBlockFast(_PREHASH_UUIDNameBlock);
mMsg->addUUIDFast(_PREHASH_ID, id);
if(mCurrIsGroup)
{
mMsg->addStringFast(_PREHASH_GroupName, entry.mGroupName);
}
else
{
mMsg->addStringFast(_PREHASH_FirstName, entry.mFirstName);
mMsg->addStringFast(_PREHASH_LastName, entry.mLastName);
}
typedef std::set<LLUUID> AskQueue;
typedef std::vector<PendingReply> ReplyQueue;
typedef std::map<LLUUID,U32> PendingQueue;
typedef std::map<LLUUID, LLCacheNameEntry*> Cache;
typedef std::vector<LLCacheNameCallback> Observers;
};
if(mMsg->isSendFullFast(_PREHASH_UUIDNameBlock))
{
flush();
}
}
void ReplySender::flush()
{
if (mPending)
{
mMsg->sendReliable(mCurrHost);
mPending = false;
}
}
typedef std::set<LLUUID> AskQueue;
typedef std::vector<PendingReply> ReplyQueue;
typedef std::map<LLUUID,U32> PendingQueue;
typedef std::map<LLUUID, LLCacheNameEntry*> Cache;
typedef std::vector<LLCacheNameCallback> Observers;
class LLCacheName::Impl
{

View File

@ -8,6 +8,8 @@
* $License$
*/
#include "linden_common.h"
#include "llcurl.h"
#include <iomanip>

View File

@ -819,11 +819,12 @@ void LLHTTPAssetStorage::checkForTimeouts()
if (curl_msg && curl_msg->msg == CURLMSG_DONE)
{
long curl_result = 0;
S32 xfer_result = 0;
S32 xfer_result = LL_ERR_NOERR;
LLHTTPAssetRequest *req = NULL;
curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_PRIVATE, &req);
// TODO: Throw curl_result at all callbacks.
curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_HTTP_CODE, &curl_result);
if (RT_UPLOAD == req->mRequestType || RT_LOCALUPLOAD == req->mRequestType)
{

View File

@ -9,7 +9,7 @@
#include "linden_common.h"
#include "llhttpnode.h"
#include "boost/tokenizer.hpp"
#include <boost/tokenizer.hpp>
#include "llstl.h"

View File

@ -29,7 +29,7 @@
#include <sstream>
#include "boost/tokenizer.hpp"
#include <boost/tokenizer.hpp>
static const char HTTP_VERSION_STR[] = "HTTP/1.0";
static const std::string CONTEXT_REQUEST("request");

View File

@ -421,6 +421,8 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl(
#if LL_WINDOWS
if (status == 730035)
break;
#else
(void) status;
#endif
mLastWritten = segment.data() + len - 1;

View File

@ -6,6 +6,8 @@
* $License$
*/
#include "linden_common.h"
#include "llhash.h"
#include "llmessagethrottle.h"

View File

@ -6,6 +6,7 @@
* $License$
*/
#include "linden_common.h"
#include "llapp.h"
#include "llfile.h"
#include "llservicebuilder.h"

View File

@ -594,7 +594,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
tsize = tsizeh;
break;
case 4:
htonmemcpy(&tsizeb, &buffer[decode_pos], MVT_U32, 4);
htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4);
break;
default:
llerrs << "Attempting to read variable field with unknown size of " << data_size << llendl;

View File

@ -1321,7 +1321,7 @@ LLMessageSystem::~LLMessageSystem()
if (!mbError)
{
end_net();
end_net(mSocket);
}
delete mTemplateMessageReader;
@ -1335,6 +1335,9 @@ LLMessageSystem::~LLMessageSystem()
delete mLLSDMessageReader;
mLLSDMessageReader = NULL;
delete mLLSDMessageBuilder;
mLLSDMessageBuilder = NULL;
delete mPollInfop;
mPollInfop = NULL;
@ -4144,11 +4147,13 @@ void LLMessageSystem::dumpPacketToLog()
char line_buffer[256]; /* Flawfinder: ignore */
S32 i;
S32 cur_line_pos = 0;
S32 cur_line = 0;
for (i = 0; i < mTrueReceiveSize; i++)
{
snprintf(line_buffer + cur_line_pos*3, sizeof(line_buffer),"%02x ", mTrueReceiveBuffer[i]); /* Flawfinder: ignore */
S32 offset = cur_line_pos * 3;
snprintf(line_buffer + offset, sizeof(line_buffer) - offset,
"%02x ", mTrueReceiveBuffer[i]); /* Flawfinder: ignore */
cur_line_pos++;
if (cur_line_pos >= 16)
{
@ -4325,11 +4330,6 @@ std::string get_shared_secret()
typedef std::map<const char*, LLMessageBuilder*> BuilderMap;
static void setBuilder(BuilderMap& map, const char* name, LLMessageBuilder* builder)
{
map[gMessageStringTable.getString(name)] = builder;
}
void LLMessageSystem::newMessageFast(const char *name)
{
if(LLMessageConfig::isMessageBuiltTemplate(name))

View File

@ -269,8 +269,12 @@ S32 start_net(S32& socket_out, int& nPort)
return 0;
}
void end_net()
void end_net(S32& socket_out)
{
if (socket_out < 0)
{
closesocket(socket_out);
}
WSACleanup();
}
@ -437,8 +441,12 @@ S32 start_net(S32& socket_out, int& nPort)
return 0;
}
void end_net()
void end_net(S32& socket_out)
{
if (socket_out < 0)
{
close(socket_out);
}
}
int receive_packet(int hSocket, char * receiveBuffer)

View File

@ -20,7 +20,7 @@ class LLHost;
// Returns 0 on success, non-zero on error.
// Sets socket handler/descriptor, changes nPort if port requested is unavailable.
S32 start_net(S32& socket_out, int& nPort);
void end_net();
void end_net(S32& socket_out);
// returns size of packet or -1 in case of error
S32 receive_packet(int hSocket, char * receiveBuffer);

View File

@ -144,56 +144,6 @@ void LLVertexBuffer::clientCopy(F64 max_time)
//----------------------------------------------------------------------------
// For debugging
struct VTNC /// Simple
{
F32 v1,v2,v3;
F32 n1,n2,n3;
F32 t1,t2;
U32 c;
};
static VTNC dbg_vtnc;
struct VTUNCB // Simple + Bump
{
F32 v1,v2,v3;
F32 n1,n2,n3;
F32 t1,t2;
F32 u1,u2;
F32 b1,b2,b3;
U32 c;
};
static VTUNCB dbg_vtuncb;
struct VTUNC // Surfacepatch
{
F32 v1,v2,v3;
F32 n1,n2,n3;
F32 t1,t2;
F32 u1,u2;
U32 c;
};
static VTUNC dbg_vtunc;
struct VTNW /// Avatar
{
F32 v1,v2,v3;
F32 n1,n2,n3;
F32 t1,t2;
F32 w;
};
static VTNW dbg_vtnw;
struct VTNPAD /// Avatar Output
{
F32 v1,v2,v3,p1;
F32 n1,n2,n3,p2;
F32 t1,t2,p3,p4;
};
static VTNPAD dbg_vtnpad;
//----------------------------------------------------------------------------
LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
LLRefCount(),
mNumVerts(0), mNumIndices(0), mUsage(usage), mGLBuffer(0), mGLIndices(0),

View File

@ -46,8 +46,8 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString
mAllowTextEntry(FALSE),
mMaxChars(20),
mTextEntryTentative(TRUE),
mPrearrangeCallback( NULL ),
mListPosition(BELOW),
mPrearrangeCallback( NULL ),
mTextEntryCallback( NULL )
{
// For now, all comboboxes don't take keyboard focus when clicked.

View File

@ -5,6 +5,7 @@
* Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#include "linden_common.h"
#include "llctrlselectioninterface.h"

View File

@ -6,7 +6,7 @@
* $License$
*/
#include "stdtypes.h"
#include "linden_common.h"
#include "lleditmenuhandler.h"

View File

@ -200,6 +200,9 @@ LLString LLLineEditor::getWidgetTag() const
void LLLineEditor::onFocusLost()
{
// Need to notify early when loosing focus.
getWindow()->allowLanguageTextInput(FALSE);
LLUICtrl::onFocusLost();
if( mCommitOnFocusLost && mText.getString() != mPrevText)
@ -1110,7 +1113,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
// handle ctrl-uparrow if we have a history enabled line editor.
case KEY_UP:
if( mHaveHistory && ( MASK_CONTROL & mask ) )
if( mHaveHistory && ( MASK_CONTROL == mask ) )
{
if( mCurrentHistoryLine > 0 )
{
@ -1127,7 +1130,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
// handle ctrl-downarrow if we have a history enabled line editor
case KEY_DOWN:
if( mHaveHistory && ( MASK_CONTROL & mask ) )
if( mHaveHistory && ( MASK_CONTROL == mask ) )
{
if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 )
{
@ -1626,6 +1629,12 @@ void LLLineEditor::setFocus( BOOL new_state )
{
BOOL old_state = hasFocus();
if (!new_state)
{
getWindow()->allowLanguageTextInput(FALSE);
}
// getting focus when we didn't have it before, and we want to select all
if (!old_state && new_state && mSelectAllonFocusReceived)
{
@ -1656,6 +1665,16 @@ void LLLineEditor::setFocus( BOOL new_state )
}
LLUICtrl::setFocus( new_state );
if (new_state)
{
// Allow Language Text Input only when this LineEditor has
// no prevalidate function attached. This criterion works
// fine on 1.15.0.2, since all prevalidate func reject any
// non-ASCII characters. I'm not sure on future versions,
// however.
getWindow()->allowLanguageTextInput(mPrevalidateFunc == NULL);
}
}
//virtual

View File

@ -272,7 +272,26 @@ BOOL LLScrollableContainerView::handleScrollWheel( S32 x, S32 y, S32 clicks )
// Opaque
return TRUE;
}
BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContainerView::SCROLL_ORIENTATION axis)
{
if(mScrollbar[axis]->getVisible())
{
LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 );
const S32 AUTOSCROLL_SIZE = 10;
if(mScrollbar[axis]->getVisible())
{
inner_rect_local.mRight -= SCROLLBAR_SIZE;
inner_rect_local.mTop += AUTOSCROLL_SIZE;
inner_rect_local.mBottom = inner_rect_local.mTop - AUTOSCROLL_SIZE;
}
if( inner_rect_local.pointInRect( x, y ) && (mScrollbar[axis]->getDocPos() > 0) )
{
return TRUE;
}
}
return FALSE;
}
BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop,
EDragAndDropType cargo_type,

View File

@ -15,6 +15,7 @@
#endif
#include "stdenums.h"
#include "llcoord.h"
#include "llscrollbar.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLScrollableContainerView
@ -27,7 +28,6 @@
// This class is a decorator class.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLScrollbar;
class LLViewBorder;
class LLUICtrlFactory;
@ -35,6 +35,10 @@ class LLUICtrlFactory;
class LLScrollableContainerView : public LLUICtrl
{
public:
// Note: vertical comes before horizontal because vertical
// scrollbars have priority for mouse and keyboard events.
enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT };
LLScrollableContainerView( const LLString& name, const LLRect& rect,
LLView* scrolled_view, BOOL is_opaque = FALSE,
const LLColor4& bg_color = LLColor4(0,0,0,0) );
@ -68,6 +72,8 @@ public:
void goToBottom();
S32 getBorderWidth();
BOOL needsToScroll(S32 x, S32 y, SCROLL_ORIENTATION axis);
// LLView functionality
virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
@ -90,10 +96,6 @@ protected:
virtual void scrollVertical( S32 new_pos );
void updateScroll();
// Note: vertical comes before horizontal because vertical
// scrollbars have priority for mouse and keyboard events.
enum { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT };
LLScrollbar* mScrollbar[SCROLLBAR_COUNT];
LLView* mScrolledView;
S32 mSize;

View File

@ -78,8 +78,10 @@ protected:
//
// LLScrollListIcon
//
LLScrollListIcon::LLScrollListIcon(LLImageGL* icon, S32 width, LLUUID image_id) :
mIcon(icon), mColor(LLColor4::white), mImageUUID(image_id.asString())
LLScrollListIcon::LLScrollListIcon(LLImageGL* icon, S32 width, LLUUID image_id)
: mIcon(icon),
mImageUUID(image_id.asString()),
mColor(LLColor4::white)
{
if (width)
{
@ -411,21 +413,20 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect,
mFgUnselectedColor( LLUI::sColorsGroup->getColor("ScrollUnselectedColor") ),
mFgDisabledColor( LLUI::sColorsGroup->getColor("ScrollDisabledColor") ),
mHighlightedColor( LLUI::sColorsGroup->getColor("ScrollHighlightedColor") ),
mHighlightedItem(-1),
mBorderThickness( 2 ),
mOnDoubleClickCallback( NULL ),
mOnMaximumSelectCallback( NULL ),
mOnSortChangedCallback( NULL ),
mDrewSelected(FALSE),
mHighlightedItem(-1),
mBorder(NULL),
mSearchColumn(0),
mDefaultColumn("SIMPLE"),
mSearchColumn(0),
mNumDynamicWidthColumns(0),
mTotalStaticColumnWidth(0),
mSortColumn(-1),
mSortAscending(TRUE),
mSorted(TRUE),
mSortAscending(TRUE)
mDrewSelected(FALSE)
{
mItemListRect.setOriginAndSize(
mBorderThickness + LIST_BORDER_PAD,

View File

@ -308,7 +308,7 @@ public:
S32 getNumColumns() const { return mColumns.size(); }
LLScrollListCell *getColumn(const S32 i) const { if (i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; }
LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; }
virtual BOOL handleClick(S32 x, S32 y, MASK mask);

View File

@ -31,6 +31,7 @@
#include "llglheaders.h"
const F32 SCROLL_STEP_TIME = 0.4f;
const F32 SCROLL_DELAY_TIME = 0.5f;
const S32 TAB_PADDING = 15;
const S32 TABCNTR_TAB_MIN_WIDTH = 60;
const S32 TABCNTR_TAB_MAX_WIDTH = 150;
@ -61,6 +62,7 @@ LLTabContainerCommon::LLTabContainerCommon(
mLockedTabCount(0)
{
setMouseOpaque(FALSE);
mDragAndDropDelayTimer.stop();
}
@ -81,9 +83,11 @@ LLTabContainerCommon::LLTabContainerCommon(
mCallbackUserdata( callback_userdata ),
mTitleBox(NULL),
mTopBorderHeight(LLPANEL_BORDER_WIDTH),
mTabPosition(pos)
mTabPosition(pos),
mLockedTabCount(0)
{
setMouseOpaque(FALSE);
mDragAndDropDelayTimer.stop();
}
@ -711,8 +715,8 @@ LLTabContainer::LLTabContainer(
:
LLTabContainerCommon(name, rect, pos, close_callback, callback_userdata, bordered),
mLeftArrowBtn(NULL),
mRightArrowBtn(NULL),
mJumpLeftArrowBtn(NULL),
mRightArrowBtn(NULL),
mJumpRightArrowBtn(NULL),
mRightTabBtnOffset(0),
mMinTabWidth(TABCNTR_TAB_MIN_WIDTH),
@ -729,8 +733,8 @@ LLTabContainer::LLTabContainer(
:
LLTabContainerCommon(name, rect_control, pos, close_callback, callback_userdata, bordered),
mLeftArrowBtn(NULL),
mRightArrowBtn(NULL),
mJumpLeftArrowBtn(NULL),
mRightArrowBtn(NULL),
mJumpRightArrowBtn(NULL),
mRightTabBtnOffset(0),
mMinTabWidth(TABCNTR_TAB_MIN_WIDTH),
@ -1556,43 +1560,48 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag
{
BOOL has_scroll_arrows = (mMaxScrollPos > 0);
if (has_scroll_arrows)
if( mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME )
{
if (mJumpLeftArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mJumpLeftArrowBtn->getRect().mLeft;
S32 local_y = y - mJumpLeftArrowBtn->getRect().mBottom;
mJumpLeftArrowBtn->handleHover(local_x, local_y, mask);
}
if (mJumpRightArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mJumpRightArrowBtn->getRect().mLeft;
S32 local_y = y - mJumpRightArrowBtn->getRect().mBottom;
mJumpRightArrowBtn->handleHover(local_x, local_y, mask);
}
if (mLeftArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mLeftArrowBtn->getRect().mLeft;
S32 local_y = y - mLeftArrowBtn->getRect().mBottom;
mLeftArrowBtn->handleHover(local_x, local_y, mask);
}
else if (mRightArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mRightArrowBtn->getRect().mLeft;
S32 local_y = y - mRightArrowBtn->getRect().mBottom;
mRightArrowBtn->handleHover(local_x, local_y, mask);
}
}
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
{
LLTabTuple* tuple = *iter;
tuple->mButton->setVisible( TRUE );
S32 local_x = x - tuple->mButton->getRect().mLeft;
S32 local_y = y - tuple->mButton->getRect().mBottom;
if (tuple->mButton->pointInView(local_x, local_y) && tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible())
if (has_scroll_arrows)
{
tuple->mButton->onCommit();
if (mJumpLeftArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mJumpLeftArrowBtn->getRect().mLeft;
S32 local_y = y - mJumpLeftArrowBtn->getRect().mBottom;
mJumpLeftArrowBtn->handleHover(local_x, local_y, mask);
}
if (mJumpRightArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mJumpRightArrowBtn->getRect().mLeft;
S32 local_y = y - mJumpRightArrowBtn->getRect().mBottom;
mJumpRightArrowBtn->handleHover(local_x, local_y, mask);
}
if (mLeftArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mLeftArrowBtn->getRect().mLeft;
S32 local_y = y - mLeftArrowBtn->getRect().mBottom;
mLeftArrowBtn->handleHover(local_x, local_y, mask);
}
else if (mRightArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mRightArrowBtn->getRect().mLeft;
S32 local_y = y - mRightArrowBtn->getRect().mBottom;
mRightArrowBtn->handleHover(local_x, local_y, mask);
}
}
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
{
LLTabTuple* tuple = *iter;
tuple->mButton->setVisible( TRUE );
S32 local_x = x - tuple->mButton->getRect().mLeft;
S32 local_y = y - tuple->mButton->getRect().mBottom;
if (tuple->mButton->pointInView(local_x, local_y) && tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible())
{
tuple->mButton->onCommit();
mDragAndDropDelayTimer.stop();
}
}
}
@ -1621,4 +1630,4 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name)
// tabs have changed size, might need to scroll to see current tab
updateMaxScrollPos();
}
}
}

View File

@ -97,7 +97,9 @@ public:
virtual void setTabImage(LLPanel* child, std::string img_name);
void setTitle( const LLString& title );
const LLString getPanelTitle(S32 index);
void setDragAndDropDelayTimer() { mDragAndDropDelayTimer.start(); }
virtual void setTopBorderHeight(S32 height);
virtual void setTabChangeCallback(LLPanel* tab, void (*on_tab_clicked)(void*,bool));
@ -155,6 +157,8 @@ protected:
S32 mScrollPosPixels;
S32 mMaxScrollPos;
LLFrameTimer mDragAndDropDelayTimer;
void (*mCloseCallback)(void*);
void* mCallbackUserdata;

View File

@ -26,6 +26,7 @@
#include "llclipboard.h"
#include "llscrollbar.h"
#include "llstl.h"
#include "llstring.h"
#include "llkeyboard.h"
#include "llkeywords.h"
#include "llundo.h"
@ -494,8 +495,10 @@ void LLTextEditor::truncate()
void LLTextEditor::setText(const LLString &utf8str)
{
mUTF8Text = utf8str;
mWText = utf8str_to_wstring(utf8str);
// LLString::removeCRLF(utf8str);
mUTF8Text = utf8str_removeCRLF(utf8str);
// mUTF8Text = utf8str;
mWText = utf8str_to_wstring(mUTF8Text);
mTextIsUpToDate = TRUE;
truncate();
@ -2471,6 +2474,8 @@ void LLTextEditor::redo()
// virtual, from LLView
void LLTextEditor::onFocusLost()
{
getWindow()->allowLanguageTextInput(FALSE);
// Route menu back to the default
if( gEditMenuHandler == this )
{
@ -3037,6 +3042,12 @@ void LLTextEditor::setFocus( BOOL new_state )
// Don't change anything if the focus state didn't change
if (new_state == old_state) return;
// Notify early if we are loosing focus.
if (!new_state)
{
getWindow()->allowLanguageTextInput(FALSE);
}
LLUICtrl::setFocus( new_state );
if( new_state )
@ -3057,6 +3068,12 @@ void LLTextEditor::setFocus( BOOL new_state )
endSelection();
}
// Notify late if we are gaining focus.
if (new_state && !mReadOnly)
{
getWindow()->allowLanguageTextInput(TRUE);
}
}
BOOL LLTextEditor::acceptsTextInput() const

View File

@ -6,6 +6,8 @@
* $License$
*/
#include "linden_common.h"
#include "llview.h"
#include "lluictrl.h"
#include "llviewquery.h"

View File

@ -484,7 +484,7 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
}
// Figure out where the last block ended.
U32 loc = last_file_block->mLocation+last_file_block->mLength;
S32 loc = last_file_block->mLocation+last_file_block->mLength;
// Figure out how much space there is between where
// the last block ended and this block begins.
@ -492,7 +492,7 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
// Check for more errors... Seeing if the current
// entry and the last entry make sense together.
if (length < 0 || loc < 0 || loc > data_size)
if (length < 0 || loc < 0 || (U32)loc > data_size)
{
// Invalid VFS
unlockAndClose( mIndexFP );
@ -1770,53 +1770,46 @@ void LLVFS::audit()
delete[] buffer;
if (vfs_corrupt)
if (!vfs_corrupt)
{
for (std::vector<LLVFSFileBlock*>::iterator iter = audit_blocks.begin();
iter != audit_blocks.end(); ++iter)
for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it)
{
delete *iter;
}
audit_blocks.clear();
return;
}
for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it)
{
LLVFSFileBlock* block = (*it).second;
LLVFSFileBlock* block = (*it).second;
if (block->mSize > 0)
{
if (! found_files.count(*block))
if (block->mSize > 0)
{
llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " in memory, not on disk, loc " << block->mIndexLocation<< llendl;
fseek(mIndexFP, block->mIndexLocation, SEEK_SET);
U8 buf[LLVFSFileBlock::SERIAL_SIZE];
fread(buf, LLVFSFileBlock::SERIAL_SIZE, 1, mIndexFP);
if (! found_files.count(*block))
{
llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " in memory, not on disk, loc " << block->mIndexLocation<< llendl;
fseek(mIndexFP, block->mIndexLocation, SEEK_SET);
U8 buf[LLVFSFileBlock::SERIAL_SIZE];
fread(buf, LLVFSFileBlock::SERIAL_SIZE, 1, mIndexFP);
LLVFSFileBlock disk_block;
disk_block.deserialize(buf, block->mIndexLocation);
LLVFSFileBlock disk_block;
disk_block.deserialize(buf, block->mIndexLocation);
llwarns << "Instead found " << disk_block.mFileID << ":" << block->mFileType << llendl;
}
else
{
block = found_files.find(*block)->second;
found_files.erase(*block);
delete block;
llwarns << "Instead found " << disk_block.mFileID << ":" << block->mFileType << llendl;
}
else
{
block = found_files.find(*block)->second;
found_files.erase(*block);
}
}
}
}
for (std::map<LLVFSFileSpecifier, LLVFSFileBlock*>::iterator iter = found_files.begin();
iter != found_files.end(); iter++)
{
LLVFSFileBlock* block = iter->second;
llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " szie:" << block->mSize << " leftover" << llendl;
}
for (std::map<LLVFSFileSpecifier, LLVFSFileBlock*>::iterator iter = found_files.begin();
iter != found_files.end(); iter++)
{
LLVFSFileBlock* block = iter->second;
llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " szie:" << block->mSize << " leftover" << llendl;
}
llinfos << "VFS: audit OK" << llendl;
// mutex released by LLMutexLock() destructor.
llinfos << "VFS: audit OK" << llendl;
// mutex released by LLMutexLock() destructor.
}
for_each(audit_blocks.begin(), audit_blocks.end(), DeletePointer());
}

View File

@ -221,7 +221,8 @@ LLWindow::LLWindow(BOOL fullscreen, U32 flags)
mIsMouseClipping(FALSE),
mSwapMethod(SWAP_METHOD_UNDEFINED),
mHideCursorPermanent(FALSE),
mFlags(flags)
mFlags(flags),
mHighSurrogate(0)
{
for (U32 i = 0; i < 6; i++)
{
@ -276,6 +277,53 @@ void LLWindow::setCallbacks(LLWindowCallbacks *callbacks)
}
}
#define UTF16_IS_HIGH_SURROGATE(U) ((U16)((U) - 0xD800) < 0x0400)
#define UTF16_IS_LOW_SURROGATE(U) ((U16)((U) - 0xDC00) < 0x0400)
#define UTF16_SURROGATE_PAIR_TO_UTF32(H,L) (((H) << 10) + (L) - (0xD800 << 10) - 0xDC00 + 0x00010000)
void LLWindow::handleUnicodeUTF16(U16 utf16, MASK mask)
{
// Note that we could discard unpaired surrogates, but I'm
// following the Unicode Consortium's recommendation here;
// that is, to preserve those unpaired surrogates in UTF-32
// values. _To_preserve_ means to pass to the callback in our
// context.
if (mHighSurrogate == 0)
{
if (UTF16_IS_HIGH_SURROGATE(utf16))
{
mHighSurrogate = utf16;
}
else
{
mCallbacks->handleUnicodeChar(utf16, mask);
}
}
else
{
if (UTF16_IS_LOW_SURROGATE(utf16))
{
/* A legal surrogate pair. */
mCallbacks->handleUnicodeChar(UTF16_SURROGATE_PAIR_TO_UTF32(mHighSurrogate, utf16), mask);
mHighSurrogate = 0;
}
else if (UTF16_IS_HIGH_SURROGATE(utf16))
{
/* Two consecutive high surrogates. */
mCallbacks->handleUnicodeChar(mHighSurrogate, mask);
mHighSurrogate = utf16;
}
else
{
/* A non-low-surrogate preceeded by a high surrogate. */
mCallbacks->handleUnicodeChar(mHighSurrogate, mask);
mHighSurrogate = 0;
mCallbacks->handleUnicodeChar(utf16, mask);
}
}
}
//
// LLSplashScreen
//

View File

@ -198,6 +198,10 @@ public:
// return a platform-specific window reference (HWND on Windows, WindowRef on the Mac)
virtual void *getPlatformWindow() = 0;
// control platform's Language Text Input mechanisms.
virtual void allowLanguageTextInput( BOOL b ) {};
virtual void setLanguageTextInput( LLCoordWindow pos ) {};
protected:
LLWindow(BOOL fullscreen, U32 flags);
virtual ~LLWindow() {}
@ -226,6 +230,15 @@ protected:
U32 mFlags;
F32 mJoyAxis[6];
U8 mJoyButtonState[16];
U16 mHighSurrogate;
// Handle a UTF-16 encoding unit received from keyboard.
// Converting the series of UTF-16 encoding units to UTF-32 data,
// this method passes the resulting UTF-32 data to mCallback's
// handleUnicodeChar. The mask should be that to be passed to the
// callback. This method uses mHighSurrogate as a dedicated work
// variable.
void handleUnicodeUTF16(U16 utf16, MASK mask);
friend class LLWindowManager;
};

View File

@ -219,6 +219,10 @@ LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width,
mNeedsResize = FALSE;
mOverrideAspectRatio = 0.f;
mMinimized = FALSE;
mTSMDocument = NULL; // Just in case.
mLanguageTextInputAllowed = FALSE;
mTSMScriptCode = 0;
mTSMLangCode = 0;
// For reasons that aren't clear to me, LLTimers seem to be created in the "started" state.
// Since the started state of this one is used to track whether the NMRec has been installed, it wants to start out in the "stopped" state.
@ -459,6 +463,29 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
}
{
// Create and initialize our TSM document for language text input.
// If an error occured, we can do nothing better than simply ignore it.
// mTSMDocument will be kept NULL in case.
if (mTSMDocument)
{
DeactivateTSMDocument(mTSMDocument);
DeleteTSMDocument(mTSMDocument);
mTSMDocument = NULL;
}
static InterfaceTypeList types = { kUnicodeDocument };
OSErr err = NewTSMDocument(1, types, &mTSMDocument, 0);
if (err != noErr)
{
llwarns << "createContext: couldn't create a TSMDocument (" << err << ")" << llendl;
}
if (mTSMDocument)
{
UseInputWindow(mTSMDocument, TRUE);
ActivateTSMDocument(mTSMDocument);
}
}
if(mContext == NULL)
{
AGLRendererInfo rendererInfo = NULL;
@ -904,6 +931,15 @@ void LLWindowMacOSX::destroyContext()
mWindowHandlerRef = NULL;
}
// Cleanup any TSM document we created.
if(mTSMDocument != NULL)
{
llinfos << "destroyContext: deleting TSM document" << llendl;
DeactivateTSMDocument(mTSMDocument);
DeleteTSMDocument(mTSMDocument);
mTSMDocument = NULL;
}
// Close the window
if(mWindow != NULL)
{
@ -1509,7 +1545,7 @@ void LLWindowMacOSX::flashIcon(F32 seconds)
OSErr err;
mBounceTime = seconds;
memset(&mBounceRec, sizeof(mBounceRec), 0);
memset(&mBounceRec, 0, sizeof(mBounceRec));
mBounceRec.qType = nmType;
mBounceRec.nmMark = 1;
err = NMInstall(&mBounceRec);
@ -2221,6 +2257,10 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
switch(evtKind)
{
case kEventWindowActivated:
if (mTSMDocument)
{
ActivateTSMDocument(mTSMDocument);
}
mCallbacks->handleFocus(this);
break;
case kEventWindowDeactivated:
@ -2932,4 +2972,37 @@ static long getDictLong (CFDictionaryRef refDict, CFStringRef key)
return int_value; // otherwise return the long value
}
void LLWindowMacOSX::allowLanguageTextInput(BOOL b)
{
ScriptLanguageRecord script_language;
if (b == mLanguageTextInputAllowed)
{
return;
}
mLanguageTextInputAllowed = b;
if (b)
{
if (mTSMScriptCode != smRoman)
{
script_language.fScript = mTSMScriptCode;
script_language.fLanguage = mTSMLangCode;
SetTextServiceLanguage(&script_language);
}
}
else
{
GetTextServiceLanguage(&script_language);
mTSMScriptCode = script_language.fScript;
mTSMLangCode = script_language.fLanguage;
if (mTSMScriptCode != smRoman)
{
script_language.fScript = smRoman;
script_language.fLanguage = langEnglish;
SetTextServiceLanguage(&script_language);
}
}
}
#endif // LL_DARWIN

View File

@ -88,6 +88,8 @@ public:
/*virtual*/ void *getPlatformWindow();
/*virtual*/ void bringToFront() {};
/*virtual*/ void allowLanguageTextInput(BOOL b);
protected:
LLWindowMacOSX(
char *title, char *name, int x, int y, int width, int height, U32 flags,
@ -163,6 +165,12 @@ protected:
NMRec mBounceRec;
LLTimer mBounceTimer;
// Imput method management through Text Service Manager.
TSMDocumentID mTSMDocument;
BOOL mLanguageTextInputAllowed;
ScriptCode mTSMScriptCode;
LangCode mTSMLangCode;
friend class LLWindowManager;
};

View File

@ -22,7 +22,9 @@
#include "indra_constants.h"
#if LL_GTK
extern "C" {
# include "gtk/gtk.h"
}
#endif // LL_GTK
#if LL_LINUX
@ -1964,7 +1966,10 @@ void LLWindowSDL::gatherInput()
SDLReallyCaptureInput(TRUE);
if (event.key.keysym.unicode)
mCallbacks->handleUnicodeChar(event.key.keysym.unicode, gKeyboard->currentMask(FALSE));
{
handleUnicodeUTF16(event.key.keysym.unicode,
gKeyboard->currentMask(FALSE));
}
break;
case SDL_KEYUP:

View File

@ -17,6 +17,7 @@
#include <mapi.h>
#include <process.h> // for _spawn
#include <shellapi.h>
#include <Imm.h>
// Require DirectInput version 8
#define DIRECTINPUT_VERSION 0x0800
@ -64,6 +65,98 @@ void show_window_creation_error(const char* title)
//static
BOOL LLWindowWin32::sIsClassRegistered = FALSE;
BOOL LLWindowWin32::sLanguageTextInputAllowed = TRUE; /* XXX */
BOOL LLWindowWin32::sWinIMEOpened = FALSE;
HKL LLWindowWin32::sWinInputLocale;
DWORD LLWindowWin32::sWinIMEConversionMode;
DWORD LLWindowWin32::sWinIMESentenceMode;
// The following class LLWinImm delegates Windows IMM APIs.
// We need this because some language versions of Windows,
// e.g., US version of Windows XP, doesn't install IMM32.DLL
// as a default, and we can't link against imm32.lib statically.
// I believe DLL loading of this type is best suited to do
// in a static initialization of a class. What I'm not sure is
// whether it follows the Linden Conding Standard...
// See http://wiki.secondlife.com/wiki/Coding_standards#Static_Members
class LLWinImm
{
public:
static bool isAvailable() { return sTheInstance.mHImmDll != NULL; }
public:
// Wrappers for IMM API.
static BOOL isIME(HKL hkl) { return sTheInstance.mImmIsIME(hkl); }
static HIMC getContext(HWND hwnd) { return sTheInstance.mImmGetContext(hwnd); }
static BOOL releaseContext(HWND hwnd, HIMC himc) { return sTheInstance.mImmReleaseContext(hwnd, himc); }
static BOOL getOpenStatus(HIMC himc) { return sTheInstance.mImmGetOpenStatus(himc); }
static BOOL setOpenStatus(HIMC himc, BOOL status) { return sTheInstance.mImmSetOpenStatus(himc, status); }
static BOOL getConversionStatus(HIMC himc, LPDWORD conversion, LPDWORD sentence) { return sTheInstance.mImmGetConversionStatus(himc, conversion, sentence); }
static BOOL setConversionStatus(HIMC himc, DWORD conversion, DWORD sentence) { return sTheInstance.mImmSetConversionStatus(himc, conversion, sentence); }
private:
LLWinImm();
~LLWinImm();
private:
// Pointers to IMM API.
BOOL (WINAPI *mImmIsIME)(HKL);
HIMC (WINAPI *mImmGetContext)(HWND);
BOOL (WINAPI *mImmReleaseContext)(HWND, HIMC);
BOOL (WINAPI *mImmGetOpenStatus)(HIMC);
BOOL (WINAPI *mImmSetOpenStatus)(HIMC, BOOL);
BOOL (WINAPI *mImmGetConversionStatus)(HIMC, LPDWORD, LPDWORD);
BOOL (WINAPI *mImmSetConversionStatus)(HIMC, DWORD, DWORD);
private:
HMODULE mHImmDll;
static LLWinImm sTheInstance;
};
LLWinImm LLWinImm::sTheInstance;
LLWinImm::LLWinImm()
{
mHImmDll = LoadLibraryA("Imm32");
if (mHImmDll != NULL)
{
mImmIsIME = (BOOL (WINAPI *)(HKL)) GetProcAddress(mHImmDll, "ImmIsIME");
mImmGetContext = (HIMC (WINAPI *)(HWND)) GetProcAddress(mHImmDll, "ImmGetContext");
mImmReleaseContext = (BOOL (WINAPI *)(HWND, HIMC)) GetProcAddress(mHImmDll, "ImmReleaseContext");
mImmGetOpenStatus = (BOOL (WINAPI *)(HIMC)) GetProcAddress(mHImmDll, "ImmGetOpenStatus");
mImmSetOpenStatus = (BOOL (WINAPI *)(HIMC, BOOL)) GetProcAddress(mHImmDll, "ImmSetOpenStatus");
mImmGetConversionStatus = (BOOL (WINAPI *)(HIMC, LPDWORD, LPDWORD)) GetProcAddress(mHImmDll, "ImmGetConversionStatus");
mImmSetConversionStatus = (BOOL (WINAPI *)(HIMC, DWORD, DWORD)) GetProcAddress(mHImmDll, "ImmSetConversionStatus");
if (mImmIsIME == NULL ||
mImmGetContext == NULL ||
mImmReleaseContext == NULL ||
mImmGetOpenStatus == NULL ||
mImmSetOpenStatus == NULL ||
mImmGetConversionStatus == NULL ||
mImmSetConversionStatus == NULL)
{
// If any of the above API entires are not found, we can't use IMM API.
// So, turn off the IMM support. We should log some warning message in
// 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
// is one of disadvantages to use static constraction to DLL loading.
FreeLibrary(mHImmDll);
mHImmDll = NULL;
}
}
}
LLWinImm::~LLWinImm()
{
if (mHImmDll != NULL)
{
FreeLibrary(mHImmDll);
mHImmDll = NULL;
}
}
LPDIRECTINPUT8 g_pDI = NULL;
@ -91,6 +184,10 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
// Initialize the keyboard
gKeyboard = new LLKeyboardWin32();
// Initialize (boot strap) the Language text input management,
// based on the system's (user's) default settings.
allowLanguageTextInput(FALSE);
GLuint pixel_format;
WNDCLASS wc;
DWORD dw_ex_style;
@ -327,7 +424,6 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
if (!mWindowHandle)
{
DestroyWindow(mWindowHandle);
OSMessageBox("Window creation error", "Error", OSMB_OK);
return;
}
@ -1906,6 +2002,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_CHAR:
// Should really use WM_UNICHAR eventually, but it requires a specific Windows version and I need
// to figure out how that works. - Doug
//
// ... Well, I don't think so.
// How it works is explained in Win32 API document, but WM_UNICHAR didn't work
// as specified at least on Windows XP SP1 Japanese version. I have never used
// it since then, and I'm not sure whether it has been fixed now, but I don't think
// it is worth trying. The good old WM_CHAR works just fine even for supplementary
// characters. We just need to take care of surrogate pairs sent as two WM_CHAR's
// by ourselves. It is not that tough. -- Alissa Sabre @ SL
//
// llinfos << "WM_CHAR: " << w_param << llendl;
if (gDebugWindowProc)
{
@ -1913,11 +2018,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
<< " key " << S32(w_param)
<< llendl;
}
if (window_imp->mCallbacks->handleUnicodeChar(w_param, gKeyboard->currentMask(FALSE)))
{
return 0;
}
break;
// Even if LLWindowCallbacks::handleUnicodeChar(llwchar, BOOL) returned FALSE,
// we *did* processed the event, so I believe we should not pass it to DefWindowProc...
window_imp->handleUnicodeUTF16((U16)w_param, gKeyboard->currentMask(FALSE));
return 0;
case WM_LBUTTONDOWN:
{
@ -2951,7 +3055,7 @@ void spawn_web_browser(const char* escaped_url )
char reg_path_str[256]; /* Flawfinder: ignore */
snprintf(reg_path_str, sizeof(reg_path_str), "%s\\shell\\open\\command", gURLProtocolWhitelistHandler[i]); /* Flawfinder: ignore */
WCHAR reg_path_wstr[256];
mbstowcs(reg_path_wstr, reg_path_str, 1024);
mbstowcs(reg_path_wstr, reg_path_str, sizeof(reg_path_wstr)/sizeof(reg_path_wstr[0]));
HKEY key;
WCHAR browser_open_wstr[1024];
@ -3082,6 +3186,58 @@ void LLWindowWin32::bringToFront()
void LLWindowWin32::focusClient()
{
SetFocus ( mWindowHandle );
};
}
void LLWindowWin32::allowLanguageTextInput(BOOL b)
{
if (b == sLanguageTextInputAllowed || !LLWinImm::isAvailable())
{
/* Not actually allowing/disallowing. Do nothing. */
return;
}
sLanguageTextInputAllowed = b;
if (b)
{
/* Allowing: Restore the previous IME status,
so that the user has a feeling that the previous
text input continues naturally. Be careful, however,
the IME status is meaningful only during the user keeps
using same Input Locale (aka Keyboard Layout). */
if (sWinIMEOpened && GetKeyboardLayout(0) == sWinInputLocale)
{
HIMC himc = LLWinImm::getContext(mWindowHandle);
LLWinImm::setOpenStatus(himc, TRUE);
LLWinImm::setConversionStatus(himc, sWinIMEConversionMode, sWinIMESentenceMode);
LLWinImm::releaseContext(mWindowHandle, himc);
}
}
else
{
/* Disallowing: Turn off the IME so that succeeding
key events bypass IME and come to us directly.
However, do it after saving the current IME
status. We need to restore the status when
allowing language text input again. */
sWinInputLocale = GetKeyboardLayout(0);
sWinIMEOpened = LLWinImm::isIME(sWinInputLocale);
if (sWinIMEOpened)
{
HIMC himc = LLWinImm::getContext(mWindowHandle);
sWinIMEOpened = LLWinImm::getOpenStatus(himc);
if (sWinIMEOpened)
{
LLWinImm::getConversionStatus(himc, &sWinIMEConversionMode, &sWinIMESentenceMode);
/* We need both ImmSetConversionStatus and ImmSetOpenStatus here
to surely disable IME's keyboard hooking, because Some IME reacts
only on the former and some other on the latter... */
LLWinImm::setConversionStatus(himc, IME_CMODE_NOCONVERSION, sWinIMESentenceMode);
LLWinImm::setOpenStatus(himc, FALSE);
}
LLWinImm::releaseContext(mWindowHandle, himc);
}
}
}
#endif // LL_WINDOWS

View File

@ -86,6 +86,8 @@ public:
/*virtual*/ void bringToFront();
/*virtual*/ void focusClient();
/*virtual*/ void allowLanguageTextInput(BOOL b);
protected:
LLWindowWin32(
char *title, char *name, int x, int y, int width, int height, U32 flags,
@ -154,6 +156,15 @@ protected:
BOOL mMousePositionModified;
BOOL mInputProcessingPaused;
// The following five variables are for Language Text Input control.
// They are all static, since one context is shared by all LLWindowWin32
// instances.
static BOOL sLanguageTextInputAllowed;
static BOOL sWinIMEOpened;
static HKL sWinInputLocale;
static DWORD sWinIMEConversionMode;
static DWORD sWinIMESentenceMode;
friend class LLWindowManager;
};

View File

@ -21,6 +21,7 @@
#include "v3dmath.h"
#include "v4math.h"
#include "llquaternion.h"
#include "llstring.h"
#include "lluuid.h"
const S32 MAX_COLUMN_WIDTH = 80;
@ -3068,6 +3069,8 @@ LLString LLXMLNode::getTextContents() const
msg = mValue.substr(start);
}
}
// Convert any internal CR to LF
msg = utf8str_removeCRLF(msg);
}
}
return msg;

View File

@ -2,7 +2,7 @@
* @file llxmlparser.cpp
* @brief LLXmlParser implementation
*
* Copyright (c) 2002-$CurrentYear$`, Linden Research, Inc.
* Copyright (c) 2002-$CurrentYear$, Linden Research, Inc.
* $License$
*/

View File

@ -1,8 +1,7 @@
D [-]?[0-9]
N [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E [Ee][+-]?{D}+
E [Ee][+-]?{N}+
FS (f|F)
%e 10000
%n 4000
@ -41,7 +40,7 @@ void parse_string();
#define YYLMAX 16384
#define YY_NEVER_INTERACTIVE 1 /* stops flex from calling isatty() */
#if defined(__cplusplus)
extern "C" { int yylex( void ); }
extern "C" { int yyparse( void ); }
@ -111,7 +110,7 @@ extern "C" { int yyerror(const char *fmt, ...); }
0[xX]{H}+ { count(); yylval.ival = strtoul(yytext, NULL, 0); return(INTEGER_CONSTANT); }
{D}+ { count(); yylval.ival = strtoul(yytext, NULL, 10); return(INTEGER_CONSTANT); }
{N}+ { count(); yylval.ival = strtoul(yytext, NULL, 10); return(INTEGER_CONSTANT); }
"TRUE" { count(); yylval.ival = 1; return(INTEGER_TRUE); }
"FALSE" { count(); yylval.ival = 0; return(INTEGER_FALSE); }
"STATUS_PHYSICS" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); }
@ -571,9 +570,9 @@ extern "C" { int yyerror(const char *fmt, ...); }
{L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); }
{D}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
{D}*"."{D}+({E})?{FS}? { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
{D}+"."{D}*({E})?{FS}? { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
{N}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
{N}*"."{N}+({E})?{FS}? { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
{N}+"."{N}*({E})?{FS}? { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
L?\"(\\.|[^\\"])*\" { parse_string(); count(); return(STRING_CONSTANT); }
@ -751,6 +750,10 @@ BOOL lscript_compile(char *filename, BOOL is_god_like = FALSE)
S32 yywrap()
{
#ifdef FLEX_SCANNER
// get gcc to stop complaining about lack of use of yyunput
(void) yyunput;
#endif
return(1);
}

View File

@ -143,6 +143,8 @@
%type <assignable> simple_assignable
%type <assignable> simple_assignable_no_list
%type <constant> constant
%type <ival> integer_constant
%type <fval> fp_constant
%type <assignable> special_constant
%type <assignable> vector_constant
%type <assignable> quaternion_constant
@ -352,22 +354,12 @@ simple_assignable_no_list
;
constant
: INTEGER_CONSTANT
: integer_constant
{
$$ = new LLScriptConstantInteger(gLine, gColumn, $1);
gAllocationManager->addAllocation($$);
}
| INTEGER_TRUE
{
$$ = new LLScriptConstantInteger(gLine, gColumn, $1);
gAllocationManager->addAllocation($$);
}
| INTEGER_FALSE
{
$$ = new LLScriptConstantInteger(gLine, gColumn, $1);
gAllocationManager->addAllocation($$);
}
| FP_CONSTANT
| fp_constant
{
$$ = new LLScriptConstantFloat(gLine, gColumn, $1);
gAllocationManager->addAllocation($$);
@ -379,6 +371,36 @@ constant
}
;
fp_constant
: FP_CONSTANT
{
$$ = $1;
}
| '-' FP_CONSTANT
{
$$ = -$2;
}
;
integer_constant
: INTEGER_CONSTANT
{
$$ = $1;
}
| INTEGER_TRUE
{
$$ = $1;
}
| INTEGER_FALSE
{
$$ = $1;
}
| '-' INTEGER_CONSTANT
{
$$ = -$2;
}
;
special_constant
: vector_constant
{

View File

@ -1367,7 +1367,7 @@ void integer_integer_operation(U8 *buffer, LSCRIPTOpCodesEnum opcode)
break;
case LOPC_DIV:
if (rside){
if( ( rside == -1 ) || ( rside == 0xffffffff ) )// division by -1 can have funny results: multiplication is OK: SL-31252
if( ( rside == -1 ) || ( rside == (S32) 0xffffffff ) )// division by -1 can have funny results: multiplication is OK: SL-31252
{
result = -1 * lside;
}

View File

@ -16,4 +16,4 @@ void* fmodwrapper(void)
// When building the fmodwrapper library, the linker doesn't seem to want to bring in libfmod.a unless I explicitly
// reference at least one symbol in the library. This seemed like the simplest way.
return (void*)&FSOUND_Init;
}
}

View File

@ -547,3 +547,96 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
==============
libpng license
==============
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors:
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and
must not be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from
any source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.

View File

@ -432,3 +432,96 @@ jloup@gzip.org
Mark Adler
madler@alumni.caltech.edu
==============
libpng license
==============
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors:
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and
must not be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from
any source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.

View File

@ -432,3 +432,96 @@ jloup@gzip.org
Mark Adler
madler@alumni.caltech.edu
==============
libpng license
==============
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors:
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and
must not be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from
any source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.

View File

@ -38,7 +38,7 @@ export LL_GL_BASICEXT=x
## you're building your own viewer, bear in mind that the executable
## in the bin directory will be stripped: you should replace it with
## an unstripped binary before you run.
#export LL_WRAPPER='valgrind --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp'
#export LL_WRAPPER='valgrind --smc-check=all --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp'
## - Avoids an often-buggy X feature that doesn't really benefit us anyway.
export SDL_VIDEO_X11_DGAMOUSE=0

View File

@ -1999,11 +1999,6 @@ void LLAgent::setAFK()
return;
}
if (!gAllowAFK)
{
return;
}
if (!gAgent.getRegion())
{
// Don't set AFK if we're not talking to a region yet.

View File

@ -220,7 +220,7 @@ public:
const LLUUID &getGroupID() const { return mGroupID; }
ECameraMode getCameraMode() const { return mCameraMode; }
BOOL getFocusOnAvatar() const { return mFocusOnAvatar; }
LLViewerObject* getFocusObject() const { return mFocusObject; }
LLPointer<LLViewerObject>& getFocusObject() { return mFocusObject; }
F32 getFocusObjectDist() const { return mFocusObjectDist; }
BOOL inPrelude();
BOOL canManageEstate() const;

View File

@ -122,7 +122,7 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content)
else
{
LLHTTPClient::postFile(uploader, mFileName, this);
}
}
}
void LLAssetUploadResponder::uploadFailure(const LLSD& content)

View File

@ -427,7 +427,7 @@ void LLChatBar::sendChat( EChatType type )
if (!text.empty())
{
// store sent line in history, duplicates will get filtered
mInputEditor->updateHistory();
if (mInputEditor) mInputEditor->updateHistory();
// Check if this is destined for another channel
S32 channel = 0;
stripChannelNumber(text, &channel);

View File

@ -57,6 +57,9 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy
addChild(mSlider2);
addChild(mSlider3);
break;
default:
llwarns << "Unhandled var type " << var_type << llendl;
break;
}
mAnimateButton = new LLButton("Animate", LLRect(20, 45, 180, 25), "", onAnimateClicked, this);
@ -165,12 +168,17 @@ void LLDebugVarMessageBox::slider_changed(LLUICtrl* ctrl, void* user_data)
*((S32*)msg_box->mVarData) = (S32)msg_box->mSlider1->getValue().asInteger();
break;
case VAR_TYPE_VEC3:
{
LLVector3* vec_p = (LLVector3*)msg_box->mVarData;
vec_p->setVec((F32)msg_box->mSlider1->getValue().asReal(),
(F32)msg_box->mSlider2->getValue().asReal(),
(F32)msg_box->mSlider3->getValue().asReal());
break;
}
default:
llwarns << "Unhandled var type " << msg_box->mVarType << llendl;
break;
}
}
void LLDebugVarMessageBox::onAnimateClicked(void* user_data)
@ -197,10 +205,15 @@ void LLDebugVarMessageBox::draw()
snprintf(text, sizeof(text), "%d", *((S32*)mVarData)); /* Flawfinder: ignore */
break;
case VAR_TYPE_VEC3:
{
LLVector3* vec_p = (LLVector3*)mVarData;
snprintf(text, sizeof(text), "%.3f %.3f %.3f", vec_p->mV[VX], vec_p->mV[VY], vec_p->mV[VZ]); /* Flawfinder: ignore */
break;
}
default:
llwarns << "Unhandled var type " << mVarType << llendl;
break;
}
mText->setText(text);
if(mAnimate)

View File

@ -1304,7 +1304,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
if (parent)
{
av = (LLVOAvatar*) parent->getVObj();
av = (LLVOAvatar*) parent->getVObj().get();
if (!av->isVisible())
{

View File

@ -62,8 +62,8 @@ public:
const LLViewerRegion* getRegion() const { return mVObjp->getRegion(); }
const LLTextureEntry* getTextureEntry(U8 which) const { return mVObjp->getTE(which); }
LLViewerObject* getVObj() { return mVObjp; }
const LLViewerObject* getVObj() const { return mVObjp; }
LLPointer<LLViewerObject>& getVObj() { return mVObjp; }
const LLViewerObject *getVObj() const { return mVObjp; }
LLVOVolume* getVOVolume() const; // cast mVObjp tp LLVOVolume if OK
const LLMatrix4& getWorldMatrix() const { return mXform.getWorldMatrix(); }

View File

@ -466,15 +466,20 @@ void LLRenderPass::renderInvisible(U32 mask)
std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[LLRenderPass::PASS_INVISIBLE];
U32* indices_pointer = NULL;
for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
{
LLDrawInfo& params = **i;
params.mVertexBuffer->setBuffer(mask);
indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
GL_UNSIGNED_INT, indices_pointer+params.mOffset);
gPipeline.mTrianglesDrawn += params.mCount/3;
if (params.mVertexBuffer)
{
params.mVertexBuffer->setBuffer(mask);
U32 *indices_pointer =
(U32 *) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd,
params.mCount, GL_UNSIGNED_INT,
indices_pointer + params.mOffset);
gPipeline.mTrianglesDrawn += params.mCount / 3;
}
}
}

View File

@ -299,7 +299,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
{
return;
}
avatarp = (LLVOAvatar *)(facep->getDrawable()->getVObj());
avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
}
if (avatarp->isDead() || avatarp->mDrawable.isNull())
@ -505,7 +505,7 @@ void LLDrawPoolAvatar::renderForSelect()
{
return;
}
LLVOAvatar *avatarp = (LLVOAvatar *)(facep->getDrawable()->getVObj());
LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get();
if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull())
{

View File

@ -144,7 +144,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
U32* indicesp = (U32*) face->mVertexBuffer->getIndicesPointer();
// Render each of the trees
LLVOTree *treep = (LLVOTree *)drawablep->getVObj();
LLVOTree *treep = (LLVOTree *)drawablep->getVObj().get();
LLColor4U color(255,255,255,255);

View File

@ -84,7 +84,7 @@ protected:
typedef std::vector<LLDrivenEntry> entry_list_t;
entry_list_t mDriven;
LLViewerVisualParam* mCurrentDistortionParam;
LLVOAvatar* mAvatarp;
LLPointer<LLVOAvatar> mAvatarp;
};
#endif // LL_LLDRIVERPARAM_H

View File

@ -1,8 +1,8 @@
/**
/**
* @file lleventpoll.cpp
* @brief Implementation of the LLEventPoll class.
* @brief Implementation of the LLEventPoll class.
*
* Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
* Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
* $License$
*/

View File

@ -1378,7 +1378,7 @@ void LLFace::enableLights() const
}
if (isState(LIGHT))
{
const LLVOVolume* vovolume = (const LLVOVolume*)(mDrawablep->getVObj());
const LLVOVolume* vovolume = (const LLVOVolume*)mDrawablep->getVObj();
gPipeline.setAmbient(vovolume->getLightColor());
}
}

View File

@ -29,7 +29,7 @@ LLFilePicker LLFilePicker::sInstance;
#if LL_WINDOWS
#define SOUND_FILTER L"Sounds (*.wav)\0*.wav\0"
#define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg)\0*.tga;*.bmp;*.jpg;*.jpeg\0"
#define IMAGE_FILTER L"Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)\0*.tga;*.bmp;*.jpg;*.jpeg;*.png\0"
#define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0"
#ifdef _CORY_TESTING
#define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0"
@ -491,10 +491,12 @@ Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callB
if (fileInfo.filetype != 'JPEG' && fileInfo.filetype != 'JPG ' &&
fileInfo.filetype != 'BMP ' && fileInfo.filetype != 'TGA ' &&
fileInfo.filetype != 'BMPf' && fileInfo.filetype != 'TPIC' &&
fileInfo.filetype != 'PNG ' &&
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("jpeg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo &&
CFStringCompare(fileInfo.extension, CFSTR("jpg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo &&
CFStringCompare(fileInfo.extension, CFSTR("bmp"), kCFCompareCaseInsensitive) != kCFCompareEqualTo &&
CFStringCompare(fileInfo.extension, CFSTR("tga"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
CFStringCompare(fileInfo.extension, CFSTR("tga"), kCFCompareCaseInsensitive) != kCFCompareEqualTo &&
CFStringCompare(fileInfo.extension, CFSTR("png"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
)
{
result = false;
@ -1149,7 +1151,7 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter )
case FFLOAD_ANIM:
caption += "Animations (*.bvh)"; break;
case FFLOAD_IMAGE:
caption += "Images (*.tga; *.bmp; *.jpg; *.jpeg)"; break;
caption += "Images (*.tga; *.bmp; *.jpg; *.jpeg; *.png)"; break;
default:;
break;
}

View File

@ -40,6 +40,18 @@ void LLFirstUse::disableFirstUse()
}
}
// static
void LLFirstUse::resetFirstUse()
{
// Set all first-use warnings to disabled
for (std::set<LLString>::iterator iter = sConfigVariables.begin();
iter != sConfigVariables.end(); ++iter)
{
gSavedSettings.setWarning(*iter, TRUE);
}
}
// Called whenever the viewer detects that your balance went up
void LLFirstUse::useBalanceIncrease(S32 delta)
{
@ -194,3 +206,25 @@ void LLFirstUse::useFlexible()
}
}
// static
void LLFirstUse::useDebugMenus()
{
if (gSavedSettings.getWarning("FirstDebugMenus"))
{
gSavedSettings.setWarning("FirstDebugMenus", FALSE);
LLNotifyBox::showXml("FirstDebugMenus");
}
}
// static
void LLFirstUse::useSculptedPrim()
{
if (gSavedSettings.getWarning("FirstSculptedPrim"))
{
gSavedSettings.setWarning("FirstSculptedPrim", FALSE);
LLNotifyBox::showXml("FirstSculptedPrim");
}
}

View File

@ -46,6 +46,10 @@ object or from inventory.
11. FIrst time you run the client on a system without QuickTime installed.
12. First time you create a flexible object.
13. First time you open the debug menus (ctrl-alt-shift D)
14. First time you create/edit a sculpted prim.
*/
class LLFirstUse
@ -56,6 +60,7 @@ public:
// Sets all controls back to show the dialogs.
static void disableFirstUse();
static void resetFirstUse();
// These methods are called each time the appropriate action is
// taken. The functions themselves handle only showing the dialog
@ -74,6 +79,8 @@ public:
static void useInventory();
static void useSandbox();
static void useFlexible();
static void useDebugMenus();
static void useSculptedPrim();
protected:
static std::set<LLString> sConfigVariables;

View File

@ -232,12 +232,6 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons
//---------------------------------------------------------------------------------
BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
{
return FALSE; // (we are not initialized or updated)
}
LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE);
if (mVO->mDrawable.isNull())
{
@ -252,6 +246,8 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
parent->mDrawable->mQuietCount = 0;
}
LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE);
S32 new_res = mAttributes->getSimulateLOD();
@ -264,6 +260,8 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
{
mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS;
}
// Bottom cap at 1/4 the original number of sections
if (mRenderRes < mAttributes->getSimulateLOD()-1)
{
@ -281,6 +279,10 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
setAttributesOfAllSections();
mInitialized = TRUE;
}
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
{
return FALSE; // (we are not initialized or updated)
}
if (mVO->mDrawable->isVisible() &&
!mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) &&
@ -604,7 +606,7 @@ void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped)
BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
{
LLVOVolume *volume = (LLVOVolume*)mVO;
LLVOVolume *volume = (LLVOVolume*)mVO.get();
if (volume->mDrawable.isNull()) // Not sure why this is happening, but it is...
{
@ -720,7 +722,7 @@ void LLVolumeImplFlexible::updateRelativeXform()
{
LLQuaternion delta_rot;
LLVector3 delta_pos, delta_scale;
LLVOVolume* vo = (LLVOVolume*) mVO;
LLVOVolume* vo = (LLVOVolume*) mVO.get();
//matrix from local space to parent relative/global space
delta_rot = vo->mDrawable->isSpatialRoot() ? LLQuaternion() : vo->mDrawable->getRotation();

View File

@ -91,7 +91,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
//--------------------------------------
// private members
//--------------------------------------
LLViewerObject* mVO;
LLPointer<LLViewerObject> mVO;
LLTimer mTimer;
LLVector3 mAnchorPosition;
LLVector3 mParentPosition;

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