Merge a big bunch of fixes from maint-viewer. Hooray.

svn merge -r136066:136073 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-viewer/maint-viewer-24-qa-9

DEV-8553 New Server Tools - Prep Land For Sale
DEV-32942 (QAR-1521) Bad border crossings or TP / Ruthing issues
DEV-32942 (QAR-1521) Bad border crossings or TP / Ruthing issues
DEV-33239 VWR-13816: Resizing the Search Window Causes the Results to Refresh back to First Page
DEV-27746 Running a dev build of Second Life will make console window show up on non-dev builds (Windows)
DEV-33209 Linux 1.24.0.120778 client fails to run
DEV-29123 SVC-3871: Crash of viewer when clicking on ghost objects at (0,0,0) on a sim
DEV-35433 Attempting to upload wrong file type crashes viewer
DEV-33499 viewer2009 is not using KDU
DEV-33912 Griefing viewer crashes others' viewers with malformed sound files
DEV-3784 VWR-138: Animation Priority not working correctly, Can't create new AOs
DEV-20678 VWR-9069: Region variable says 'Region Name' in AR if no object is selected
DEV-19934 Help->About Second Life doesn't differentiate between 32- and 64-bit Vista
DEV-6604 Restored folders have 'Purge Item' and 'Restore Item' options
DEV-12867 VWR-5717: Selected Text is not replaced by Input text when Japanese IME is on
DEV-11894 Notecards/Texture windows don't open completely when opened from inventory
DEV-10641 VWR-4955: Local Chat doesn't show end of last conversation
DEV-30039 VWR-12620: Viewer build fails on Linux when compiled with -O2 (--type=Release)
DEV-20944 VWR-9065: (intermittent) Right Click >profile on avatar does not display profile
DEV-24828 Menu accelerator prefixes shouldn't be hard-coded
DEV-34529 VWR-14267: Clicking send in an IM window does not add the sent text to the line editor history
DEV-34124 Invite to group, search by name will not show resident if their first name is two characters
DEV-20930 VWR-9248: On Mac: the "--url" option causes a command line parsing error
DEV-35306 Adult keyword filter triggers multiple warnings
DEV-35503 VWR-3595: "Second Life requires True Color (32-bit) to run in a window" message is incorrect
DEV-35656 VWR-12995: FTBFS: error: format '%-3d' expects type 'int', but argument 3 has type 'size_t'
DEV-30043 VWR-12533: Linux viewer build for OpenAL fails during packaging unless FMOD library is available
DEV-31898 VWR-13202: Right clicking mouse triggers arrow key control events
DEV-32610 Keyboard shortcuts on OSX viewer overridden by OSX
DEV-27067 Coverity Prevent: EVALUATION_ORDER defects
DEV-26188 VWR-2242: Specially formatted .BVH file can cause avatar distortion
DEV-25475 About Land dialog no longer shows Area: field
DEV-19897 OSX Viewer Installer (for an RC) opens with poor positioning
DEV-22837 Inventory> Search Recent Items highlighting incorrect characters
DEV-21709 VWR-9377: Mapping will default to leave exact sim name listing first. (Searching Gar forces Gar to come up and not Garden of Dreams)
DEV-23079 implement volume serial for linux client
DEV-13930 VWR-6432: Space Navigator operation with vehicles is broken
DEV-27666 VWR-10829: Linux Viewer: CLICK_ACTION_PAY shows CLICK_ACTION_PLAY icon
DEV-23670 Viewer crashes on startup if installed into a custom folder with Korean, Japanese or Chinese characters in path
DEV-19313 VWR-8454: PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS not highlighted in script editor
DEV-19918 VWR-8885: Move character/*.xml files to source bundle
DEV-25555 VWR-11172: A source coding mistake prevents number-pad keys from specifying Ctrl+digit shortcuts on Windows
DEV-8536 VWR-4057: Multi-line chat display bug - first character in line missing
DEV-29592 Mac LLFastTimer uses wall clock instead of Intel PMU
DEV-29644 VWR-12587: Cmake install target has a hard coded secondlife-bin reference remaining
DEV-25320 VWR-11128: Python not always detected by develop.py
DEV-30040 VWR-12617: Poor type name that violates Coding Standard breaks compatibility with system header files
DEV-30380 indra/newview/res-sdl/toolpay.BMP is modified during ./develop.py configure
DEV-31247 VWR-12763: non-portable printf specifier used with size_t causes FTBFS on 64bit (due to -Werror)
DEV-29565 VWR-12569: A comment in lluistring.h contains undefined UTF-8 code sequences
DEV-22100 VWR-9620: send_parcel_select_objects in newview/llfloaterland.cpp uses the wrong datatype for the ReturnType field causing a warning
DEV-31911 Selected objects / primitives should be greyed out when nothing is selected
DEV-3667 Windows: Accelerator keys should be "Ctrl+X" rather than "Ctrl-X"
DEV-27223 disable gstreamer on 64-bit linux
DEV-8172 We Need a Linden Sale Option to Sell Land to Anyone
DEV-25511 VWR-10311: Enable LipSync by default
DEV-20443 Revamp group creation confirmation dialog to be more communicative
DEV-20132 VWR-7800: Joystick / SpaceNavigator. Camera should remain in position when exiting flycam mode into avatar mode.
DEV-18420 VWR-8393: Have build scripts copy fmod from an external location
DEV-24841 VWR-10717: Right Space Navigator button should toggle fly in avatar movment, not jump/flyup.
DEV-28457 change auto-populate value in buy L$ window from 1000 to 2000
DEV-15545 VWR-3725: Please add resize option to the SEARCH window UI
master
Adam Moss 2009-10-14 10:40:56 +00:00
parent d6db0f8b29
commit 406927f629
153 changed files with 1468 additions and 459 deletions

View File

@ -1,7 +1,7 @@
Linden Lab would like to acknowledge source code contributions from the
following residents. The Second Life resident name is given below,
following residents. The Second Life resident name is given below,
along with the issue identifier corresponding to the patches we've
received from them. To see more about these contributions, visit the
received from them. To see more about these contributions, visit the
browsable version: http://wiki.secondlife.com/wiki/Source_contributions
Able Whitman
@ -25,19 +25,25 @@ Aimee Trescothick
VWR-6348
VWR-6358
VWR-6360
VWR-6432
VWR-6550
VWR-6583
VWR-6482
VWR-7109
VWR-7383
VWR-7800
VWR-8008
VWR-8341
VWR-8430
VWR-8482
VWR-9255
VWR-10717
VWR-10990
VWR-11100
VWR-11111
VWR-11844
VWR-11844
VWR-14267
VWR-14278
VWR-14087
Alejandro Rosenthal
VWR-1184
@ -45,9 +51,11 @@ Aleric Inglewood
VWR-10001
VWR-10759
VWR-10837
VWR-12691
VWR-13996
VWR-14426
Ales Beaumont
VWR-9352
VWR-9352
Alissa Sabre
VWR-81
VWR-83
@ -69,7 +77,7 @@ Alissa Sabre
VWR-1351
VWR-1353
VWR-1410
VWR-1843
VWR-1843
VWR-2116
VWR-2826
VWR-3290
@ -77,19 +85,25 @@ Alissa Sabre
VWR-3857
VWR-4010
VWR-5575
VWR-5929
VWR-6384
VWR-6385
VWR-5717
VWR-5929
VWR-6384
VWR-6385
VWR-6386
VWR-6430
VWR-6430
VWR-6858
VWR-6668
VWR-7086
VWR-7087
VWR-7153
VWR-7168
VWR-6668
VWR-7086
VWR-7087
VWR-7153
VWR-7168
VWR-9190
VWR-10728
VWR-11172
VWR-12569
VWR-12617
VWR-12620
VWR-12789
Angus Boyd
VWR-592
Ann Congrejo
@ -147,6 +161,7 @@ Carjay McGinnis
VWR-4212
VWR-6154
VWR-9400
VWR-9620
Catherine Pfeffer
VWR-1282
VWR-8624
@ -294,6 +309,7 @@ Kerutsen Sellery
VWR-1350
Khyota Wulluf
VWR-2085
VWR-8885
VWR-9256
VWR-9966
Kunnis Basiat
@ -336,6 +352,7 @@ McCabe Maxsted
VWR-7877
VWR-7893
VWR-8080
VWR-8454
VWR-8689
VWR-9007
Michelle2 Zenovka
@ -350,6 +367,7 @@ Michelle2 Zenovka
VWR-5082
VWR-5659
VWR-7831
VWR-8885
VWR-8889
VWR-8310
VWR-9499
@ -464,7 +482,7 @@ Pf Shan
CT-321
princess niven
VWR-5733
CT-85
CT-85
CT-320
CT-352
Renault Clio
@ -481,7 +499,11 @@ Ringo Tuxing
Robin Cornelius
VWR-2488
VWR-9557
VWR-11128
VWR-12533
VWR-12587
VWR-12763
VWR-12995
Ryozu Kojima
VWR-53
VWR-287
@ -564,12 +586,16 @@ TBBle Kurosawa
VWR-1892
Teardrops Fall
VWR-5366
Techwolf Lupindo
SNOW-92
VWR-12385
tenebrous pau
VWR-247
Tharax Ferraris
VWR-605
Thickbrick Sleaford
VWR-7109
VWR-9287
VWR-13947
Thraxis Epsilon
SVC-371

View File

@ -170,6 +170,8 @@ if (LINUX)
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
# linking can be so slow - give us a chance to figure out why
set(CMAKE_CXX_LINK_FLAGS "-Wl,--stats,--no-keep-memory")
endif (NOT STANDALONE)
endif (VIEWER)

View File

@ -13,9 +13,9 @@ if (STANDALONE)
SDL_LIBRARY
)
else (STANDALONE)
use_prebuilt_binary(SDL)
use_prebuilt_binary(mesa)
if (LINUX AND VIEWER)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
set (SDL_LIBRARY SDL)

View File

@ -13,6 +13,10 @@ if (WINDOWS)
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
elseif (EXISTS /etc/debian_version)
# On Debian and Ubuntu, avoid Python 2.4 if possible.

View File

@ -38,7 +38,7 @@ list(APPEND linux_crash_logger_SOURCE_FILES
${linux_crash_logger_HEADER_FILES}
)
list(APPEND CMAKE_EXE_LINKER_FLAGS -Wl,--as-needed)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES})

View File

@ -43,6 +43,8 @@
#include "llassetstorage.h"
#include "llrefcount.h"
#include "llvorbisencode.h"
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
@ -218,11 +220,42 @@ BOOL LLVorbisDecodeState::initDecode()
return(FALSE);
}
size_t size_guess = (size_t)ov_pcm_total(&mVF, -1);
S32 sample_count = ov_pcm_total(&mVF, -1);
size_t size_guess = (size_t)sample_count;
vorbis_info* vi = ov_info(&mVF, -1);
size_guess *= vi->channels;
size_guess *= 2;
size_guess += 2048;
bool abort_decode = false;
if( vi->channels < 1 || vi->channels > LLVORBIS_CLIP_MAX_CHANNELS )
{
abort_decode = true;
llwarns << "Bad channel count: " << vi->channels << llendl;
}
if( (size_t)sample_count > LLVORBIS_CLIP_REJECT_SAMPLES )
{
abort_decode = true;
llwarns << "Illegal sample count: " << sample_count << llendl;
}
if( size_guess > LLVORBIS_CLIP_REJECT_SIZE )
{
abort_decode = true;
llwarns << "Illegal sample size: " << size_guess << llendl;
}
if( abort_decode )
{
llwarns << "Canceling initDecode. Bad asset: " << mUUID << llendl;
llwarns << "Bad asset encoded by: " << ov_comment(&mVF,-1)->vendor << llendl;
delete mInFilep;
mInFilep = NULL;
return FALSE;
}
mWAVBuffer.reserve(size_guess);
mWAVBuffer.resize(WAV_HEADER_SIZE);

View File

@ -162,13 +162,13 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
return(LLVORBISENC_PCM_FORMAT_ERR);
}
if ((num_channels < 1) || (num_channels > 2))
if ((num_channels < 1) || (num_channels > LLVORBIS_CLIP_MAX_CHANNELS))
{
error_msg = "SoundFileInvalidChannelCount";
return(LLVORBISENC_MULTICHANNEL_ERR);
}
if (sample_rate != 44100)
if (sample_rate != LLVORBIS_CLIP_SAMPLE_RATE)
{
error_msg = "SoundFileInvalidSampleRate";
return(LLVORBISENC_UNSUPPORTED_SAMPLE_RATE);
@ -188,7 +188,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
F32 clip_length = (F32)raw_data_length/(F32)bytes_per_sec;
if (clip_length > 10.0f)
if (clip_length > LLVORBIS_CLIP_MAX_TIME)
{
error_msg = "SoundFileInvalidTooLong";
return(LLVORBISENC_CLIP_TOO_LONG);

View File

@ -45,6 +45,17 @@ const S32 LLVORBISENC_UNSUPPORTED_SAMPLE_RATE = 8; // unsupported sample ra
const S32 LLVORBISENC_UNSUPPORTED_WORD_SIZE = 9; // unsupported word size
const S32 LLVORBISENC_CLIP_TOO_LONG = 10; // source file is too long
const F32 LLVORBIS_CLIP_MAX_TIME = 10.0f;
const U8 LLVORBIS_CLIP_MAX_CHANNELS = 2;
const U32 LLVORBIS_CLIP_SAMPLE_RATE = 44100;
const U32 LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL = (U32)(LLVORBIS_CLIP_MAX_TIME * LLVORBIS_CLIP_SAMPLE_RATE);
const U32 LLVORBIS_CLIP_MAX_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES_PER_CHANNEL * LLVORBIS_CLIP_MAX_CHANNELS;
const size_t LLVORBIS_CLIP_MAX_SAMPLE_DATA = LLVORBIS_CLIP_MAX_SAMPLES * 2; // 2 = 16-bit
// Treat anything this long as a bad asset. A little fudge factor at the end:
// Make that a lot of fudge factor. We're allowing 30 sec for now - 3x legal upload
const size_t LLVORBIS_CLIP_REJECT_SAMPLES = LLVORBIS_CLIP_MAX_SAMPLES * 3;
const size_t LLVORBIS_CLIP_REJECT_SIZE = LLVORBIS_CLIP_MAX_SAMPLE_DATA * 3;
S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg);
S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname);

View File

@ -91,7 +91,9 @@ const char *LLBVHLoader::ST_NO_XLT_EASEIN = "Can't get easeIn values.";
const char *LLBVHLoader::ST_NO_XLT_EASEOUT = "Can't get easeOut values.";
const char *LLBVHLoader::ST_NO_XLT_HAND = "Can't get hand morph value.";
const char *LLBVHLoader::ST_NO_XLT_EMOTE = "Can't read emote name.";
const char *LLBVHLoader::ST_BAD_ROOT = "Illegal ROOT joint.";
*/
//------------------------------------------------------------------------
// find_next_whitespace()
//------------------------------------------------------------------------
@ -777,6 +779,17 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
return E_ST_NO_NAME;
}
//---------------------------------------------------------------
// we require the root joint be "hip" - DEV-26188
//---------------------------------------------------------------
const char* FORCED_ROOT_NAME = "hip";
if ( (mJoints.size() == 0 ) && ( !strstr(jointName, FORCED_ROOT_NAME) ) )
{
strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */
return E_ST_BAD_ROOT;
}
//----------------------------------------------------------------
// add a set of keyframes for this joint
//----------------------------------------------------------------

View File

@ -216,7 +216,8 @@ typedef enum e_load_status
E_ST_NO_XLT_EASEIN,
E_ST_NO_XLT_EASEOUT,
E_ST_NO_XLT_HAND,
E_ST_NO_XLT_EMOTE
E_ST_NO_XLT_EMOTE,
E_ST_BAD_ROOT
} ELoadStatus;
//------------------------------------------------------------------------
@ -235,7 +236,7 @@ public:
/*
// Status Codes
typedef const char *Status;
typedef const char *status_t;
static const char *ST_OK;
static const char *ST_EOF;
static const char *ST_NO_CONSTRAINT;
@ -267,6 +268,7 @@ public:
static const char *ST_NO_XLT_EASEOUT;
static const char *ST_NO_XLT_HAND;
static const char *ST_NO_XLT_EMOTE;
static const char *ST_BAD_ROOT;
*/
// Loads the specified translation table.
ELoadStatus loadTranslationTable(const char *fileName);
@ -325,6 +327,7 @@ protected:
BOOL mInitialized;
ELoadStatus mStatus;
// computed values
F32 mDuration;
};

View File

@ -304,7 +304,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
}
else
{
llwarns << "NULL gesture in gesture list (" << i << ")" << llendl
llwarns << "NULL gesture in gesture list (" << i << ")" << llendl;
}
}
return FALSE;

View File

@ -211,7 +211,7 @@ void LLJointSolverRP3::solve()
//-------------------------------------------------------------------------
LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec));
// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl
// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl;
//-------------------------------------------------------------------------
// compute the normal of the original ABC plane (and store for later)

View File

@ -239,7 +239,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
*/
#define lllog(level, broadTag, narrowTag, once) \
{ \
do { \
static LLError::CallSite _site( \
level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, broadTag, narrowTag, once);\
if (_site.shouldLog()) \
@ -252,7 +252,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
LLError::End(); \
LLError::Log::flush(_out, _site); \
} \
}
} while(0)
// DEPRECATED: Use the new macros that allow tags and *look* like macros.
#define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false)

View File

@ -34,6 +34,7 @@
#define LL_LLSTRING_H
#include <string>
#include <cstdio>
#include <locale>
#include <iomanip>
#include "llsd.h"

View File

@ -124,9 +124,42 @@ LLOSInfo::LLOSInfo() :
}
else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
{
if(osvi.wProductType == VER_NT_WORKSTATION)
mOSStringSimple = "Microsoft Windows Vista ";
else mOSStringSimple = "Microsoft Windows Vista Server ";
///get native system info if available..
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); ///function pointer for loading GetNativeSystemInfo
SYSTEM_INFO si; //System Info object file contains architecture info
PGNSI pGNSI; //pointer object
ZeroMemory(&si, sizeof(SYSTEM_INFO)); //zero out the memory in information
pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); //load kernel32 get function
if(NULL != pGNSI) //check if it has failed
pGNSI(&si); //success
else
GetSystemInfo(&si); //if it fails get regular system info
//(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load)
//msdn microsoft finds 32 bit and 64 bit flavors this way..
//http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx (example code that contains quite a few more flavors
//of windows than this code does (in case it is needed for the future)
if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 ) //check for 64 bit
{
if(osvi.wProductType == VER_NT_WORKSTATION)
mOSStringSimple = "Microsoft Windows Vista 64-bit ";
else
mOSStringSimple = "Microsoft Windows Vista Server 64-bit ";
}
else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL )
{
if(osvi.wProductType == VER_NT_WORKSTATION)
mOSStringSimple = "Microsoft Windows Vista 32-bit ";
else
mOSStringSimple = "Microsoft Windows Vista Server 32-bit ";
}
else // PROCESSOR_ARCHITECTURE_IA64 || PROCESSOR_ARCHITECTURE_UNKNOWN not checked
{
if(osvi.wProductType == VER_NT_WORKSTATION)
mOSStringSimple = "Microsoft Windows Vista ";
else
mOSStringSimple = "Microsoft Windows Vista Server ";
}
}
else // Use the registry on early versions of Windows NT.
{

View File

@ -159,7 +159,7 @@ U8* LLImageBase::allocateData(S32 size)
size = mWidth * mHeight * mComponents;
if (size <= 0)
{
llerrs << llformat("LLImageBase::allocateData called with bad dimentions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl;
llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl;
}
}
else if (size <= 0 || (size > 4096*4096*16 && sSizeOverride == FALSE))

View File

@ -706,7 +706,6 @@ void LLParcel::packMessage(LLSD& msg)
msg["category"] = (U8)mCategory;
msg["auth_buyer_id"] = mAuthBuyerID;
msg["snapshot_id"] = mSnapshotID;
msg["snapshot_id"] = mSnapshotID;
msg["user_location"] = ll_sd_from_vector3(mUserLocation);
msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt);
msg["landing_type"] = (U8)mLandingType;

View File

@ -4273,7 +4273,7 @@ LLFaceID LLVolume::generateFaceMask()
}
break;
default:
llerrs << "Unknown profile!" << llendl
llerrs << "Unknown profile!" << llendl;
break;
}

View File

@ -728,9 +728,9 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
// out gracefully from this function. XXXTBD
llerrs << "buildBlock failed. "
<< "Attempted to pack "
<< result + mvci.getSize()
<< (result + mvci.getSize())
<< " bytes into a buffer with size "
<< buffer_size << "." << llendl
<< buffer_size << "." << llendl;
}
}
}

View File

@ -678,12 +678,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
// default to 0s.
U32 size = mvci.getSize();
std::vector<U8> data(size);
if(size)
{
// Nonsense test to get past GCC 4.3.1 bug with -O3
memset(&(data[0]), 0, size);
}
std::vector<U8> data(size, 0);
cur_data_block->addData(mvci.getName(), &(data[0]),
size, mvci.getType());
}

View File

@ -9,6 +9,7 @@ include(LLCommon)
include(LLImage)
include(LLMath)
include(LLRender)
include(LLVFS)
include(LLWindow)
include(LLXML)
include(LLVFS)
@ -19,6 +20,7 @@ include_directories(
${LLIMAGE_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}

View File

@ -106,7 +106,7 @@ void LLCubeMap::initGL()
}
else
{
llwarns << "Using cube map without extension!" << llendl
llwarns << "Using cube map without extension!" << llendl;
}
}

View File

@ -364,7 +364,7 @@ BOOL LLFontFreetype::addChar(llwchar wch) const
glyph_index = FT_Get_Char_Index(mFTFace, wch);
if (glyph_index == 0)
{
//llinfos << "Trying to add glyph from fallback font!" << llendl
//llinfos << "Trying to add glyph from fallback font!" << llendl;
font_vector_t::const_iterator iter;
for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++)
{
@ -534,11 +534,10 @@ void LLFontFreetype::renderGlyph(U32 glyph_index) const
void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi)
{
resetBitmapCache();
loadFace(mName, mPointSize, vert_dpi ,horz_dpi, mFontBitmapCachep->getNumComponents(), mIsFallback);
if (!mIsFallback)
{
// This is the head of the list - need to rebuild ourself and all fallbacks.
loadFace(mName, mPointSize, vert_dpi ,horz_dpi, mFontBitmapCachep->getNumComponents(), mIsFallback);
if (mFallbackFonts.empty())
{
llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl;

View File

@ -44,6 +44,7 @@
#include "llstl.h"
#include "v4color.h"
#include "lltexture.h"
#include "lldir.h"
// Third party library includes
#include <boost/tokenizer.hpp>

View File

@ -53,8 +53,6 @@
# include "GL/glxext.h"
//# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddress((const GLubyte*)(p))
// the X headers define 'Status'. Undefine to avoid confusion.
#undef Status
// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
// This header is distributed with SL. You'll find it in linden/libraries/include/GL/
@ -277,8 +275,6 @@ extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
// Use glXGetProcAddressARB instead of glXGetProcAddress - the ARB symbol
// is considered 'legacy' but works on more machines.
# define GLH_EXT_GET_PROC_ADDRESS(p) glXGetProcAddressARB((const GLubyte*)(p))
// Whee, the X headers define 'Status'. Undefine to avoid confusion.
#undef Status
#endif // LL_LINUX && !LL_MESA_HEADLESS
#if LL_LINUX && defined(WINGDIAPI)

View File

@ -428,7 +428,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents)
// Check if dimensions are a power of two!
if (!checkSize(width,height))
{
llerrs << llformat("Texture has non power of two dimention: %dx%d",width,height) << llendl;
llerrs << llformat("Texture has non power of two dimension: %dx%d",width,height) << llendl;
}
if (mTexName)

View File

@ -148,6 +148,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mBgImage( p.background_image ),
mBgImageDisabled( p.background_image_disabled ),
mBgImageFocused( p.background_image_focused ),
mHaveHistory(FALSE),
mReplaceNewlinesWithSpaces( TRUE ),
mLabel(p.label),
mCursorColor(p.cursor_color()),
@ -164,13 +165,8 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mTripleClickTimer.reset();
setText(p.default_text());
// line history support:
// - initialize line history list
mLineHistory.insert( mLineHistory.end(), "" );
// - disable line history by default
mHaveHistory = FALSE;
// - reset current history line pointer
mCurrentHistoryLine = 0;
// Initialize current history line iterator
mCurrentHistoryLine = mLineHistory.begin();
LLRect border_rect(getLocalRect());
// adjust for gl line drawing glitch
@ -278,16 +274,31 @@ void LLLineEditor::updateHistory()
// reset current history line number.
// Be sure only to remember lines that are not empty and that are
// different from the last on the list.
if( mHaveHistory && mText.length() && ( mLineHistory.empty() || getText() != mLineHistory.back() ) )
if( mHaveHistory && getLength() )
{
// discard possible empty line at the end of the history
// inserted by setText()
if( !mLineHistory.back().length() )
if( !mLineHistory.empty() )
{
mLineHistory.pop_back();
// When not empty, last line of history should always be blank.
if( mLineHistory.back().empty() )
{
// discard the empty line
mLineHistory.pop_back();
}
else
{
LL_WARNS("") << "Last line of history was not blank." << LL_ENDL;
}
}
mLineHistory.insert( mLineHistory.end(), getText() );
mCurrentHistoryLine = mLineHistory.size() - 1;
// Add text to history, ignoring duplicates
if( mLineHistory.empty() || getText() != mLineHistory.back() )
{
mLineHistory.push_back( getText() );
}
// Restore the blank line and set mCurrentHistoryLine to point at it
mLineHistory.push_back( "" );
mCurrentHistoryLine = mLineHistory.end() - 1;
}
}
@ -357,11 +368,8 @@ void LLLineEditor::setText(const LLStringExplicit &new_text)
}
setCursor(llmin((S32)mText.length(), getCursor()));
// Newly set text goes always in the last line of history.
// Possible empty strings (as with chat line) will be deleted later.
mLineHistory.insert( mLineHistory.end(), new_text );
// Set current history line to end of history.
mCurrentHistoryLine = mLineHistory.size() - 1;
mCurrentHistoryLine = mLineHistory.end() - 1;
mPrevText = mText;
}
@ -1254,9 +1262,9 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
case KEY_UP:
if( mHaveHistory && ( MASK_CONTROL == mask ) )
{
if( mCurrentHistoryLine > 0 )
if( mCurrentHistoryLine > mLineHistory.begin() )
{
mText.assign( mLineHistory[ --mCurrentHistoryLine ] );
mText.assign( *(--mCurrentHistoryLine) );
setCursor(llmin((S32)mText.length(), getCursor()));
}
else
@ -1271,9 +1279,9 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
case KEY_DOWN:
if( mHaveHistory && ( MASK_CONTROL == mask ) )
{
if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 )
if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1 )
{
mText.assign( mLineHistory[ ++mCurrentHistoryLine ] );
mText.assign( *(++mCurrentHistoryLine) );
setCursor(llmin((S32)mText.length(), getCursor()));
}
else
@ -2291,14 +2299,20 @@ BOOL LLLineEditor::hasPreeditString() const
void LLLineEditor::resetPreedit()
{
if (hasPreeditString())
if (hasSelection())
{
if (hasSelection())
if (hasPreeditString())
{
llwarns << "Preedit and selection!" << llendl;
deselect();
}
else
{
deleteSelection();
}
}
if (hasPreeditString())
{
const S32 preedit_pos = mPreeditPositions.front();
mText.erase(preedit_pos, mPreeditPositions.back() - preedit_pos);
mText.insert(preedit_pos, mPreeditOverwrittenWString);

View File

@ -286,8 +286,9 @@ protected:
// line history support:
BOOL mHaveHistory; // flag for enabled line history
std::vector<std::string> mLineHistory; // line history storage
U32 mCurrentHistoryLine; // currently browsed history line
typedef std::vector<std::string> line_history_t;
line_history_t mLineHistory; // line history storage
line_history_t::iterator mCurrentHistoryLine; // currently browsed history line
LLViewBorder* mBorder;
const LLFontGL* mGLFont;

View File

@ -279,47 +279,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp)
// the current accelerator key and mask to the provided string.
void LLMenuItemGL::appendAcceleratorString( std::string& st ) const
{
// break early if this is a silly thing to do.
if( KEY_NONE == mAcceleratorKey )
{
return;
}
// Append any masks
#ifdef LL_DARWIN
// Standard Mac names for modifier keys in menu equivalents
// We could use the symbol characters, but they only exist in certain fonts.
if( mAcceleratorMask & MASK_CONTROL )
{
if ( mAcceleratorMask & MASK_MAC_CONTROL )
{
st.append( "Ctrl-" );
}
else
{
st.append( "Cmd-" ); // Symbol would be "\xE2\x8C\x98"
}
}
if( mAcceleratorMask & MASK_ALT )
st.append( "Opt-" ); // Symbol would be "\xE2\x8C\xA5"
if( mAcceleratorMask & MASK_SHIFT )
st.append( "Shift-" ); // Symbol would be "\xE2\x8C\xA7"
#else
if( mAcceleratorMask & MASK_CONTROL )
st.append( "Ctrl-" );
if( mAcceleratorMask & MASK_ALT )
st.append( "Alt-" );
if( mAcceleratorMask & MASK_SHIFT )
st.append( "Shift-" );
#endif
std::string keystr = LLKeyboard::stringFromKey( mAcceleratorKey );
if ((mAcceleratorMask & MASK_NORMALKEYS) &&
(keystr[0] == '-' || keystr[0] == '='))
{
st.append( " " );
}
st.append( keystr );
st = LLKeyboard::stringFromAccelerator( mAcceleratorMask, mAcceleratorKey );
LL_DEBUGS("HotKeys") << "appendAcceleratorString: " << st << LL_ENDL;
}

View File

@ -279,6 +279,14 @@ std::string LLResMgr::getMonetaryString( S32 input ) const
void LLResMgr::getIntegerString( std::string& output, S32 input ) const
{
// handle special case of input value being zero
if (input == 0)
{
output = "0";
return;
}
// *NOTE: this method does not handle negative input integers correctly
S32 fraction = 0;
std::string fraction_string;
S32 remaining_count = input;

View File

@ -51,9 +51,9 @@
// llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life"
// mMessage.setArg("[USERNAME]", "Joe");
// llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life"
// mMessage = "Recepcin a la [SECONDLIFE] [USERNAME]"
// mMessage = "Bienvenido a la [SECONDLIFE] [USERNAME]"
// mMessage.setArg("[SECONDLIFE]", "Segunda Vida");
// llinfos << mMessage.getString() << llendl; // outputs "Recepcin a la Segunda Vida Joe"
// llinfos << mMessage.getString() << llendl; // outputs "Bienvenido a la Segunda Vida Joe"
// Implementation Notes:
// Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have

View File

@ -23,6 +23,7 @@ set(llvfs_HEADER_FILES
CMakeLists.txt
lldir.h
lldirguard.h
lllfsthread.h
llpidlock.h
llvfile.h

View File

@ -404,6 +404,12 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
prefix = getExecutableDir();
break;
case LL_PATH_FONTS:
prefix = getAppRODataDir();
prefix += mDirDelimiter;
prefix += "fonts";
break;
default:
llassert(0);
}
@ -419,6 +425,11 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
filename = subdir1 + mDirDelimiter + filename;
}
if (prefix.empty())
{
llwarns << "prefix is empty, possible bad filename" << llendl;
}
std::string expanded_filename;
if (!filename.empty())
{
@ -673,11 +684,6 @@ void LLDir::dumpCurrentDirectories()
LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL;
LL_DEBUGS2("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL;
LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL;
#if LL_LIBXUL_ENABLED
LL_DEBUGS2("AppInit","Directories") << " HTML Path: " << getExpandedFilename( LL_PATH_HTML, "" ) << llendl;
LL_DEBUGS2("AppInit","Directories") << " Mozilla Profile Path: " << getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) << llendl;
#endif
}

View File

@ -60,6 +60,7 @@ typedef enum ELLPath
// LL_PATH_HTML = 16,
LL_PATH_EXECUTABLE = 16,
LL_PATH_DEFAULT_SKIN = 17,
LL_PATH_FONTS = 18,
LL_PATH_LAST
} ELLPath;

View File

@ -68,7 +68,8 @@ static void CFStringRefToLLString(CFStringRef stringRef, std::string &llString,
{
if (stringRef)
{
long bufferSize = CFStringGetLength(stringRef) + 1;
long stringSize = CFStringGetLength(stringRef) + 1;
long bufferSize = CFStringGetMaximumSizeForEncoding(stringSize,kCFStringEncodingUTF8);
char* buffer = new char[bufferSize];
memset(buffer, 0, bufferSize);
if (CFStringGetCString(stringRef, buffer, bufferSize, kCFStringEncodingUTF8))

View File

@ -121,17 +121,22 @@ LLDir_Win32::LLDir_Win32()
GetCurrentDirectory(MAX_PATH, w_str);
mExecutableDir = utf16str_to_utf8str(llutf16string(w_str));
#endif
// When running in a dev tree, app_settings is under indra/newview/
// but in production it is under Program Files/SecondLife/
// Attempt to detect which one we're using. JC
if (mExecutableDir.find("indra") != std::string::npos)
mAppRODataDir = getCurPath();
else
mAppRODataDir = mExecutableDir;
mAppRODataDir = ".";
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
if (mExecutableDir.find("indra") == std::string::npos)
{
// Running from installed directory. Make sure current
// directory isn't something crazy (e.g. if invoking from
// command line).
SetCurrentDirectory(utf8str_to_utf16str(mExecutableDir).c_str());
GetCurrentDirectory(MAX_PATH, w_str);
mWorkingDir = utf16str_to_utf8str(llutf16string(w_str));
}
llinfos << "mAppRODataDir = " << mAppRODataDir << llendl;
// Build the default cache directory
mDefaultCacheDir = buildSLOSCacheDir();

78
indra/llvfs/lldirguard.h Normal file
View File

@ -0,0 +1,78 @@
/**
* @file lldirguard.h
* @brief Protect working directory from being changed in scope.
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
* Copyright (c) 2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_DIRGUARD_H
#define LL_DIRGUARD_H
#include "linden_common.h"
#include "llerror.h"
#if LL_WINDOWS
class LLDirectoryGuard
{
public:
LLDirectoryGuard()
{
mOrigDirLen = GetCurrentDirectory(MAX_PATH, mOrigDir);
}
~LLDirectoryGuard()
{
mFinalDirLen = GetCurrentDirectory(MAX_PATH, mFinalDir);
if ((mOrigDirLen!=mFinalDirLen) ||
(wcsncmp(mOrigDir,mFinalDir,mOrigDirLen)!=0))
{
// Dir has changed
std::string mOrigDirUtf8 = utf16str_to_utf8str(llutf16string(mOrigDir));
std::string mFinalDirUtf8 = utf16str_to_utf8str(llutf16string(mFinalDir));
llinfos << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << llendl;
SetCurrentDirectory(mOrigDir);
}
}
private:
TCHAR mOrigDir[MAX_PATH];
DWORD mOrigDirLen;
TCHAR mFinalDir[MAX_PATH];
DWORD mFinalDirLen;
};
#else // No-op outside Windows.
class LLDirectoryGuard
{
public:
LLDirectoryGuard() {}
~LLDirectoryGuard() {}
};
#endif
#endif

View File

@ -36,7 +36,6 @@
#include "llwindowcallbacks.h"
//
// Globals
//
@ -46,6 +45,8 @@ LLKeyboard *gKeyboard = NULL;
//static
std::map<KEY,std::string> LLKeyboard::sKeysToNames;
std::map<std::string,KEY> LLKeyboard::sNamesToKeys;
LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = NULL; // Used for l10n + PC/Mac/Linux accelerator labeling
//
// Class Implementation
@ -346,6 +347,65 @@ std::string LLKeyboard::stringFromKey(KEY key)
}
//static
std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key )
{
std::string res;
// break early if this is a silly thing to do.
if( KEY_NONE == key )
{
return res;
}
LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator;
if( trans == NULL )
{
llerrs << "No mKeyStringTranslator" << llendl;
return res;
}
// Append any masks
#ifdef LL_DARWIN
// Standard Mac names for modifier keys in menu equivalents
// We could use the symbol characters, but they only exist in certain fonts.
if( accel_mask & MASK_CONTROL )
{
if ( accel_mask & MASK_MAC_CONTROL )
{
res.append( trans("accel-mac-control") );
}
else
{
res.append( trans("accel-mac-command") ); // Symbol would be "\xE2\x8C\x98"
}
}
if( accel_mask & MASK_ALT )
res.append( trans("accel-mac-option") ); // Symbol would be "\xE2\x8C\xA5"
if( accel_mask & MASK_SHIFT )
res.append( trans("accel-mac-shift") ); // Symbol would be "\xE2\x8C\xA7"
#else
if( accel_mask & MASK_CONTROL )
res.append( trans("accel-win-control") );
if( accel_mask & MASK_ALT )
res.append( trans("accel-win-alt") );
if( accel_mask & MASK_SHIFT )
res.append( trans("accel-win-shift") );
#endif
std::string key_string = LLKeyboard::stringFromKey(key);
if ((accel_mask & MASK_NORMALKEYS) &&
(key_string[0] == '-' || key_string[0] == '=' || key_string[0] == '+'))
{
res.append( " " );
}
std::string keystr = stringFromKey( key );
res.append( keystr );
return res;
}
//static
BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask)
@ -396,3 +456,10 @@ BOOL LLKeyboard::maskFromString(const std::string& str, MASK *mask)
return FALSE;
}
}
//static
void LLKeyboard::setStringTranslatorFunc( LLKeyStringTranslatorFunc *trans_func )
{
mStringTranslator = trans_func;
}

View File

@ -47,7 +47,8 @@ enum EKeystate
};
typedef void (*LLKeyFunc)(EKeystate keystate);
typedef std::string (LLKeyStringTranslatorFunc)(const char *label);
enum EKeyboardInsertMode
{
LL_KIM_INSERT,
@ -111,7 +112,7 @@ public:
static BOOL maskFromString(const std::string& str, MASK *mask); // False on failure
static BOOL keyFromString(const std::string& str, KEY *key); // False on failure
static std::string stringFromKey(KEY key);
static std::string stringFromAccelerator( MASK accel_mask, KEY key );
e_numpad_distinct getNumpadDistinct() { return mNumpadDistinct; }
void setNumpadDistinct(e_numpad_distinct val) { mNumpadDistinct = val; }
@ -119,6 +120,8 @@ public:
F32 getKeyElapsedTime( KEY key ); // Returns time in seconds since key was pressed.
S32 getKeyElapsedFrameCount( KEY key ); // Returns time in frames since key was pressed.
static void setStringTranslatorFunc( LLKeyStringTranslatorFunc *trans_func );
protected:
void addKeyName(KEY key, const std::string& name);
@ -136,6 +139,8 @@ protected:
KEY mCurTranslatedKey;
KEY mCurScanKey; // Used during the scanKeyboard()
static LLKeyStringTranslatorFunc* mStringTranslator; // Used for l10n + PC/Mac/Linux accelerator labeling
e_numpad_distinct mNumpadDistinct;
EKeyboardInsertMode mInsertMode;

View File

@ -65,7 +65,7 @@ LLKeyboardWin32::LLKeyboardWin32()
// numpad number keys
for (cur_char = 0x60; cur_char <= 0x69; cur_char++)
{
mTranslateKeyMap[cur_char] = (KEY)('0' + (0x60 - cur_char));
mTranslateKeyMap[cur_char] = (KEY)('0' + (cur_char - 0x60));
}

View File

@ -1389,11 +1389,11 @@ void LLWindowMacOSX::setMouseClipping( BOOL b )
if(b)
{
// llinfos << "setMouseClipping(TRUE)" << llendl
// llinfos << "setMouseClipping(TRUE)" << llendl;
}
else
{
// llinfos << "setMouseClipping(FALSE)" << llendl
// llinfos << "setMouseClipping(FALSE)" << llendl;
}
adjustCursorDecouple();
@ -1411,7 +1411,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
CGPoint newPosition;
// llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl
// llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl;
newPosition.x = screen_pos.mX;
newPosition.y = screen_pos.mY;

View File

@ -70,7 +70,7 @@ extern BOOL gDebugWindowProc;
const S32 MAX_NUM_RESOLUTIONS = 200;
// static variable for ATI mouse cursor crash work-around:
static bool ATIbug = false;
static bool ATIbug = false;
//
// LLWindowSDL
@ -219,8 +219,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
#endif // LL_X11
#if LL_GTK
// We MUST be the first to initialize GTK, i.e. we have to beat
// our embedded Mozilla to the punch so that GTK doesn't get badly
// We MUST be the first to initialize GTK so that GTK doesn't get badly
// initialized with a non-C locale and cause lots of serious random
// weirdness.
ll_try_gtk_init();
@ -674,12 +673,12 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
glGetIntegerv(GL_DEPTH_BITS, &depthBits);
glGetIntegerv(GL_STENCIL_BITS, &stencilBits);
llinfos << "GL buffer:" << llendl
llinfos << " Red Bits " << S32(redBits) << llendl
llinfos << " Green Bits " << S32(greenBits) << llendl
llinfos << " Blue Bits " << S32(blueBits) << llendl
llinfos << " Alpha Bits " << S32(alphaBits) << llendl
llinfos << " Depth Bits " << S32(depthBits) << llendl
llinfos << "GL buffer:" << llendl;
llinfos << " Red Bits " << S32(redBits) << llendl;
llinfos << " Green Bits " << S32(greenBits) << llendl;
llinfos << " Blue Bits " << S32(blueBits) << llendl;
llinfos << " Alpha Bits " << S32(alphaBits) << llendl;
llinfos << " Depth Bits " << S32(depthBits) << llendl;
llinfos << " Stencil Bits " << S32(stencilBits) << llendl;
GLint colorBits = redBits + greenBits + blueBits + alphaBits;
@ -2252,6 +2251,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)
GtkColorSelection *colorsel = GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG(win)->colorsel);
GdkColor color, orig_color;
orig_color.pixel = 0;
orig_color.red = guint16(65535 * *r);
orig_color.green= guint16(65535 * *g);
orig_color.blue = guint16(65535 * *b);

View File

@ -103,6 +103,11 @@ public:
return findString(result, xml_desc, empty);
}
static std::string getKeyboardString(const char* keystring)
{
// These map directly - no need to specialize
return getString( ll_safe_string(keystring) );
}
// get the default args
static const LLStringUtil::format_map_t& getDefaultArgs()

View File

@ -1025,7 +1025,7 @@ endif (DARWIN)
if (LINUX)
LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp)
LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp)
LIST(APPEND CMAKE_EXE_LINKER_FLAGS -Wl,--as-needed)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
set(viewer_LIBRARIES
Xinerama
@ -1113,7 +1113,9 @@ if (WINDOWS)
SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES})
list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})
if (NOT STANDALONE)
list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})
endif (NOT STANDALONE)
find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR})
find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR})
@ -1223,8 +1225,9 @@ source_group("Character File" FILES ${viewer_CHARACTER_FILES})
set_source_files_properties(${viewer_CHARACTER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES})
if (NOT STANDALONE)
list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES})
endif (NOT STANDALONE)
if (WINDOWS)
file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi)

View File

@ -459,6 +459,7 @@ PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allo
PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land
PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage
PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects
PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects
PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group
PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents
PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list

View File

@ -1599,7 +1599,7 @@
<key>Cursor3D</key>
<map>
<key>Comment</key>
<string>Tread Joystick values as absolute positions (not deltas).</string>
<string>Treat Joystick values as absolute positions (not deltas).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -3851,6 +3851,17 @@
<key>Value</key>
<string />
</map>
<key>JoystickMouselookYaw</key>
<map>
<key>Comment</key>
<string>Pass joystick yaw to scripts in Mouselook.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>JoystickRunThreshold</key>
<map>
<key>Comment</key>
@ -4158,7 +4169,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>LipSyncOoh</key>
<map>

View File

@ -330,7 +330,7 @@ LLAgent::LLAgent() :
mLeftKey(0),
mUpKey(0),
mYawKey(0.f),
mPitchKey(0),
mPitchKey(0.f),
mOrbitLeftKey(0.f),
mOrbitRightKey(0.f),
@ -723,15 +723,15 @@ void LLAgent::moveYaw(F32 mag, bool reset_view)
//-----------------------------------------------------------------------------
// movePitch()
//-----------------------------------------------------------------------------
void LLAgent::movePitch(S32 direction)
void LLAgent::movePitch(F32 mag)
{
setKey(direction, mPitchKey);
mPitchKey = mag;
if (direction > 0)
if (mag > 0)
{
setControlFlags(AGENT_CONTROL_PITCH_POS );
setControlFlags(AGENT_CONTROL_PITCH_POS);
}
else if (direction < 0)
else if (mag < 0)
{
setControlFlags(AGENT_CONTROL_PITCH_NEG);
}
@ -2509,10 +2509,10 @@ void LLAgent::propagate(const F32 dt)
// handle rotation based on keyboard levels
const F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second
yaw( YAW_RATE * mYawKey * dt );
yaw(YAW_RATE * mYawKey * dt);
const F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second
pitch(PITCH_RATE * (F32) mPitchKey * dt);
pitch(PITCH_RATE * mPitchKey * dt);
// handle auto-land behavior
if (mAvatarObject.notNull())
@ -2537,7 +2537,7 @@ void LLAgent::propagate(const F32 dt)
mLeftKey = 0;
mUpKey = 0;
mYawKey = 0.f;
mPitchKey = 0;
mPitchKey = 0.f;
}
//-----------------------------------------------------------------------------
@ -3168,6 +3168,7 @@ void LLAgent::updateCamera()
mFollowCam.copyParams(*current_cam);
mFollowCam.setSubjectPositionAndRotation( mAvatarObject->getRenderPosition(), avatarRotationForFollowCam );
mFollowCam.update();
LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
}
else
{
@ -4245,7 +4246,7 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL camera_ani
{
if(avatar_animate)
{
// Remove any pitch from the avatar
// Remove any pitch from the avatar
LLVector3 at = mFrameAgent.getAtAxis();
at.mV[VZ] = 0.f;
at.normalize();

View File

@ -471,7 +471,7 @@ private:
S32 mLeftKey;
S32 mUpKey;
F32 mYawKey;
S32 mPitchKey;
F32 mPitchKey;
//--------------------------------------------------------------------
// Movement from user input
@ -486,7 +486,7 @@ public:
void moveLeftNudge(S32 direction);
void moveUp(S32 direction);
void moveYaw(F32 mag, bool reset_view = true);
void movePitch(S32 direction);
void movePitch(F32 mag);
//--------------------------------------------------------------------
// Orbit

View File

@ -686,8 +686,12 @@ bool LLAppViewer::init()
LLUI::setupPaths();
LLTransUtil::parseStrings("strings.xml", default_trans_args);
LLTransUtil::parseLanguageStrings("language_settings.xml");
LLWeb::initClass(); // do this after LLUI
// LLKeyboard relies on LLUI to know what some accelerator keys are called.
LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString );
LLWeb::initClass(); // do this after LLUI
// Provide the text fields with callbacks for opening Urls
LLUrlAction::setOpenURLCallback(&LLWeb::loadURL);
LLUrlAction::setOpenURLInternalCallback(&LLWeb::loadURLInternal);
@ -1802,8 +1806,18 @@ bool LLAppViewer::initConfiguration()
gSavedSettings.setString("VersionChannelName", LL_CHANNEL);
#ifndef LL_RELEASE_FOR_DOWNLOAD
gSavedSettings.setBOOL("ShowConsoleWindow", TRUE);
gSavedSettings.setBOOL("AllowMultipleViewers", TRUE);
// provide developer build only overrides for these control variables that are not
// persisted to settings.xml
LLControlVariable* c = gSavedSettings.getControl("ShowConsoleWindow");
if (c)
{
c->setValue(true, false);
}
c = gSavedSettings.getControl("AllowMultipleViewers");
if (c)
{
c->setValue(true, false);
}
#endif
//*FIX:Mani - Set default to disabling watchdog mainloop

View File

@ -188,7 +188,7 @@ static inline BOOL do_basic_glibc_backtrace()
for (i = 0; i < size; i++)
{
// the format of the StraceFile is very specific, to allow (kludgy) machine-parsing
fprintf(StraceFile, "%-3d ", i);
fprintf(StraceFile, "%-3lu ", (unsigned long)i);
fprintf(StraceFile, "%-32s\t", "unknown");
fprintf(StraceFile, "%p ", stackarray[i]);
fprintf(StraceFile, "%s\n", strings[i]);
@ -263,7 +263,7 @@ static inline BOOL do_elfio_glibc_backtrace()
for (btpos = 0; btpos < btsize; ++btpos)
{
// the format of the StraceFile is very specific, to allow (kludgy) machine-parsing
fprintf(StraceFile, "%-3d ", btpos);
fprintf(StraceFile, "%-3ld ", (long)btpos);
int symidx;
for (symidx = 0; symidx < nSymNo; ++symidx)
{
@ -354,7 +354,7 @@ bool LLAppViewerLinux::init()
bool LLAppViewerLinux::restoreErrorTrap()
{
// *NOTE:Mani there is a case for implementing this or the mac.
// *NOTE:Mani there is a case for implementing this on the mac.
// Linux doesn't need it to my knowledge.
return true;
}
@ -727,8 +727,26 @@ std::string LLAppViewerLinux::generateSerialNumber()
{
char serial_md5[MD5HEX_STR_SIZE];
serial_md5[0] = 0;
std::string best;
std::string uuiddir("/dev/disk/by-uuid/");
// TODO
// trawl /dev/disk/by-uuid looking for a good-looking UUID to grab
std::string this_name;
BOOL wrap = FALSE;
while (gDirUtilp->getNextFileInDir(uuiddir, "*", this_name, wrap))
{
if (this_name.length() > best.length() ||
(this_name.length() == best.length() &&
this_name > best))
{
// longest (and secondarily alphabetically last) so far
best = this_name;
}
}
// we don't return the actual serial number, just a hash of it.
LLMD5 md5( reinterpret_cast<const unsigned char*>(best.c_str()) );
md5.hex_digest(serial_md5);
return serial_md5;
}

View File

@ -33,9 +33,12 @@
#ifndef LL_LLAPPVIEWERLINUX_H
#define LL_LLAPPVIEWERLINUX_H
#if LL_DBUS_ENABLED
extern "C" {
# include <glib.h>
}
#if LL_DBUS_ENABLED
extern "C" {
# include <glib-object.h>
# include <dbus/dbus-glib.h>
}

View File

@ -41,9 +41,9 @@ extern "C" {
#include "apr_dso.h"
}
#define DEBUGMSG(...) lldebugs << llformat(__VA_ARGS__) << llendl
#define INFOMSG(...) llinfos << llformat(__VA_ARGS__) << llendl
#define WARNMSG(...) llwarns << llformat(__VA_ARGS__) << llendl
#define DEBUGMSG(...) do { lldebugs << llformat(__VA_ARGS__) << llendl; } while(0)
#define INFOMSG(...) do { llinfos << llformat(__VA_ARGS__) << llendl; } while(0)
#define WARNMSG(...) do { llwarns << llformat(__VA_ARGS__) << llendl; } while(0)
#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL
#include "llappviewerlinux_api_dbus_syms_raw.inc"

View File

@ -159,15 +159,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)
clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number");
clp.setCustomParser(parse_psn);
// First parse the command line, not often used on the mac.
if(clp.parseCommandLine(gArgC, gArgV) == false)
{
return false;
}
// Now read in the args from arguments txt.
// Succesive calls to clp.parse... will NOT override earlier
// options.
// First read in the args from arguments txt.
const char* filename = "arguments.txt";
llifstream ifs(filename, llifstream::binary);
if (!ifs.is_open())
@ -180,7 +172,14 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)
{
return false;
}
// Then parse the user's command line, so that any --url arg can appear last
// Succesive calls to clp.parse... will NOT override earlier options.
if(clp.parseCommandLine(gArgC, gArgV) == false)
{
return false;
}
// Get the user's preferred language string based on the Mac OS localization mechanism.
// To add a new localization:
// go to the "Resources" section of the project

View File

@ -369,7 +369,7 @@ void LLDrawPoolWater::shade()
LLVector3 light_dir;
LLColor3 light_color;
if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS)
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
{
light_dir = gSky.getSunDirection();
light_dir.normVec();

View File

@ -426,8 +426,8 @@ void LLFloaterAnimPreview::resetMotion()
LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()];
avatarp->deactivateAllMotions();
avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET);
avatarp->startMotion(mMotionID, 0.0f);
avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET);
childSetValue("playback_slider", 0.0f);
// Set pose
@ -638,10 +638,10 @@ void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data)
BOOL paused = avatarp->areAnimationsPaused();
// stop all other possible base motions
avatarp->stopMotion(ANIM_AGENT_STAND, TRUE);
avatarp->stopMotion(ANIM_AGENT_WALK, TRUE);
avatarp->stopMotion(ANIM_AGENT_SIT, TRUE);
avatarp->stopMotion(ANIM_AGENT_HOVER, TRUE);
avatarp->stopMotion(previewp->mIDList["Standing"], TRUE);
avatarp->stopMotion(previewp->mIDList["Walking"], TRUE);
avatarp->stopMotion(previewp->mIDList["Sitting"], TRUE);
avatarp->stopMotion(previewp->mIDList["Flying"], TRUE);
previewp->resetMotion();

View File

@ -33,6 +33,7 @@
#include "llviewerprecompiledheaders.h"
#include "llfloaterauction.h"
#include "llfloaterregioninfo.h"
#include "lldir.h"
#include "llgl.h"
@ -56,6 +57,7 @@
#include "llviewercontrol.h"
#include "llui.h"
#include "llrender.h"
#include "llsdutil.h"
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
@ -77,7 +79,9 @@ LLFloaterAuction::LLFloaterAuction(const LLSD& key)
{
// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml");
mCommitCallbackRegistrar.add("ClickSnapshot", boost::bind(&LLFloaterAuction::onClickSnapshot, this));
mCommitCallbackRegistrar.add("ClickOK", boost::bind(&LLFloaterAuction::onClickOK, this));
mCommitCallbackRegistrar.add("ClickSellToAnyone", boost::bind(&LLFloaterAuction::onClickSellToAnyone, this));
mCommitCallbackRegistrar.add("ClickStartAuction", boost::bind(&LLFloaterAuction::onClickStartAuction, this));
mCommitCallbackRegistrar.add("ClickResetParcel", boost::bind(&LLFloaterAuction::onClickResetParcel, this));
}
// Destroys the object
@ -97,6 +101,8 @@ void LLFloaterAuction::onOpen(const LLSD& key)
void LLFloaterAuction::initialize()
{
mParcelUpdateCapUrl.clear();
mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
LLParcel* parcelp = mParcelp->getParcel();
@ -104,10 +110,23 @@ void LLFloaterAuction::initialize()
{
mParcelHost = region->getHost();
mParcelID = parcelp->getLocalID();
mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate");
childSetText("parcel_text", parcelp->getName());
childEnable("snapshot_btn");
childEnable("ok_btn");
childEnable("reset_parcel_btn");
childEnable("start_auction_btn");
LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
if (panel)
{ // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet
U32 estate_id = panel->getEstateID();
childSetEnabled("sell_to_anyone_btn", (estate_id == ESTATE_TEEN || estate_id == 0));
}
else
{ // Don't have the panel up, so don't know if we're on the teen grid or not. Default to enabling it
childEnable("sell_to_anyone_btn");
}
}
else
{
@ -122,8 +141,11 @@ void LLFloaterAuction::initialize()
}
mParcelID = -1;
childSetEnabled("snapshot_btn", false);
childSetEnabled("ok_btn", false);
childSetEnabled("reset_parcel_btn", false);
childSetEnabled("sell_to_anyone_btn", false);
childSetEnabled("start_auction_btn", false);
}
mImageID.setNull();
mImage = NULL;
}
@ -205,7 +227,7 @@ void LLFloaterAuction::onClickSnapshot(void* data)
}
// static
void LLFloaterAuction::onClickOK(void* data)
void LLFloaterAuction::onClickStartAuction(void* data)
{
LLFloaterAuction* self = (LLFloaterAuction*)(data);
@ -244,11 +266,264 @@ void LLFloaterAuction::onClickOK(void* data)
msg->sendReliable(self->mParcelHost);
// clean up floater, and get out
self->mImageID.setNull();
self->mImage = NULL;
self->mParcelID = -1;
self->mParcelHost.invalidate();
self->closeFloater();
self->cleanupAndClose();
}
void LLFloaterAuction::cleanupAndClose()
{
mImageID.setNull();
mImage = NULL;
mParcelID = -1;
mParcelHost.invalidate();
closeFloater();
}
// static glue
void LLFloaterAuction::onClickResetParcel(void* data)
{
LLFloaterAuction* self = (LLFloaterAuction*)(data);
if (self)
{
self->doResetParcel();
}
}
// Reset all the values for the parcel in preparation for a sale
void LLFloaterAuction::doResetParcel()
{
LLParcel* parcelp = mParcelp->getParcel();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if (parcelp
&& region
&& !mParcelUpdateCapUrl.empty())
{
LLSD body;
std::string empty;
// request new properties update from simulator
U32 message_flags = 0x01;
body["flags"] = ll_sd_from_U32(message_flags);
// Set all the default parcel properties for auction
body["local_id"] = parcelp->getLocalID();
U32 parcel_flags = PF_ALLOW_LANDMARK |
PF_ALLOW_FLY |
PF_CREATE_GROUP_OBJECTS |
PF_ALLOW_ALL_OBJECT_ENTRY |
PF_ALLOW_GROUP_OBJECT_ENTRY |
PF_ALLOW_GROUP_SCRIPTS |
PF_RESTRICT_PUSHOBJECT |
PF_SOUND_LOCAL |
PF_ALLOW_VOICE_CHAT |
PF_USE_ESTATE_VOICE_CHAN;
body["parcel_flags"] = ll_sd_from_U32(parcel_flags);
// Build a parcel name like "Ahern (128,128) PG 4032m"
std::ostringstream parcel_name;
LLVector3 center_point( parcelp->getCenterpoint() );
center_point.snap(0); // Get rid of fractions
parcel_name << region->getName()
<< " ("
<< (S32) center_point.mV[VX]
<< ","
<< (S32) center_point.mV[VY]
<< ") "
<< region->getSimAccessString()
<< " "
<< parcelp->getArea()
<< "m";
std::string new_name(parcel_name.str().c_str());
body["name"] = new_name;
childSetText("parcel_text", new_name); // Set name in dialog as well, since it won't get updated otherwise
body["sale_price"] = (S32) 0;
body["description"] = empty;
body["music_url"] = empty;
body["media_url"] = empty;
body["media_desc"] = empty;
body["media_type"] = std::string("none/none");
body["media_width"] = (S32) 0;
body["media_height"] = (S32) 0;
body["auto_scale"] = (S32) 0;
body["media_loop"] = (S32) 0;
body["obscure_media"] = (S32) 0;
body["obscure_music"] = (S32) 0;
body["media_id"] = LLUUID::null;
body["group_id"] = MAINTENANCE_GROUP_ID; // Use maintenance group
body["pass_price"] = (S32) 10; // Defaults to $10
body["pass_hours"] = 0.0f;
body["category"] = (U8) LLParcel::C_NONE;
body["auth_buyer_id"] = LLUUID::null;
body["snapshot_id"] = LLUUID::null;
body["user_location"] = ll_sd_from_vector3( LLVector3::zero );
body["user_look_at"] = ll_sd_from_vector3( LLVector3::zero );
body["landing_type"] = (U8) LLParcel::L_DIRECT;
llinfos << "Sending parcel update to reset for auction via capability to: "
<< mParcelUpdateCapUrl << llendl;
LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder());
// Send a message to clear the object return time
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ParcelSetOtherCleanTime);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, parcelp->getLocalID());
msg->addS32Fast(_PREHASH_OtherCleanTime, 5); // 5 minute object auto-return
msg->sendReliable(region->getHost());
// Clear the access lists
clearParcelAccessLists(parcelp, region);
}
}
void LLFloaterAuction::clearParcelAccessLists(LLParcel* parcel, LLViewerRegion* region)
{
if (!region || !parcel) return;
LLUUID transactionUUID;
transactionUUID.generate();
LLMessageSystem* msg = gMessageSystem;
// Clear access list
// parcel->mAccessList.clear();
msg->newMessageFast(_PREHASH_ParcelAccessListUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->nextBlockFast(_PREHASH_Data);
msg->addU32Fast(_PREHASH_Flags, AL_ACCESS);
msg->addS32(_PREHASH_LocalID, parcel->getLocalID() );
msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID);
msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id
msg->addS32Fast(_PREHASH_Sections, 0); // num_sections
// pack an empty block since there will be no data
msg->nextBlockFast(_PREHASH_List);
msg->addUUIDFast(_PREHASH_ID, LLUUID::null );
msg->addS32Fast(_PREHASH_Time, 0 );
msg->addU32Fast(_PREHASH_Flags, 0 );
msg->sendReliable( region->getHost() );
// Send message for empty ban list
//parcel->mBanList.clear();
msg->newMessageFast(_PREHASH_ParcelAccessListUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
msg->nextBlockFast(_PREHASH_Data);
msg->addU32Fast(_PREHASH_Flags, AL_BAN);
msg->addS32(_PREHASH_LocalID, parcel->getLocalID() );
msg->addUUIDFast(_PREHASH_TransactionID, transactionUUID);
msg->addS32Fast(_PREHASH_SequenceID, 1); // sequence_id
msg->addS32Fast(_PREHASH_Sections, 0); // num_sections
// pack an empty block since there will be no data
msg->nextBlockFast(_PREHASH_List);
msg->addUUIDFast(_PREHASH_ID, LLUUID::null );
msg->addS32Fast(_PREHASH_Time, 0 );
msg->addU32Fast(_PREHASH_Flags, 0 );
msg->sendReliable( region->getHost() );
}
// static - 'Sell to Anyone' clicked, throw up a confirmation dialog
void LLFloaterAuction::onClickSellToAnyone(void* data)
{
LLFloaterAuction* self = (LLFloaterAuction*)(data);
if (self)
{
LLParcel* parcelp = self->mParcelp->getParcel();
// Do a confirmation
S32 sale_price = parcelp->getArea(); // Selling for L$1 per meter
S32 area = parcelp->getArea();
LLSD args;
args["LAND_SIZE"] = llformat("%d", area);
args["SALE_PRICE"] = llformat("%d", sale_price);
args["NAME"] = "Anyone";
LLNotification::Params params("ConfirmLandSaleChange"); // Re-use existing dialog
params.substitutions(args)
.functor.function(boost::bind(&LLFloaterAuction::onSellToAnyoneConfirmed, self, _1, _2));
params.name("ConfirmLandSaleToAnyoneChange");
// ask away
LLNotifications::instance().add(params);
}
}
// Sell confirmation clicked
bool LLFloaterAuction::onSellToAnyoneConfirmed(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
doSellToAnyone();
}
return false;
}
// Reset all the values for the parcel in preparation for a sale
void LLFloaterAuction::doSellToAnyone()
{
LLParcel* parcelp = mParcelp->getParcel();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if (parcelp
&& region
&& !mParcelUpdateCapUrl.empty())
{
LLSD body;
std::string empty;
// request new properties update from simulator
U32 message_flags = 0x01;
body["flags"] = ll_sd_from_U32(message_flags);
// Set all the default parcel properties for auction
body["local_id"] = parcelp->getLocalID();
// Set 'for sale' flag
U32 parcel_flags = parcelp->getParcelFlags() | PF_FOR_SALE;
// Ensure objects not included
parcel_flags &= ~PF_FOR_SALE_OBJECTS;
body["parcel_flags"] = ll_sd_from_U32(parcel_flags);
body["sale_price"] = parcelp->getArea(); // Sell for L$1 per square meter
body["auth_buyer_id"] = LLUUID::null; // To anyone
llinfos << "Sending parcel update to sell to anyone for L$1 via capability to: "
<< mParcelUpdateCapUrl << llendl;
LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder());
// clean up floater, and get out
cleanupAndClose();
}
}

View File

@ -45,6 +45,8 @@
// Class which holds the functionality to start auctions.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLParcelSelection;
class LLParcel;
class LLViewerRegion;
class LLFloaterAuction : public LLFloater
{
@ -62,16 +64,28 @@ private:
void initialize();
static void onClickSnapshot(void* data);
static void onClickOK(void* data);
static void onClickResetParcel(void* data);
static void onClickSellToAnyone(void* data); // Sell to anyone clicked
bool onSellToAnyoneConfirmed(const LLSD& notification, const LLSD& response); // Sell confirmation clicked
static void onClickStartAuction(void* data);
/*virtual*/ BOOL postBuild();
void doResetParcel();
void doSellToAnyone();
void clearParcelAccessLists( LLParcel* parcel, LLViewerRegion* region );
void cleanupAndClose();
private:
LLTransactionID mTransactionID;
LLAssetID mImageID;
LLPointer<LLViewerTexture> mImage;
LLSafeHandle<LLParcelSelection> mParcelp;
S32 mParcelID;
LLHost mParcelHost;
std::string mParcelUpdateCapUrl; // "ParcelPropertiesUpdate" capability
};

View File

@ -69,7 +69,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback,
// Default constructor
LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key)
: LLFloater(key),
mResultsReturned(FALSE),
mNumResultsReturned(0),
mCallback(NULL),
mCallbackUserdata(NULL),
mNearMeListComplete(FALSE),
@ -314,7 +314,7 @@ void LLFloaterAvatarPicker::find()
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
childSetEnabled("Select", FALSE);
mResultsReturned = FALSE;
mNumResultsReturned = 0;
}
void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple)
@ -349,9 +349,10 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
LLScrollListCtrl* search_results = floater->getChild<LLScrollListCtrl>("SearchResults");
// clear "Searching" label on first results
search_results->deleteAllItems();
floater->mResultsReturned = TRUE;
if (floater->mNumResultsReturned++ == 0)
{
search_results->deleteAllItems();
}
BOOL found_one = FALSE;
S32 num_new_rows = msg->getNumberOfBlocks("Data");

View File

@ -76,7 +76,7 @@ private:
virtual BOOL handleKeyHere(KEY key, MASK mask);
LLUUID mQueryID;
BOOL mResultsReturned;
int mNumResultsReturned;
BOOL mNearMeListComplete;
BOOL mCloseOnSelect;

View File

@ -211,25 +211,16 @@ void LLFloaterGesture::buildGestureList()
std::string key_string = LLKeyboard::stringFromKey(gesture->mKey);
std::string buffer;
if (gesture->mKey == KEY_NONE)
{
if (gesture->mKey == KEY_NONE)
{
buffer = "---";
key_string = "~~~"; // alphabetize to end
}
else
{
if (gesture->mMask & MASK_CONTROL) buffer.append("Ctrl-");
if (gesture->mMask & MASK_ALT) buffer.append("Alt-");
if (gesture->mMask & MASK_SHIFT) buffer.append("Shift-");
if ((gesture->mMask & (MASK_CONTROL|MASK_ALT|MASK_SHIFT)) &&
(key_string[0] == '-' || key_string[0] == '='))
{
buffer.append(" ");
}
buffer.append(key_string);
}
buffer = "---";
key_string = "~~~"; // alphabetize to end
}
else
{
buffer = LLKeyboard::stringFromAccelerator( gesture->mMask, gesture->mKey );
}
element["columns"][1]["column"] = "shortcut";
element["columns"][1]["value"] = buffer;
element["columns"][1]["font"]["name"] = "SANSSERIF";

View File

@ -105,7 +105,7 @@ public:
// LLFloaterLand
//---------------------------------------------------------------------------
void send_parcel_select_objects(S32 parcel_local_id, S32 return_type,
void send_parcel_select_objects(S32 parcel_local_id, U32 return_type,
uuid_list_t* return_ids = NULL)
{
LLMessageSystem *msg = gMessageSystem;
@ -123,7 +123,7 @@ void send_parcel_select_objects(S32 parcel_local_id, S32 return_type,
msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, parcel_local_id);
msg->addS32Fast(_PREHASH_ReturnType, return_type);
msg->addU32Fast(_PREHASH_ReturnType, return_type);
// Throw all return ids into the packet.
// TODO: Check for too many ids.

View File

@ -143,6 +143,7 @@ BOOL LLFloaterReporter::postBuild()
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
childSetText("sim_field", regionp->getName());
pos -= regionp->getOriginGlobal();
}
setPosBox(pos);

View File

@ -47,7 +47,7 @@
#include "llviewerwindow.h"
// defined in llfloaterland.cpp
void send_parcel_select_objects(S32 parcel_local_id, S32 return_type,
void send_parcel_select_objects(S32 parcel_local_id, U32 return_type,
uuid_list_t* return_ids = NULL);
enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR };

View File

@ -417,6 +417,11 @@ void LLFloaterTools::refresh()
LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
childSetTextArg("prim_count", "[COUNT]", prim_count_string);
// disable the object and prim counts if nothing selected
bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty();
childSetEnabled("obj_count", have_selection);
childSetEnabled("prim_count", have_selection);
// Refresh child tabs
mPanelPermissions->refresh();
mPanelObject->refresh();

View File

@ -49,6 +49,7 @@
#include "llfirstuse.h"
#include "llfloaterreg.h" // getTypedInstance()
#include "llfocusmgr.h"
#include "llinventorymodel.h"
#include "lllandmarklist.h"
#include "lllineeditor.h"
#include "llregionhandle.h"
@ -57,7 +58,7 @@
#include "lltabcontainer.h"
#include "lltextbox.h"
#include "lltracker.h"
#include "llinventorymodel.h"
#include "lltrans.h"
#include "llviewerinventory.h" // LLViewerInventoryItem
#include "llviewermenu.h"
#include "llviewerregion.h"
@ -151,7 +152,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
mFriendObserver(NULL),
mCompletingRegionName(""),
mWaitingForTracker(FALSE),
mExactMatch(FALSE),
mIsClosing(FALSE),
mSetToUserPosition(TRUE),
mTrackedLocation(0,0,0),
@ -903,7 +903,6 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
}
LLWorldMap::getInstance()->mIsTrackingCommit = FALSE;
mCompletingRegionName = "";
mExactMatch = FALSE;
}
@ -1163,7 +1162,6 @@ void LLFloaterWorldMap::onLocationCommit()
LLStringUtil::toLower(str);
mCompletingRegionName = str;
LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
mExactMatch = FALSE;
if (str.length() >= 3)
{
LLWorldMap::getInstance()->sendNamedRegionRequest(str);
@ -1418,11 +1416,10 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
LLSD selected_value = list->getSelectedValue();
S32 name_length = mCompletingRegionName.length();
BOOL match_found = FALSE;
LLSD match;
S32 num_results = 0;
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
@ -1434,15 +1431,11 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
{
if (LLWorldMap::getInstance()->mIsTrackingCommit)
if (sim_name_lower == mCompletingRegionName)
{
if (sim_name_lower == mCompletingRegionName)
{
selected_value = sim_name;
match_found = TRUE;
}
match = sim_name;
}
LLSD value;
value["id"] = sim_name;
value["columns"][0]["column"] = "sim_name";
@ -1451,29 +1444,24 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
num_results++;
}
}
list->selectByValue(selected_value);
if (found_null_sim)
{
mCompletingRegionName = "";
}
if (match_found)
// if match found, highlight it and go
if (!match.isUndefined())
{
mExactMatch = TRUE;
list->selectByValue(match);
childSetFocus("search_results");
onCommitSearchResult();
}
else if (!mExactMatch && num_results > 0)
// if we found nothing, say "none"
if (num_results == 0)
{
list->selectFirstItem(); // select first item by default
childSetFocus("search_results");
onCommitSearchResult();
}
else if (num_results == 0)
{
list->setCommentText(std::string("None found."));
list->setCommentText(LLTrans::getString("worldmap_results_none_found"));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}

View File

@ -174,7 +174,6 @@ protected:
std::string mCompletingRegionName;
std::string mLastRegionName;
BOOL mWaitingForTracker;
BOOL mExactMatch;
BOOL mIsClosing;
BOOL mSetToUserPosition;

View File

@ -1654,6 +1654,8 @@ void LLFloaterIMPanel::sendMsg()
LLWString text = mInputEditor->getConvertedText();
if(!text.empty())
{
// store sent line in history, duplicates will get filtered
if (mInputEditor) mInputEditor->updateHistory();
// Truncate and convert to UTF8 for transport
std::string utf8_text = wstring_to_utf8str(text);
utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1);

View File

@ -2316,6 +2316,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH);
LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point)
mDisabledItems.clear(); //adding code to clear out disabled members from previous
if (lost_and_found_id == mUUID)
{
// This is the lost+found folder.

View File

@ -131,6 +131,13 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item)
&& (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos)
&& ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions)
&& (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate);
BOOL is_folder = (dynamic_cast<LLFolderViewFolder*>(item) != NULL);
if (is_folder && mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
{
passed = TRUE;
}
return passed;
}

View File

@ -1234,9 +1234,9 @@ LLVector3 LLManipRotate::getConstraintAxis()
else
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
llerrs << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl
llerrs << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl;
#else
llwarns << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl
llwarns << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl;
#endif
axis.mV[0] = 1.f;
}

View File

@ -101,14 +101,13 @@ void LLPanelGroupTab::handleClickHelp()
}
LLPanelGroup::LLPanelGroup()
: LLPanel()
,LLGroupMgrObserver( LLUUID() )
,mAllowEdit(TRUE)
: LLPanel(),
LLGroupMgrObserver( LLUUID() ),
mAllowEdit( TRUE )
{
// Set up the factory callbacks.
// Roles sub tabs
LLGroupMgr::getInstance()->addObserver(this);
}
@ -247,6 +246,7 @@ void LLPanelGroup::onBackBtnClick()
}
}
void LLPanelGroup::onBtnCreate()
{
LLPanelGroupGeneral* panel_general = findChild<LLPanelGroupGeneral>("group_general_tab_panel");

View File

@ -186,7 +186,7 @@ BOOL LLPanelGroupGeneral::postBuild()
}
mIncompleteMemberDataStr = getString("incomplete_member_data_str");
// If the group_id is null, then we are creating a new group
if (mGroupID.isNull())
{

View File

@ -1178,7 +1178,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data,
else
{
llwarns << "Inventory item for gesture " << info->mItemUUID
<< " is no longer in agent inventory." << llendl
<< " is no longer in agent inventory." << llendl;
}
}
else

View File

@ -1260,7 +1260,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
else
{
llwarns << "Inventory item for script " << info->mItemUUID
<< " is no longer in agent inventory." << llendl
<< " is no longer in agent inventory." << llendl;
}
// Find our window and close it if requested.
@ -1383,6 +1383,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
delete item_uuid;
}
/// ---------------------------------------------------------------------------
/// LLLiveLSLEditor
/// ---------------------------------------------------------------------------
@ -2145,6 +2146,7 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
}
}
void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata)
{
LLLiveLSLEditor* self = static_cast<LLLiveLSLEditor*>(userdata);

View File

@ -38,6 +38,7 @@
#include "llagent.h"
#include "llbutton.h"
#include "llcombobox.h"
#include "llfilepicker.h"
#include "llfloaterreg.h"
#include "llimagetga.h"
@ -57,6 +58,10 @@ const S32 CLIENT_RECT_VPAD = 4;
const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f;
const F32 PREVIEW_TEXTURE_MAX_ASPECT = 200.f;
const F32 PREVIEW_TEXTURE_MIN_ASPECT = 0.005f;
LLPreviewTexture::LLPreviewTexture(const LLSD& key)
: LLPreview( key ),
mLoadingFullImage( FALSE ),
@ -65,7 +70,8 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key)
mIsCopyable(FALSE),
mUpdateDimensions(TRUE),
mLastHeight(0),
mLastWidth(0)
mLastWidth(0),
mAspectRatio(0.f)
{
const LLInventoryItem *item = getItem();
if(item)
@ -144,6 +150,10 @@ BOOL LLPreviewTexture::postBuild()
}
}
childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this);
LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio");
combo->setCurrentByIndex(0);
return LLPreview::postBuild();
}
@ -369,8 +379,13 @@ void LLPreviewTexture::updateDimensions()
S32 max_client_width = gViewerWindow->getWindowWidth() - horiz_pad;
S32 max_client_height = gViewerWindow->getWindowHeight() - vert_pad;
if (mAspectRatio > 0.f)
{
client_height = llceil((F32)client_width / mAspectRatio);
}
while ((client_width > max_client_width) ||
(client_height > max_client_height ) )
(client_height > max_client_height ))
{
client_width /= 2;
client_height /= 2;
@ -383,12 +398,12 @@ void LLPreviewTexture::updateDimensions()
childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth()));
childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight()));
// add space for dimensions
// add space for dimensions and aspect ratio
S32 info_height = 0;
LLRect dim_rect;
childGetRect("dimensions", dim_rect);
S32 dim_height = dim_rect.getHeight();
info_height += dim_height + CLIENT_RECT_VPAD;
LLRect aspect_rect;
childGetRect("combo_aspect_ratio", aspect_rect);
S32 aspect_height = aspect_rect.getHeight();
info_height += aspect_height + CLIENT_RECT_VPAD;
view_height += info_height;
S32 button_height = 0;
@ -445,24 +460,96 @@ void LLPreviewTexture::updateDimensions()
else
{
client_width = getRect().getWidth() - horiz_pad;
client_height = getRect().getHeight() - vert_pad;
if (mAspectRatio > 0)
{
client_height = llround(client_width / mAspectRatio);
}
else
{
client_height = getRect().getHeight() - vert_pad;
}
}
S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height
S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height
- CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE;
S32 max_width = getRect().getWidth() - horiz_pad;
client_height = llclamp(client_height, 1, max_height);
client_width = llclamp(client_width, 1, max_width);
if (mAspectRatio > 0.f)
{
max_height = llmax(max_height, 1);
if (client_height > max_height)
{
client_height = max_height;
client_width = llround(client_height * mAspectRatio);
}
}
else
{
S32 max_width = getRect().getWidth() - horiz_pad;
client_height = llclamp(client_height, 1, max_height);
client_width = llclamp(client_width, 1, max_width);
}
LLRect window_rect(0, getRect().getHeight(), getRect().getWidth(), 0);
window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD;
mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height);
mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height);
// Hide the aspect ratio label if the window is too narrow
// Assumes the label should be to the right of the dimensions
LLRect dim_rect, aspect_label_rect;
childGetRect("aspect_ratio", aspect_label_rect);
childGetRect("dimensions", dim_rect);
childSetVisible("aspect_ratio", dim_rect.mRight < aspect_label_rect.mLeft);
}
// Return true if everything went fine, false if we somewhat modified the ratio as we bumped on border values
bool LLPreviewTexture::setAspectRatio(const F32 width, const F32 height)
{
mUpdateDimensions = TRUE;
// We don't allow negative width or height. Also, if height is positive but too small, we reset to default
// A default 0.f value for mAspectRatio means "unconstrained" in the rest of the code
if ((width <= 0.f) || (height <= F_APPROXIMATELY_ZERO))
{
mAspectRatio = 0.f;
return false;
}
// Compute and store the ratio
F32 ratio = width / height;
mAspectRatio = llclamp(ratio, PREVIEW_TEXTURE_MIN_ASPECT, PREVIEW_TEXTURE_MAX_ASPECT);
// Return false if we clamped the value, true otherwise
return (ratio == mAspectRatio);
}
void LLPreviewTexture::onAspectRatioCommit(LLUICtrl* ctrl, void* userdata)
{
LLPreviewTexture* self = (LLPreviewTexture*) userdata;
std::string ratio(ctrl->getValue().asString());
std::string::size_type separator(ratio.find_first_of(":/\\"));
if (std::string::npos == separator) {
// If there's no separator assume we want an unconstrained ratio
self->setAspectRatio( 0.f, 0.f );
return;
}
F32 width, height;
std::istringstream numerator(ratio.substr(0, separator));
std::istringstream denominator(ratio.substr(separator + 1));
numerator >> width;
denominator >> height;
self->setAspectRatio( width, height );
}
void LLPreviewTexture::loadAsset()
{
mImage = LLViewerTextureManager::getFetchedTexture(mImageID, MIPMAP_TRUE, FALSE, LLViewerTexture::LOD_TEXTURE);

View File

@ -38,6 +38,7 @@
#include "llframetimer.h"
#include "llviewertexture.h"
class LLComboBox;
class LLImageRaw;
class LLPreviewTexture : public LLPreview
@ -71,7 +72,9 @@ public:
protected:
void init();
/* virtual */ BOOL postBuild();
bool setAspectRatio(const F32 width, const F32 height);
static void onAspectRatioCommit(LLUICtrl*,void* userdata);
private:
void updateDimensions();
LLUUID mImageID;
@ -88,6 +91,7 @@ private:
S32 mLastHeight;
S32 mLastWidth;
F32 mAspectRatio;
BOOL mUpdateDimensions;
};

View File

@ -545,7 +545,7 @@ BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id)
object_found = TRUE;
break; // must break here, may have removed multiple objects from list
}
else if (object->isAvatar())
else if (object->isAvatar() && object->getParent() && ((LLViewerObject*)object->getParent())->mID == id)
{
// It's possible the item being removed has an avatar sitting on it
// So remove the avatar that is sitting on the object.

View File

@ -66,6 +66,9 @@ F32 elevation_from_vector(const LLVector3 &v);
LLSky gSky;
// ---------------- LLSky ----------------
const F32 LLSky::NIGHTTIME_ELEVATION = -8.0f; // degrees
const F32 LLSky::NIGHTTIME_ELEVATION_COS = (F32)sin(NIGHTTIME_ELEVATION*DEG_TO_RAD);
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

View File

@ -42,9 +42,6 @@
#include "llvosky.h"
#include "llvoground.h"
const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees
const F32 NIGHTTIME_ELEVATION_COS = (F32)sin(NIGHTTIME_ELEVATION*DEG_TO_RAD);
class LLViewerCamera;
class LLVOWLSky;
@ -111,6 +108,9 @@ public:
// Legacy stuff
LLVector3 mSunDefaultPosition;
static const F32 NIGHTTIME_ELEVATION; // degrees
static const F32 NIGHTTIME_ELEVATION_COS;
protected:
BOOL mOverrideSimSunPosition;

View File

@ -977,6 +977,13 @@ bool idle_startup()
LLFile::mkdir(gDirUtilp->getChatLogsDir());
LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
// chat history must be loaded AFTER chat directories are defined.
if (!gNoRender && gSavedPerAccountSettings.getBOOL("LogShowHistory"))
{
LLFloaterChat::loadHistory();
}
//good as place as any to create user windlight directories
std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", ""));
LLFile::mkdir(user_windlight_path_name.c_str());

View File

@ -1371,7 +1371,7 @@ bool LLTextureFetch::createRequest(const std::string& filename, const LLUUID& id
}
else if (w*h*c > 0)
{
// If the requester knows the dimentions of the image,
// If the requester knows the dimensions of the image,
// this will calculate how much data we need without having to parse the header
desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, desired_discard);

View File

@ -120,9 +120,8 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
const LLVector3 &up_direction,
const LLVector3 &point_of_interest)
{
// do not update if we are in build mode AND avatar didn't move
if (LLToolMgr::getInstance()->inBuildMode()
&& !LLViewerJoystick::getInstance()->getCameraNeedsUpdate())
// do not update if avatar didn't move
if (!LLViewerJoystick::getInstance()->getCameraNeedsUpdate())
{
return;
}

View File

@ -688,7 +688,7 @@ static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hah
void test_cached_control()
{
#define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl
#define do { TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl; } while(0)
TEST_LLCC(U32, 666);
TEST_LLCC(S32, (S32)-666);
TEST_LLCC(F32, (F32)-666.666);

View File

@ -414,14 +414,41 @@ void LLViewerJoystick::agentFly(F32 inc)
}
// -----------------------------------------------------------------------------
void LLViewerJoystick::agentRotate(F32 pitch_inc, F32 yaw_inc)
void LLViewerJoystick::agentPitch(F32 pitch_inc)
{
LLQuaternion new_rot;
pitch_inc = gAgent.clampPitchToLimits(-pitch_inc);
const LLQuaternion qx(pitch_inc, gAgent.getLeftAxis());
const LLQuaternion qy(-yaw_inc, gAgent.getReferenceUpVector());
new_rot.setQuat(qx * qy);
gAgent.rotate(new_rot);
if (pitch_inc < 0)
{
gAgent.setControlFlags(AGENT_CONTROL_PITCH_POS);
}
else if (pitch_inc > 0)
{
gAgent.setControlFlags(AGENT_CONTROL_PITCH_NEG);
}
gAgent.pitch(-pitch_inc);
}
// -----------------------------------------------------------------------------
void LLViewerJoystick::agentYaw(F32 yaw_inc)
{
// Cannot steer some vehicles in mouselook if the script grabs the controls
if (gAgent.cameraMouselook() && !gSavedSettings.getBOOL("JoystickMouselookYaw"))
{
gAgent.rotate(-yaw_inc, gAgent.getReferenceUpVector());
}
else
{
if (yaw_inc < 0)
{
gAgent.setControlFlags(AGENT_CONTROL_YAW_POS);
}
else if (yaw_inc > 0)
{
gAgent.setControlFlags(AGENT_CONTROL_YAW_NEG);
}
gAgent.yaw(-yaw_inc);
}
}
// -----------------------------------------------------------------------------
@ -595,12 +622,38 @@ void LLViewerJoystick::moveAvatar(bool reset)
}
bool is_zero = true;
static bool button_held = false;
if (mBtn[1] == 1)
{
agentJump();
// If AutomaticFly is enabled, then button1 merely causes a
// jump (as the up/down axis already controls flying) if on the
// ground, or cease flight if already flying.
// If AutomaticFly is disabled, then button1 toggles flying.
if (gSavedSettings.getBOOL("AutomaticFly"))
{
if (!gAgent.getFlying())
{
gAgent.moveUp(1);
}
else if (!button_held)
{
button_held = true;
gAgent.setFlying(FALSE);
}
}
else if (!button_held)
{
button_held = true;
gAgent.setFlying(!gAgent.getFlying());
}
is_zero = false;
}
else
{
button_held = false;
}
F32 axis_scale[] =
{
@ -758,11 +811,13 @@ void LLViewerJoystick::moveAvatar(bool reset)
{
if (gAgent.getFlying())
{
agentRotate(eff_rx, eff_ry);
agentPitch(eff_rx);
agentYaw(eff_ry);
}
else
{
agentRotate(eff_rx, 2.f * eff_ry);
agentPitch(eff_rx);
agentYaw(2.f * eff_ry);
}
}
}
@ -771,7 +826,8 @@ void LLViewerJoystick::moveAvatar(bool reset)
agentSlide(sDelta[X_I]); // move sideways
agentFly(sDelta[Y_I]); // up/down & crouch
agentPush(sDelta[Z_I]); // forward/back
agentRotate(sDelta[RX_I], sDelta[RY_I]); // pitch & turn
agentPitch(sDelta[RX_I]); // pitch
agentYaw(sDelta[RY_I]); // turn
}
}
@ -963,15 +1019,10 @@ bool LLViewerJoystick::toggleFlycam()
moveFlycam(true);
}
else if (!LLToolMgr::getInstance()->inBuildMode())
{
moveAvatar(true);
}
else
{
// we are in build mode, exiting from the flycam mode: since we are
// going to keep the flycam POV for the main camera until the avatar
// moves, we need to track this situation.
// Exiting from the flycam mode: since we are going to keep the flycam POV for
// the main camera until the avatar moves, we need to track this situation.
setCameraNeedsUpdate(false);
setNeedsReset(true);
}

View File

@ -82,8 +82,9 @@ protected:
void agentSlide(F32 inc);
void agentPush(F32 inc);
void agentFly(F32 inc);
void agentRotate(F32 pitch_inc, F32 turn_inc);
void agentJump();
void agentPitch(F32 pitch_inc);
void agentYaw(F32 yaw_inc);
void agentJump();
void resetDeltas(S32 axis[]);
#if LIB_NDOF
static NDOF_HotPlugResult HotPlugAddCallback(NDOF_Device *dev);

View File

@ -1000,6 +1000,7 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
return TRUE;
}
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::navigateHome()
{

View File

@ -4733,6 +4733,96 @@ class LLToolsSnapObjectXY : public view_listener_t
}
};
// Determine if the option to cycle between linked prims is shown
class LLToolsEnableSelectNextPart : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = (gSavedSettings.getBOOL("EditLinkedParts") &&
!LLSelectMgr::getInstance()->getSelection()->isEmpty());
return new_value;
}
};
// Cycle selection through linked children in selected object.
// FIXME: Order of children list is not always the same as sim's idea of link order. This may confuse
// resis. Need link position added to sim messages to address this.
class LLToolsSelectNextPart : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
if (gSavedSettings.getBOOL("EditLinkedParts") && object_count)
{
LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if (selected && selected->getRootEdit())
{
bool fwd = (userdata.asString() == "next");
bool prev = (userdata.asString() == "previous");
bool ifwd = (userdata.asString() == "includenext");
bool iprev = (userdata.asString() == "includeprevious");
LLViewerObject* to_select = NULL;
LLViewerObject::child_list_t children = selected->getRootEdit()->getChildren();
children.push_front(selected->getRootEdit()); // need root in the list too
for (LLViewerObject::child_list_t::iterator iter = children.begin(); iter != children.end(); ++iter)
{
if ((*iter)->isSelected())
{
if (object_count > 1 && (fwd || prev)) // multiple selection, find first or last selected if not include
{
to_select = *iter;
if (fwd)
{
// stop searching if going forward; repeat to get last hit if backward
break;
}
}
else if ((object_count == 1) || (ifwd || iprev)) // single selection or include
{
if (fwd || ifwd)
{
++iter;
while (iter != children.end() && ((*iter)->isAvatar() || (ifwd && (*iter)->isSelected())))
{
++iter; // skip sitting avatars and selected if include
}
}
else // backward
{
iter = (iter == children.begin() ? children.end() : iter);
--iter;
while (iter != children.begin() && ((*iter)->isAvatar() || (iprev && (*iter)->isSelected())))
{
--iter; // skip sitting avatars and selected if include
}
}
iter = (iter == children.end() ? children.begin() : iter);
to_select = *iter;
break;
}
}
}
if (to_select)
{
if (gFocusMgr.childHasKeyboardFocus(gFloaterTools))
{
gFocusMgr.setKeyboardFocus(NULL); // force edit toolbox to commit any changes
}
if (fwd || prev)
{
LLSelectMgr::getInstance()->deselectAll();
}
LLSelectMgr::getInstance()->selectObjectOnly(to_select);
return true;
}
}
}
return true;
}
};
// in order to link, all objects must have the same owner, and the
// agent must have the ability to modify all of the objects. However,
// we're not answering that question with this method. The question
@ -7729,6 +7819,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts");
view_listener_t::addMenu(new LLToolsSnapObjectXY(), "Tools.SnapObjectXY");
view_listener_t::addMenu(new LLToolsUseSelectionForGrid(), "Tools.UseSelectionForGrid");
view_listener_t::addMenu(new LLToolsSelectNextPart(), "Tools.SelectNextPart");
view_listener_t::addMenu(new LLToolsLink(), "Tools.Link");
view_listener_t::addMenu(new LLToolsUnlink(), "Tools.Unlink");
view_listener_t::addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations");
@ -7742,6 +7833,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction");
view_listener_t::addMenu(new LLToolsEnableToolNotPie(), "Tools.EnableToolNotPie");
view_listener_t::addMenu(new LLToolsEnableSelectNextPart(), "Tools.EnableSelectNextPart");
view_listener_t::addMenu(new LLToolsEnableLink(), "Tools.EnableLink");
view_listener_t::addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink");
view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake");

View File

@ -219,7 +219,7 @@ const std::string upload_pick(void* data)
args["EXTENSION"] = ext;
args["VALIDS"] = valid_extensions;
LLNotifications::instance().add("InvalidFileExtension", args);
return NULL;
return std::string();
}
}//end else (non-null extension)

View File

@ -174,11 +174,28 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
U32 port = region_host.getPort();
U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport];
// llinfos << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << llendl;
U64 indexid = (((U64)index) << 32) | (U64)local_id;
return sIndexAndLocalIDToUUID.erase(indexid) > 0 ? TRUE : FALSE;
std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid);
if (iter == sIndexAndLocalIDToUUID.end())
{
return FALSE;
}
// Found existing entry
if (iter->second == object.getID())
{ // Full UUIDs match, so remove the entry
sIndexAndLocalIDToUUID.erase(iter);
return TRUE;
}
// UUIDs did not match - this would zap a valid entry, so don't erase it
//llinfos << "Tried to erase entry where id in table ("
// << iter->second << ") did not match object " << object.getID() << llendl;
}
return FALSE ;
}
@ -200,6 +217,9 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
U64 indexid = (((U64)index) << 32) | (U64)local_id;
sIndexAndLocalIDToUUID[indexid] = id;
//llinfos << "Adding object to table, full ID " << id
// << ", local ID " << local_id << ", ip " << ip << ":" << port << llendl;
}
S32 gFullObjectUpdates = 0;
@ -246,8 +266,8 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
{
if ( LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() )
{
//llinfos << "DEBUG selecting " << objectp->mID << " "
// << objectp->mLocalID << llendl;
// llinfos << "DEBUG selecting " << objectp->mID << " "
// << objectp->mLocalID << llendl;
LLSelectMgr::getInstance()->selectObjectAndFamily(objectp);
dialog_refresh_all();
}
@ -294,7 +314,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
size = mesgsys->getReceiveSize();
}
// llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
// llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
}
else
{
@ -308,7 +328,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
size = mesgsys->getReceiveSize();
}
// llinfos << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
// llinfos << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
gFullObjectUpdates += num_objects;
}
@ -318,7 +338,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (!regionp)
{
llwarns << "Object update from unknown region!" << llendl;
llwarns << "Object update from unknown region! " << region_handle << llendl;
return;
}
@ -357,7 +377,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
U8 compbuffer[2048];
S32 uncompressed_length = 2048;
S32 compressed_length;
compressed_dp.reset();
U32 flags = 0;
@ -398,7 +417,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
gMessageSystem->getSenderPort());
if (fullid.isNull())
{
//llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl;
// llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << llendl;
mNumUnknownUpdates++;
}
}
@ -412,7 +431,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
gMessageSystem->getSenderPort());
if (fullid.isNull())
{
//llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl;
// llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl;
mNumUnknownUpdates++;
}
}
@ -420,19 +439,43 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FullID, fullid, i);
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
// llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl;
// llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl;
}
objectp = findObject(fullid);
// This looks like it will break if the local_id of the object doesn't change
// upon boundary crossing, but we check for region id matching later...
if (objectp && (objectp->mLocalID != local_id))
// Reset object local id and region pointer if things have changed
if (objectp &&
((objectp->mLocalID != local_id) ||
(objectp->getRegion() != regionp)))
{
//if (objectp->getRegion())
//{
// llinfos << "Local ID change: Removing object from table, local ID " << objectp->mLocalID
// << ", id from message " << local_id << ", from "
// << LLHost(objectp->getRegion()->getHost().getAddress(), objectp->getRegion()->getHost().getPort())
// << ", full id " << fullid
// << ", objects id " << objectp->getID()
// << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion()
// << llendl;
//}
removeFromLocalIDTable(*objectp);
setUUIDAndLocal(fullid,
local_id,
gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort());
if (objectp->mLocalID != local_id)
{ // Update local ID in object with the one sent from the region
objectp->mLocalID = local_id;
}
if (objectp->getRegion() != regionp)
{ // Object changed region, so update it
objectp->setRegion(regionp);
objectp->updateRegion(regionp); // for LLVOAvatar
}
}
if (!objectp)
@ -441,7 +484,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type == OUT_TERSE_IMPROVED)
{
// llinfos << "terse update for an unknown object:" << fullid << llendl;
// llinfos << "terse update for an unknown object:" << fullid << llendl;
continue;
}
}
@ -452,7 +495,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type != OUT_FULL)
{
// llinfos << "terse update for an unknown object:" << fullid << llendl;
// llinfos << "terse update for an unknown object:" << fullid << llendl;
continue;
}
@ -462,7 +505,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (mDeadObjects.find(fullid) != mDeadObjects.end())
{
mNumDeadObjectUpdates++;
//llinfos << "update for a dead object:" << fullid << llendl;
// llinfos << "update for a dead object:" << fullid << llendl;
continue;
}
#endif
@ -475,20 +518,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
justCreated = TRUE;
mNumNewObjects++;
}
else
{
if (objectp->getRegion() != regionp)
{
// Object has changed region! Update lookup tables, set region pointer.
removeFromLocalIDTable(*objectp);
setUUIDAndLocal(fullid,
local_id,
gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort());
objectp->setRegion(regionp);
}
objectp->updateRegion(regionp); // for LLVOAvatar
}
if (objectp->isDead())
@ -623,7 +652,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
mCurLazyUpdateIndex = 0;
}
mCurBin = (++mCurBin) % NUM_BINS;
mCurBin = (mCurBin + 1) % NUM_BINS;
LLVOAvatar::cullAvatarsByPixelArea();
}
@ -808,6 +837,14 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
// Remove from object map so noone can look it up.
mUUIDObjectMap.erase(objectp->mID);
//if (objectp->getRegion())
//{
// llinfos << "cleanupReferences removing object from table, local ID " << objectp->mLocalID << ", ip "
// << objectp->getRegion()->getHost().getAddress() << ":"
// << objectp->getRegion()->getHost().getPort() << llendl;
//}
removeFromLocalIDTable(*objectp);
if (objectp->onActiveList())

View File

@ -1502,11 +1502,6 @@ void LLViewerWindow::initWorldUI()
// currently needs to happen before initializing chat or IM
LLFloaterReg::getInstance("communicate");
if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
{
LLFloaterChat::loadHistory();
}
LLRect morph_view_rect = full_window;
morph_view_rect.stretch( -STATUS_BAR_HEIGHT );
morph_view_rect.mTop = full_window.mTop - 32;

View File

@ -1664,7 +1664,6 @@ void LLVoiceClient::stateMachine()
// SLIM SDK: these arguments are no longer necessary.
// std::string args = " -p tcp -h -c";
std::string args;
std::string cmd;
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
if(loglevel.empty())
@ -1679,17 +1678,18 @@ void LLVoiceClient::stateMachine()
#if LL_WINDOWS
PROCESS_INFORMATION pinfo;
STARTUPINFOA sinfo;
STARTUPINFOW sinfo;
memset(&sinfo, 0, sizeof(sinfo));
std::string exe_dir = gDirUtilp->getAppRODataDir();
cmd = "SLVoice.exe";
cmd += args;
// So retarded. Windows requires that the second parameter to CreateProcessA be a writable (non-const) string...
char *args2 = new char[args.size() + 1];
strcpy(args2, args.c_str());
if(!CreateProcessA(exe_path.c_str(), args2, NULL, NULL, FALSE, 0, NULL, exe_dir.c_str(), &sinfo, &pinfo))
std::string exe_dir = gDirUtilp->getExecutableDir();
llutf16string exe_path16 = utf8str_to_utf16str(exe_path);
llutf16string exe_dir16 = utf8str_to_utf16str(exe_dir);
llutf16string args16 = utf8str_to_utf16str(args);
// Create a writeable copy to keep Windows happy.
U16 *argscpy_16 = new U16[args16.size() + 1];
wcscpy_s(argscpy_16,args16.size()+1,args16.c_str());
if(!CreateProcessW(exe_path16.c_str(), argscpy_16, NULL, NULL, FALSE, 0, NULL, exe_dir16.c_str(), &sinfo, &pinfo))
{
// DWORD dwErr = GetLastError();
}
@ -1701,7 +1701,7 @@ void LLVoiceClient::stateMachine()
CloseHandle(pinfo.hThread); // stops leaks - nothing else
}
delete[] args2;
delete[] argscpy_16;
#else // LL_WINDOWS
// This should be the same for mac and linux
{
@ -4972,7 +4972,7 @@ void LLVoiceClient::sessionState::removeAllParticipants()
if(!mParticipantsByUUID.empty())
{
LL_ERRS("Voice") << "Internal error: empty URI map, non-empty UUID map" << LL_ENDL
LL_ERRS("Voice") << "Internal error: empty URI map, non-empty UUID map" << LL_ENDL;
}
}
@ -6488,7 +6488,7 @@ void LLVoiceClient::deleteSession(sessionState *session)
{
if(iter->second != session)
{
LL_ERRS("Voice") << "Internal error: session mismatch" << LL_ENDL
LL_ERRS("Voice") << "Internal error: session mismatch" << LL_ENDL;
}
mSessionsByHandle.erase(iter);
}
@ -6528,7 +6528,7 @@ void LLVoiceClient::deleteAllSessions()
if(!mSessionsByHandle.empty())
{
LL_ERRS("Voice") << "Internal error: empty session map, non-empty handle map" << LL_ENDL
LL_ERRS("Voice") << "Internal error: empty session map, non-empty handle map" << LL_ENDL;
}
}

View File

@ -965,7 +965,7 @@ void LLVOSky::calcAtmospherics(void)
// and vary_sunlight will work properly with moon light
F32 lighty = unclamped_lightnorm[1];
if(lighty < NIGHTTIME_ELEVATION_COS)
if(lighty < LLSky::NIGHTTIME_ELEVATION_COS)
{
lighty = -lighty;
}

View File

@ -147,7 +147,7 @@ protected:
static S32 getResolution() { return sResolution; }
static S32 getCurrent() { return sCurrent; }
static S32 stepCurrent() { return (sCurrent = ++sCurrent % 2); }
static S32 stepCurrent() { return (sCurrent = (sCurrent + 1) % 2); }
static S32 getNext() { return ((sCurrent+1) % 2); }
static S32 getWhich(const BOOL curr) { return curr ? sCurrent : getNext(); }

View File

@ -304,7 +304,7 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm));
LLVector3 sunMoonDir;
if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS)
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
{
sunMoonDir = gSky.getSunDirection();
}

View File

@ -317,7 +317,7 @@ void LLWLParamManager::propagateParameters(void)
{
mLightDir = sunDir;
}
else if(sunDir.mV[1] < 0 && sunDir.mV[1] > NIGHTTIME_ELEVATION_COS)
else if(sunDir.mV[1] < 0 && sunDir.mV[1] > LLSky::NIGHTTIME_ELEVATION_COS)
{
// clamp v1 to 0 so sun never points up and causes weirdness on some machines
LLVector3 vec(sunDir.mV[0], sunDir.mV[1], sunDir.mV[2]);

View File

@ -150,11 +150,11 @@ XMLRPC_VALUE LLXMLRPCValue::getValue() const
class LLXMLRPCTransaction::Impl
{
public:
typedef LLXMLRPCTransaction::Status Status;
typedef LLXMLRPCTransaction::EStatus EStatus;
LLCurlEasyRequest* mCurlRequest;
Status mStatus;
EStatus mStatus;
CURLcode mCurlCode;
std::string mStatusMessage;
std::string mStatusURI;
@ -176,7 +176,7 @@ public:
bool process();
void setStatus(Status code,
void setStatus(EStatus code,
const std::string& message = "", const std::string& uri = "");
void setCurlStatus(CURLcode);
@ -385,7 +385,7 @@ bool LLXMLRPCTransaction::Impl::process()
return false;
}
void LLXMLRPCTransaction::Impl::setStatus(Status status,
void LLXMLRPCTransaction::Impl::setStatus(EStatus status,
const std::string& message, const std::string& uri)
{
mStatus = status;
@ -509,7 +509,7 @@ bool LLXMLRPCTransaction::process()
return impl.process();
}
LLXMLRPCTransaction::Status LLXMLRPCTransaction::status(int* curlCode)
LLXMLRPCTransaction::EStatus LLXMLRPCTransaction::status(int* curlCode)
{
if (curlCode)
{

View File

@ -100,7 +100,7 @@ public:
~LLXMLRPCTransaction();
typedef enum {
typedef enum e_status {
StatusNotStarted,
StatusStarted,
StatusDownloading,
@ -108,12 +108,12 @@ public:
StatusCURLError,
StatusXMLRPCError,
StatusOtherError
} Status;
} EStatus;
bool process();
// run the request a little, returns true when done
Status status(int* curlCode);
EStatus status(int* curlCode);
// return status, and extended CURL code, if code isn't null
std::string statusMessage();
// return a message string, suitable for showing the user

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