diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index a8bedffd5b..6f962fa8b4 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -260,6 +260,70 @@ bool LLApp::parseCommandOptions(int argc, char** argv) return true; } +bool LLApp::parseCommandOptions(int argc, wchar_t** wargv) +{ + LLSD commands; + std::string name; + std::string value; + for(int ii = 1; ii < argc; ++ii) + { + if(wargv[ii][0] != '-') + { + LL_INFOS() << "Did not find option identifier while parsing token: " + << wargv[ii] << LL_ENDL; + return false; + } + int offset = 1; + if(wargv[ii][1] == '-') ++offset; + +#if LL_WINDOWS + name.assign(utf16str_to_utf8str(&wargv[ii][offset])); +#else + name.assign(wstring_to_utf8str(&wargv[ii][offset])); +#endif + if(((ii+1) >= argc) || (wargv[ii+1][0] == '-')) + { + // we found another option after this one or we have + // reached the end. simply record that this option was + // found and continue. + int flag = name.compare("logfile"); + if (0 == flag) + { + commands[name] = "log"; + } + else + { + commands[name] = true; + } + + continue; + } + ++ii; + +#if LL_WINDOWS + value.assign(utf16str_to_utf8str((wargv[ii]))); +#else + value.assign(wstring_to_utf8str((wargv[ii]))); +#endif + +#if LL_WINDOWS + //Windows changed command line parsing. Deal with it. + S32 slen = value.length() - 1; + S32 start = 0; + S32 end = slen; + if (wargv[ii][start]=='"')start++; + if (wargv[ii][end]=='"')end--; + if (start!=0 || end!=slen) + { + value = value.substr (start,end); + } +#endif + + commands[name] = value; + } + setOptionData(PRIORITY_COMMAND_LINE, commands); + return true; +} void LLApp::manageLiveFile(LLLiveFile* livefile) { @@ -361,7 +425,7 @@ void LLApp::setupErrorHandling(bool second_instance, EMiniDumpType minidump_type std::wstring wpipe_name; wpipe_name = mCrashReportPipeStr + wstringize(getPid()); - const std::wstring wdump_path(wstringize(mDumpPath)); + const std::wstring wdump_path(utf8str_to_utf16str(mDumpPath)); int retries = 30; for (; retries > 0; --retries) @@ -539,12 +603,9 @@ void LLApp::setMiniDumpDir(const std::string &path) if(mExceptionHandler == 0) return; #ifdef LL_WINDOWS - // Make sure to pass a proper unicode string to breapad. path is UTF8, not MBCS - // wchar_t buffer[MAX_MINDUMP_PATH_LENGTH]; - // mbstowcs(buffer, mDumpPath.c_str(), MAX_MINDUMP_PATH_LENGTH); - // mExceptionHandler->set_dump_path(std::wstring(buffer)); - mExceptionHandler->set_dump_path( utf8str_to_utf16str(mDumpPath) ); - // + std::wstring buffer(utf8str_to_utf16str(mDumpPath)); + if (buffer.size() > MAX_MINDUMP_PATH_LENGTH) buffer.resize(MAX_MINDUMP_PATH_LENGTH); + mExceptionHandler->set_dump_path(buffer); #elif LL_LINUX //google_breakpad::MinidumpDescriptor desc("/tmp"); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. google_breakpad::MinidumpDescriptor desc(mDumpPath); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index c2d69f41cc..68baafa5a6 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -106,7 +106,7 @@ public: LLSD getOption(const std::string& name) const; /** - * @brief Parse command line options and insert them into + * @brief Parse ASCII command line options and insert them into * application command line options. * * The name inserted into the option will have leading option @@ -119,6 +119,20 @@ public: */ bool parseCommandOptions(int argc, char** argv); + /** + * @brief Parse Unicode command line options and insert them into + * application command line options. + * + * The name inserted into the option will have leading option + * identifiers (a minus or double minus) stripped. All options + * with values will be stored as a string, while all options + * without values will be stored as true. + * @param argc The argc passed into main(). + * @param wargv The wargv passed into main(). + * @return Returns true if the parse succeeded. + */ + bool parseCommandOptions(int argc, wchar_t** wargv); + /** * @brief Keep track of live files automatically. * diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 16fc365da1..f8a93baf45 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -132,8 +132,8 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std } // Open baseline and current target, exit if one is inexistent - std::ifstream base_is(baseline.c_str()); - std::ifstream target_is(target.c_str()); + llifstream base_is(baseline.c_str()); + llifstream target_is(target.c_str()); if (!base_is.is_open() || !target_is.is_open()) { LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL; @@ -151,7 +151,7 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std target_is.close(); //output comparision - std::ofstream os(output.c_str()); + llofstream os(output.c_str()); os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; @@ -212,7 +212,7 @@ void LLMetricPerformanceTesterBasic::addMetric(std::string str) } /*virtual*/ -void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +void LLMetricPerformanceTesterBasic::analyzePerformance(llofstream* os, LLSD* base, LLSD* current) { resetCurrentCount() ; @@ -254,14 +254,14 @@ void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* } /*virtual*/ -void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) +void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::string metric_string, S32 v_base, S32 v_current) { *os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ; } /*virtual*/ -void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) +void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::string metric_string, F32 v_base, F32 v_current) { *os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current, v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ; @@ -293,7 +293,7 @@ LLMetricPerformanceTesterWithSession::~LLMetricPerformanceTesterWithSession() } /*virtual*/ -void LLMetricPerformanceTesterWithSession::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +void LLMetricPerformanceTesterWithSession::analyzePerformance(llofstream* os, LLSD* base, LLSD* current) { // Load the base session resetCurrentCount() ; diff --git a/indra/llcommon/llmetricperformancetester.h b/indra/llcommon/llmetricperformancetester.h index e6b46be1cf..2e99ed979d 100644 --- a/indra/llcommon/llmetricperformancetester.h +++ b/indra/llcommon/llmetricperformancetester.h @@ -60,7 +60,7 @@ public: * By default, compares the test results against the baseline one by one, item by item, * in the increasing order of the LLSD record counter, starting from the first one. */ - virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ; static void doAnalysisMetrics(std::string baseline, std::string target, std::string output) ; @@ -93,8 +93,8 @@ protected: * @param[in] v_base - Base value of the metric. * @param[in] v_current - Current value of the metric. */ - virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; - virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; + virtual void compareTestResults(llofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; + virtual void compareTestResults(llofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; /** * @brief Reset internal record count. Count starts with 1. @@ -181,7 +181,7 @@ public: * This will be loading the base and current sessions and compare them using the virtual * abstract methods loadTestSession() and compareTestSessions() */ - virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ; protected: /** @@ -205,7 +205,7 @@ protected: * @brief Compare the base session and the target session. Assumes base and current sessions have been loaded. * @param[out] os - The comparison result as a standard stream */ - virtual void compareTestSessions(std::ofstream* os) = 0; + virtual void compareTestSessions(llofstream* os) = 0; LLTestSession* mBaseSessionp; LLTestSession* mCurrentSessionp; diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index cc3e5312c4..f16dc8b164 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1453,7 +1453,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) { S32 components = getComponents(); - if (! ((1 == components) || (3 == components) || (4 == components) )) + if (components != 1 && components != 3 && components != 4) { LL_WARNS() << "Invalid getComponents value (" << components << ")" << LL_ENDL; return false; @@ -1529,6 +1529,55 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) return true ; } +LLPointer LLImageRaw::scaled(S32 new_width, S32 new_height) +{ + LLPointer result; + + S32 components = getComponents(); + if (components != 1 && components != 3 && components != 4) + { + LL_WARNS() << "Invalid getComponents value (" << components << ")" << LL_ENDL; + return result; + } + + if (isBufferInvalid()) + { + LL_WARNS() << "Invalid image buffer" << LL_ENDL; + return result; + } + + S32 old_width = getWidth(); + S32 old_height = getHeight(); + + if ((old_width == new_width) && (old_height == new_height)) + { + result = new LLImageRaw(old_width, old_height, components); + if (!result) + { + LL_WARNS() << "Failed to allocate new image" << LL_ENDL; + return result; + } + memcpy(result->getData(), getData(), getDataSize()); + } + else + { + S32 new_data_size = new_width * new_height * components; + + if (new_data_size > 0) + { + result = new LLImageRaw(new_width, new_height, components); + if (!result) + { + LL_WARNS() << "Failed to allocate new image" << LL_ENDL; + return result; + } + bilinear_scale(getData(), old_width, old_height, components, old_width*components, result->getData(), new_width, new_height, components, new_width*components); + } + } + + return result; +} + void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step ) { const S32 components = getComponents(); @@ -1802,10 +1851,13 @@ static std::string find_file(std::string &name, S8 *codec) #endif EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten) { - for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++) + if (!exten.empty()) { - if (exten == file_extensions[i].exten) - return file_extensions[i].codec; + for (int i = 0; i < (int)(NUM_FILE_EXTENSIONS); i++) + { + if (exten == file_extensions[i].exten) + return file_extensions[i].codec; + } } return IMG_CODEC_INVALID; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index e86dd8a6ea..43729d737d 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -222,7 +222,8 @@ public: void expandToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, bool scale_image = true); void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, bool scale_image = true); void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE); - bool scale( S32 new_width, S32 new_height, bool scale_image = true ); + bool scale(S32 new_width, S32 new_height, bool scale_image = true); + LLPointer scaled(S32 new_width, S32 new_height); // Fill the buffer with a constant color void fill( const LLColor4U& color ); diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index b00b28cf51..72558696b8 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5381,19 +5381,31 @@ void LLVolumeFace::cacheOptimize() S32 num_verts = mNumVertices; S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; LLVector4a* pos = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size); + if (pos == NULL) + { + LL_ERRS("LLVOLUME") << "Allocation of positions vector[" << sizeof(LLVector4a) * 2 * num_verts + size << "] failed. " << LL_ENDL; + } LLVector4a* norm = pos + num_verts; LLVector2* tc = (LLVector2*) (norm + num_verts); LLVector4a* wght = NULL; if (mWeights) { - wght = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + wght = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + if (wght == NULL) + { + LL_ERRS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL; + } } LLVector4a* binorm = NULL; if (mTangents) { binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + if (binorm == NULL) + { + LL_ERRS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL; + } } //allocate mapping of old indices to new indices diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8132db0c36..6f3acf1332 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -65,7 +65,7 @@ static const std::string HEADLESS_VENDOR_STRING("Linden Lab"); static const std::string HEADLESS_RENDERER_STRING("Headless"); static const std::string HEADLESS_VERSION_STRING("1.0"); -std::ofstream gFailLog; +llofstream gFailLog; #if GL_ARB_debug_output diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 75e5fe86ec..aa98b3f6bc 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -47,7 +47,7 @@ extern BOOL gDebugGL; extern BOOL gDebugSession; -extern std::ofstream gFailLog; +extern llofstream gFailLog; #define LL_GL_ERRS LL_ERRS("RenderState") diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b61269a0ec..1e626c2bf9 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2297,7 +2297,7 @@ FramePerSecondLimit Comment - Test + Controls upper limit of frames per second Persist 1 Type diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index db7536ceb8..e108d427f3 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3640,6 +3640,7 @@ void appearance_mgr_update_dirty_state() void update_base_outfit_after_ordering() { LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); + app_mgr.setOutfitImage(LLUUID()); LLInventoryModel::cat_array_t sub_cat_array; LLInventoryModel::item_array_t outfit_item_array; gInventory.collectDescendents(app_mgr.getBaseOutfitUUID(), diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 78f9cdbf9b..95f81cc157 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -715,7 +715,7 @@ public: void run() { - std::ofstream os(mFile.c_str()); + llofstream os(mFile.c_str()); while (!LLAppViewer::instance()->isQuitting()) { @@ -4486,7 +4486,7 @@ void getFileList() if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) ) { std::string fullname = pathname + *iter; - std::ifstream fdat( fullname.c_str(), std::ifstream::binary); + llifstream fdat( fullname.c_str(), std::ifstream::binary); if (fdat) { char buf[5]; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index f17628980b..b38e5243f6 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -781,10 +781,10 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze) PROCESS_INFORMATION processInfo; std::wstring exe_wstr; - exe_wstr=wstringize(exe_path); + exe_wstr = utf8str_to_utf16str(exe_path); std::wstring arg_wstr; - arg_wstr=wstringize(arg_str); + arg_wstr = utf8str_to_utf16str(arg_str); LL_INFOS("CrashReport") << "Creating crash reporter process " << exe_path << " with params: " << arg_str << LL_ENDL; if(CreateProcess(exe_wstr.c_str(), diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index e27335ddeb..6c69a0a8b6 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -519,7 +519,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t { //read base log into memory S32 i = 0; - std::ifstream is(base.c_str()); + llifstream is(base.c_str()); while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is)) { base_data[i++] = cur; @@ -532,7 +532,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t { //read current log into memory S32 i = 0; - std::ifstream is(target.c_str()); + llifstream is(target.c_str()); while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is)) { cur_data[i++] = cur; @@ -877,8 +877,8 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is) void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target, std::string output) { // Open baseline and current target, exit if one is inexistent - std::ifstream base_is(baseline.c_str()); - std::ifstream target_is(target.c_str()); + llifstream base_is(baseline.c_str()); + llifstream target_is(target.c_str()); if (!base_is.is_open() || !target_is.is_open()) { LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL; @@ -896,7 +896,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target target_is.close(); //output comparison - std::ofstream os(output.c_str()); + llofstream os(output.c_str()); LLSD::Real session_time = current["SessionTime"].asReal(); os << diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 4624274559..fb674a8ecb 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -687,6 +687,18 @@ void LLFloaterAvatarPicker::find() std::string text = getChild("Edit")->getValue().asString(); + size_t separator_index = text.find_first_of(" ._"); + if (separator_index != text.npos) + { + std::string first = text.substr(0, separator_index); + std::string last = text.substr(separator_index+1, text.npos); + LLStringUtil::trim(last); + if("Resident" == last) + { + text = first; + } + } + mQueryID.generate(); std::string url; @@ -954,12 +966,13 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& if (search_results->isEmpty()) { - LLStringUtil::format_map_t map; - map["[TEXT]"] = getChild("Edit")->getValue().asString(); + std::string name = "'" + getChild("Edit")->getValue().asString() + "'"; LLSD item; item["id"] = LLUUID::null; item["columns"][0]["column"] = "name"; - item["columns"][0]["value"] = getString("not_found", map); + item["columns"][0]["value"] = name; + item["columns"][1]["column"] = "username"; + item["columns"][1]["value"] = getString("not_found_text"); search_results->addElement(item); search_results->setEnabled(false); getChildView("ok_btn")->setEnabled(false); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 79e9f5504e..eb7f03e030 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -269,8 +269,8 @@ std::string LLInvFVBridge::getSearchableUUIDString() const const LLInventoryModel* model = getInventoryModel(); if (model) { - const LLInventoryItem *item = model->getItem(mUUID); - if(item) + const LLViewerInventoryItem *item = model->getItem(mUUID); + if(item /*&& (item->getIsFullPerm() || gAgent.isGodlikeWithoutAdminMenuFakery())*/) // Keep it FS-legacy style since we had it like this for ages { std::string uuid = item->getAssetUUID().asString(); LLStringUtil::toUpper(uuid); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 5035871afc..262eb148f6 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2429,7 +2429,8 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root { // Undo delete item confirmation per-session annoyance //static bool sDisplayedAtSession = false; - + const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + bool marketplacelistings_item = false; LLAllDescendentsPassedFilter f; for (std::set::iterator it = selected_items.begin(); (it != selected_items.end()) && (f.allDescendentsPassedFilter()); ++it) { @@ -2437,9 +2438,15 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root { folder->applyFunctorRecursively(f); } + LLFolderViewModelItemInventory * viewModel = dynamic_cast((*it)->getViewModelItem()); + if (viewModel && gInventory.isObjectDescendentOf(viewModel->getUUID(), marketplacelistings_id)) + { + marketplacelistings_item = true; + break; + } } // Fall through to the generic confirmation if the user choose to ignore the specialized one - if ( (!f.allDescendentsPassedFilter()) && (!LLNotifications::instance().getIgnored("DeleteFilteredItems")) ) + if ( (!f.allDescendentsPassedFilter()) && !marketplacelistings_item && (!LLNotifications::instance().getIgnored("DeleteFilteredItems")) ) { LLNotificationsUtil::add("DeleteFilteredItems", LLSD(), LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root->getHandle())); } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 3dbc4f1581..9c7f223b8f 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2070,14 +2070,14 @@ void dump_llsd_to_file(const LLSD& content, std::string filename) { if (gSavedSettings.getBOOL("MeshUploadLogXML")) { - std::ofstream of(filename.c_str()); + llofstream of(filename.c_str()); LLSDSerialize::toPrettyXML(content,of); } } LLSD llsd_from_file(std::string filename) { - std::ifstream ifs(filename.c_str()); + llifstream ifs(filename.c_str()); LLSD result; LLSDSerialize::fromXML(result,ifs); return result; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 2aea95ffa1..3f109a4af3 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2126,7 +2126,7 @@ void LLPanelObject::sendPosition(BOOL btn_down) if (mObject->isRootEdit()) { // only offset by parent's translation - mObject->resetChildrenPosition(LLVector3(-delta), TRUE) ; + mObject->resetChildrenPosition(LLVector3(-delta), TRUE, TRUE) ; } if(!btn_down) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 84a9fc7c74..0ef611aae8 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1702,7 +1702,7 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data ) std::string filename = file_picker.getFirstFile(); - std::ifstream fin(filename.c_str()); + llifstream fin(filename.c_str()); std::string line; std::string text; @@ -1740,7 +1740,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) { std::string filename = file_picker.getFirstFile(); std::string scriptText=self->mEditor->getText(); - std::ofstream fout(filename.c_str()); + llofstream fout(filename.c_str()); fout<<(scriptText); fout.close(); // FIRE-7514: Script in external editor needs to be saved twice diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index c9a2f94891..7261861e80 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -532,7 +532,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name) LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL; - std::ofstream os(file_name.c_str()); + llofstream os(file_name.c_str()); os << std::setprecision(10); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 3be38ce2a0..64dea2ba00 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -2029,15 +2029,13 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer raw, S32 dis if(w * h *c > 0) //valid { //make a duplicate to keep the original raw image untouched. - raw = raw->duplicate(); + raw = raw->scaled(w, h); if (raw->isBufferInvalid()) { LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL; return false; } - raw->scale(w, h) ; - discardlevel += i ; } } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 0625b68d8b..a992662851 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -122,7 +122,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseDownY = y; //left mouse down always picks transparent (but see handleMouseUp) - mPick = gViewerWindow->pickImmediate(x, y, FALSE, FALSE); + mPick = gViewerWindow->pickImmediate(x, y, TRUE, FALSE); mPick.mKeyMask = mask; mMouseButtonDown = true; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a5efa82e9e..8271f12eeb 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -6321,7 +6321,7 @@ void LLViewerObject::resetChildrenRotationAndPosition(const std::vectorisSelected() && childp->mDrawable.notNull()) { if (childp->getPCode() != LL_PCODE_LEGACY_AVATAR) @@ -6360,14 +6361,16 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif } else //avatar { - LLVector3 reset_pos = ((LLVOAvatar*)childp)->mDrawable->mXform.getPosition() + child_offset ; + if(!skip_avatar_child) + { + LLVector3 reset_pos = ((LLVOAvatar*)childp)->mDrawable->mXform.getPosition() + child_offset ; - ((LLVOAvatar*)childp)->mDrawable->mXform.setPosition(reset_pos); - ((LLVOAvatar*)childp)->mDrawable->getVObj()->setPosition(reset_pos); - - LLManip::rebuild(childp); - } - } + ((LLVOAvatar*)childp)->mDrawable->mXform.setPosition(reset_pos); + ((LLVOAvatar*)childp)->mDrawable->getVObj()->setPosition(reset_pos); + LLManip::rebuild(childp); + } + } + } } return ; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index ba14df6bf8..51c6e06c11 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -589,7 +589,7 @@ public: public: //counter-translation - void resetChildrenPosition(const LLVector3& offset, BOOL simplified = FALSE) ; + void resetChildrenPosition(const LLVector3& offset, BOOL simplified = FALSE, BOOL skip_avatar_child = FALSE) ; //counter-rotation void resetChildrenRotationAndPosition(const std::vector& rotations, const std::vector& positions) ; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9ce836ec23..c32b962856 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1471,8 +1471,7 @@ void LLViewerFetchedTexture::addToCreateTexture() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } } @@ -3058,8 +3057,7 @@ void LLViewerFetchedTexture::setCachedRawImage() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } mCachedRawImage = mRawImage; @@ -4111,7 +4109,7 @@ void LLTexturePipelineTester::updateStablizingTime() } //virtual -void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) +void LLTexturePipelineTester::compareTestSessions(llofstream* os) { LLTexturePipelineTester::LLTextureTestSession* base_sessionp = dynamic_cast(mBaseSessionp); LLTexturePipelineTester::LLTextureTestSession* current_sessionp = dynamic_cast(mCurrentSessionp); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 8de0f82233..20e9707b57 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -821,7 +821,7 @@ private: }; /*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ; - /*virtual*/ void compareTestSessions(std::ofstream* os) ; + /*virtual*/ void compareTestSessions(llofstream* os) ; }; #endif diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e63fedd535..6dd71ac078 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5879,13 +5879,13 @@ void LLVOAvatar::resetAnimations() // Override selectively based on avatar sex and whether we're using new // animations. -LLUUID LLVOAvatar::remapMotionID(const LLUUID& id, ESex gender) +LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) { static LLCachedControl use_new_walk_run(gSavedSettings, "UseNewWalkRun"); LLUUID result = id; // start special case female walk for female avatars - if (gender == SEX_FEMALE) + if (getSex() == SEX_FEMALE) { if (id == ANIM_AGENT_WALK) { @@ -5901,10 +5901,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id, ESex gender) if (use_new_walk_run) result = ANIM_AGENT_FEMALE_RUN_NEW; } - else if (id == ANIM_AGENT_SIT) - { - result = ANIM_AGENT_SIT_FEMALE; - } } else { @@ -5943,7 +5939,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) remap_id = AOEngine::getInstance()->override(id, TRUE); if (remap_id.isNull()) { - remap_id = remapMotionID(id, getSex()); + remap_id = remapMotionID(id); } else { @@ -5952,7 +5948,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) } else { - remap_id = remapMotionID(id, getSex()); + remap_id = remapMotionID(id); } // Animation Overrider @@ -5977,24 +5973,14 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; // Animation Overrider - //LLUUID remap_id = remapMotionID(id, getSex()); - //if (findMotion(remap_id) == NULL) - //{ - // //possibility of encountering animation from the previous gender - // remap_id = remapMotionID(id, (getSex() == SEX_MALE) ? SEX_FEMALE : SEX_MALE); - //} + //LLUUID remap_id = remapMotionID(id); LLUUID remap_id; if (isSelf()) { remap_id = AOEngine::getInstance()->override(id, FALSE); if (remap_id.isNull()) { - remap_id = remapMotionID(id, getSex()); - if (findMotion(remap_id) == NULL) - { - //possibility of encountering animation from the previous gender - remap_id = remapMotionID(id, (getSex() == SEX_MALE) ? SEX_FEMALE : SEX_MALE); - } + remap_id = remapMotionID(id); } else { @@ -6003,15 +5989,10 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) } else { - remap_id = remapMotionID(id, getSex()); - if (findMotion(remap_id) == NULL) - { - //possibility of encountering animation from the previous gender - remap_id = remapMotionID(id, (getSex() == SEX_MALE) ? SEX_FEMALE : SEX_MALE); - } + remap_id = remapMotionID(id); } // Animation Overrider - + if (remap_id != id) { LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL; @@ -9319,7 +9300,7 @@ void dump_sequential_xml(const std::string outprefix, const LLSD& content) { std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - std::ofstream ofs(fullpath.c_str(), std::ios_base::out); + llofstream ofs(fullpath.c_str(), std::ios_base::out); ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 38415a14b2..e5405fb6ea 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -189,7 +189,7 @@ public: /*virtual*/ LLVector3 getCharacterVelocity(); /*virtual*/ LLVector3 getCharacterAngularVelocity(); - /*virtual*/ LLUUID remapMotionID(const LLUUID& id, ESex gender); + /*virtual*/ LLUUID remapMotionID(const LLUUID& id); /*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); /*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); virtual bool hasMotionFromSource(const LLUUID& source_id); diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index b479fd8d5b..557b8a8a8c 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -16,6 +16,10 @@ name="not_found"> '[TEXT]' not found + + Resident wasn't found. + No one near diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml index 06bedf6901..0b28858420 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml @@ -6,7 +6,7 @@ キャッシュ: - + MB diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml index 15340a9a5f..56065d95a3 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml @@ -6,7 +6,7 @@ Cache: - + MB diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml index c3ac198d08..f8aa17f0c6 100644 --- a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml @@ -6,7 +6,7 @@ Önbellek: - + MB diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml index 170cdddb8c..47f1069254 100644 --- a/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml @@ -6,7 +6,7 @@ 快取: - + MB diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 39793cc549..196cfba6c6 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -141,7 +141,7 @@ public: private: NamedTempFile mTempFile; - std::ofstream mFile; + llofstream mFile; }; class LLReplayLogReal: public LLReplayLog, public boost::noncopyable @@ -582,7 +582,7 @@ int main(int argc, char **argv) apr_status_t apr_err; const char* opt_arg = NULL; int opt_id = 0; - boost::scoped_ptr output; + boost::scoped_ptr output; const char *touch = NULL; while(true) @@ -612,7 +612,7 @@ int main(int argc, char **argv) verbose_mode = true; break; case 'o': - output.reset(new std::ofstream); + output.reset(new llofstream); output->open(opt_arg); break; case 's': // --sourcedir @@ -686,7 +686,7 @@ int main(int argc, char **argv) if (touch && success) { - std::ofstream s; + llofstream s; s.open(touch); s << "ok" << std::endl; s.close(); diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp index 9327ed1562..01763e7e05 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.cpp +++ b/indra/win_crash_logger/llcrashloggerwindows.cpp @@ -417,7 +417,7 @@ bool LLCrashLoggerWindows::initCrashServer() std::wstring wpipe_name; wpipe_name = mCrashReportPipeStr + std::wstring(wstringize(mPID)); - std::wstring wdump_path( wstringize(dump_path) ); + std::wstring wdump_path(utf8str_to_utf16str(dump_path)); //Pipe naming conventions: http://msdn.microsoft.com/en-us/library/aa365783%28v=vs.85%29.aspx mCrashHandler = new CrashGenerationServer( wpipe_name, diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp index 7466dbb766..58746eba02 100644 --- a/indra/win_crash_logger/win_crash_logger.cpp +++ b/indra/win_crash_logger/win_crash_logger.cpp @@ -29,15 +29,26 @@ #include #include "llcrashloggerwindows.h" +#ifdef _UNICODE +int APIENTRY wWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPWSTR lpCmdLine, + int nCmdShow) +#else int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +#endif //_UNICODE { LL_INFOS() << "Starting crash reporter with args" << &lpCmdLine << LL_ENDL; LLCrashLoggerWindows app; app.setHandle(hInstance); +#ifdef _UNICODE + app.parseCommandOptions(__argc, __wargv); +#else app.parseCommandOptions(__argc, __argv); +#endif //_UNICODE LLSD options = LLApp::instance()->getOptionData( LLApp::PRIORITY_COMMAND_LINE);