Merge viewer-neko

master
Ansariel 2019-03-26 19:15:36 +01:00
commit 3adc5c2b50
39 changed files with 387 additions and 284 deletions

View File

@ -3,8 +3,8 @@
# cmake_minimum_required should appear before any
# other commands to guarantee full compatibility
# with the version specified
## prior to 3.4, the Windows manifest handling was missing
cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR)
## 3.8 added VS_DEBUGGER_WORKING_DIRECTORY support
cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
"The root project/makefile/solution name. Defaults to SecondLife.")
@ -130,6 +130,12 @@ add_dependencies(viewer firestorm-bin)
add_subdirectory(${VIEWER_PREFIX}doxygen EXCLUDE_FROM_ALL)
# sets the 'startup project' for debugging from visual studio.
set_property(
DIRECTORY ${VIEWER_PREFIX}
PROPERTY VS_STARTUP_PROJECT firestorm-bin
)
if (LL_TESTS)
# Define after the custom targets are created so
# individual apps can add themselves as dependencies

View File

@ -200,6 +200,8 @@ endif (LINUX)
if (DARWIN)
# Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default
set(CLANG_DISABLE_FATAL_WARNINGS OFF)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations")

View File

@ -48,7 +48,6 @@
//#include "imdebug.h"
#include "llfontbitmapcache.h"
#include "llgl.h"
#include "llapr.h"
FT_Render_Mode gFontRenderMode = FT_RENDER_MODE_NORMAL;
@ -87,7 +86,6 @@ LLFontManager::LLFontManager()
LLFontManager::~LLFontManager()
{
FT_Done_FreeType(gFTLibrary);
unloadAllFonts(); // <FS:ND> FIRE-7570. Only load/mmap fonts once. Release everything here.
}
@ -172,7 +170,7 @@ void ft_close_cb(FT_Stream stream) {
}
#endif
BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback)
BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback, S32 face_n)
{
// Don't leak face objects. This is also needed to deal with
// changed font file names.
@ -183,70 +181,20 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
}
int error;
// <FS:ND> FIRE-7570. Only load/mmap fonts once. loadFont will either load a font into memory, or reuse an already loaded font.
//#ifdef LL_WINDOWS
// pFileStream = new llifstream(filename, std::ios::binary);
// if (pFileStream->is_open())
// {
// std::streampos beg = pFileStream->tellg();
// pFileStream->seekg(0, std::ios::end);
// std::streampos end = pFileStream->tellg();
// std::size_t file_size = end - beg;
// pFileStream->seekg(0, std::ios::beg);
//
// pFtStream = new LLFT_Stream();
// pFtStream->base = 0;
// pFtStream->pos = 0;
// pFtStream->size = file_size;
// pFtStream->descriptor.pointer = pFileStream;
// pFtStream->read = ft_read_cb;
// pFtStream->close = ft_close_cb;
//
// FT_Open_Args args;
// args.flags = FT_OPEN_STREAM;
// args.stream = (FT_StreamRec*)pFtStream;
//
// error = FT_Open_Face(gFTLibrary,
// &args,
// 0,
// &mFTFace);
// }
// else
// {
// delete pFileStream;
// pFileStream = NULL;
// return FALSE;
// }
//#else
// error = FT_New_Face( gFTLibrary,
// filename.c_str(),
// 0,
// &mFTFace);
//#endif
FT_Open_Args openArgs;
memset( &openArgs, 0, sizeof( openArgs ) );
openArgs.memory_base = gFontManagerp->loadFont( filename, openArgs.memory_size );
if( !openArgs.memory_base )
return FALSE;
openArgs.flags = FT_OPEN_MEMORY;
error = FT_Open_Face( gFTLibrary, &openArgs, 0, &mFTFace );
// </FS:ND>
#ifdef LL_WINDOWS
error = ftOpenFace(filename, face_n);
#else
error = FT_New_Face( gFTLibrary,
filename.c_str(),
0,
&mFTFace);
#endif
if (error)
{
// <FS:ND> FIRE-7570. Only load/mmap fonts once. loadFont will either load a font into memory, or reuse an already loaded font.
//#ifdef LL_WINDOWS
// pFileStream->close();
// delete pFileStream;
// delete pFtStream;
// pFileStream = NULL;
// pFtStream = NULL;
//#endif
// </FS:ND>
#ifdef LL_WINDOWS
clearFontStreams();
#endif
return FALSE;
}
@ -263,15 +211,9 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
{
// Clean up freetype libs.
FT_Done_Face(mFTFace);
// <FS:ND> FIRE-7570. Only load/mmap fonts once. loadFont will either load a font into memory, or reuse an already loaded font.
//#ifdef LL_WINDOWS
// pFileStream->close();
// delete pFileStream;
// delete pFtStream;
// pFileStream = NULL;
// pFtStream = NULL;
//#endif
// </FS:ND>
#ifdef LL_WINDOWS
clearFontStreams();
#endif
mFTFace = NULL;
return FALSE;
}
@ -328,6 +270,78 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
return TRUE;
}
S32 LLFontFreetype::getNumFaces(const std::string& filename)
{
if (mFTFace)
{
FT_Done_Face(mFTFace);
mFTFace = NULL;
}
S32 num_faces = 1;
#ifdef LL_WINDOWS
int error = ftOpenFace(filename, 0);
if (error)
{
return 0;
}
else
{
num_faces = mFTFace->num_faces;
}
FT_Done_Face(mFTFace);
clearFontStreams();
mFTFace = NULL;
#endif
return num_faces;
}
#ifdef LL_WINDOWS
S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n)
{
S32 error = -1;
pFileStream = new llifstream(filename, std::ios::binary);
if (pFileStream->is_open())
{
std::streampos beg = pFileStream->tellg();
pFileStream->seekg(0, std::ios::end);
std::streampos end = pFileStream->tellg();
std::size_t file_size = end - beg;
pFileStream->seekg(0, std::ios::beg);
pFtStream = new LLFT_Stream();
pFtStream->base = 0;
pFtStream->pos = 0;
pFtStream->size = file_size;
pFtStream->descriptor.pointer = pFileStream;
pFtStream->read = ft_read_cb;
pFtStream->close = ft_close_cb;
FT_Open_Args args;
args.flags = FT_OPEN_STREAM;
args.stream = (FT_StreamRec*)pFtStream;
error = FT_Open_Face(gFTLibrary, &args, face_n, &mFTFace);
}
return error;
}
void LLFontFreetype::clearFontStreams()
{
if (pFileStream)
{
pFileStream->close();
}
delete pFileStream;
delete pFtStream;
pFileStream = NULL;
pFtStream = NULL;
}
#endif
void LLFontFreetype::setFallbackFonts(const font_vector_t &font)
{
mFallbackFonts = font;
@ -757,83 +771,3 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32
}
}
// <FS:ND> FIRE-7570. Only load/mmap fonts once.
namespace nd
{
namespace fonts
{
class LoadedFont
{
public:
LoadedFont( std::string aName , U8 *aAddress, long aSize )
{
mName = aName;
mAddress = aAddress;
mSize = aSize;
mRefs = 1;
}
~LoadedFont()
{
}
std::string mName;
U8 *mAddress;
long mSize;
U32 mRefs;
};
}
}
U8 const* LLFontManager::loadFont( std::string const &aFilename, long &a_Size)
{
a_Size = 0;
std::map< std::string, nd::fonts::LoadedFont* >::iterator itr = m_LoadedFonts.find( aFilename );
if( itr != m_LoadedFonts.end() )
{
++itr->second->mRefs;
a_Size = itr->second->mSize;
return itr->second->mAddress;
}
llstat oStat;
if( 0 != LLFile::stat( aFilename, &oStat ) || 0 == oStat.st_size )
return 0;
a_Size = oStat.st_size;
U8 *pBuffer = new U8[ a_Size ];
if( a_Size != LLAPRFile::readEx( aFilename, pBuffer, 0, a_Size ) )
{
a_Size = 0;
delete []pBuffer;
return 0;
}
m_LoadedFonts[ aFilename ] = new nd::fonts::LoadedFont( aFilename, pBuffer, a_Size );
return pBuffer;
}
void LLFontManager::unloadFont( std::string const &aFilename )
{
std::map< std::string, nd::fonts::LoadedFont* >::iterator itr = m_LoadedFonts.find( aFilename );
if( itr != m_LoadedFonts.end() )
--itr->second->mRefs;
}
void LLFontManager::unloadAllFonts()
{
std::map< std::string, nd::fonts::LoadedFont* >::iterator itr = m_LoadedFonts.begin();
while( itr != m_LoadedFonts.end() )
{
delete []itr->second->mAddress;
delete itr->second;
m_LoadedFonts.erase( itr );
itr = m_LoadedFonts.begin();
}
}
// </FS:ND>

View File

@ -43,16 +43,6 @@ typedef struct FT_FaceRec_* LLFT_Face;
struct FT_StreamRec_;
typedef struct FT_StreamRec_ LLFT_Stream;
// <FS:ND> FIRE-7570. Only load/mmap fonts once.
namespace nd
{
namespace fonts
{
class LoadedFont;
}
}
// </FS:ND>
class LLFontManager
{
public:
@ -62,16 +52,6 @@ public:
private:
LLFontManager();
~LLFontManager();
// <FS:ND> FIRE-7570. Only load/mmap fonts once.
public:
U8 const *loadFont( std::string const &aFilename, long &a_Size );
void unloadFont( std::string const &aFilename );
private:
void unloadAllFonts();
std::map< std::string, nd::fonts::LoadedFont* > m_LoadedFonts;
// </FS:ND>
};
struct LLFontGlyphInfo
@ -104,7 +84,14 @@ public:
// is_fallback should be true for fallback fonts that aren't used
// to render directly (Unicode backup, primarily)
BOOL loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback);
BOOL loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback, S32 face_n = 0);
S32 getNumFaces(const std::string& filename);
#ifdef LL_WINDOWS
S32 ftOpenFace(const std::string& filename, S32 face_n);
void clearFontStreams();
#endif
typedef std::vector<LLPointer<LLFontFreetype> > font_vector_t;

View File

@ -89,14 +89,24 @@ void LLFontGL::destroyGL()
mFontFreetype->destroyGL();
}
BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback)
BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback, S32 face_n)
{
if(mFontFreetype == reinterpret_cast<LLFontFreetype*>(NULL))
{
mFontFreetype = new LLFontFreetype;
}
return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback);
return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback, face_n);
}
S32 LLFontGL::getNumFaces(const std::string& filename)
{
if (mFontFreetype == reinterpret_cast<LLFontFreetype*>(NULL))
{
mFontFreetype = new LLFontFreetype;
}
return mFontFreetype->getNumFaces(filename);
}
static LLTrace::BlockTimerStatHandle FTM_RENDER_FONTS("Fonts");

View File

@ -87,7 +87,9 @@ public:
void destroyGL();
BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback);
BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback, S32 face_n = 0);
S32 getNumFaces(const std::string& filename);
S32 render(const LLWString &text, S32 begin_offset,
const LLRect& rect,

View File

@ -44,6 +44,8 @@ using std::map;
bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc);
bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node);
const std::string MACOSX_FONT_PATH_LIBRARY = "/Library/Fonts/";
LLFontDescriptor::LLFontDescriptor():
mStyle(0)
{
@ -60,6 +62,16 @@ LLFontDescriptor::LLFontDescriptor(const std::string& name,
{
}
LLFontDescriptor::LLFontDescriptor(const std::string& name,
const std::string& size,
const U8 style,
const string_vec_t& file_names,
const string_vec_t& ft_collection_listections) :
LLFontDescriptor(name, size, style, file_names)
{
mFontCollectionsList = ft_collection_listections;
}
LLFontDescriptor::LLFontDescriptor(const std::string& name,
const std::string& size,
const U8 style):
@ -166,7 +178,7 @@ LLFontDescriptor LLFontDescriptor::normalize() const
if (removeSubString(new_name,"Italic"))
new_style |= LLFontGL::ITALIC;
return LLFontDescriptor(new_name,new_size,new_style,getFileNames());
return LLFontDescriptor(new_name,new_size,new_style,getFileNames(),getFontCollectionsList());
}
LLFontRegistry::LLFontRegistry(bool create_gl_textures, F32 size_mod)
@ -294,6 +306,16 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc)
{
std::string font_file_name = child->getTextContents();
desc.getFileNames().push_back(font_file_name);
if (child->hasAttribute("load_collection"))
{
BOOL col = FALSE;
child->getAttributeBOOL("load_collection", col);
if (col)
{
desc.getFontCollectionsList().push_back(font_file_name);
}
}
}
else if (child->hasName("os"))
{
@ -340,8 +362,15 @@ bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node)
match_file_names.insert(match_file_names.begin(),
desc.getFileNames().begin(),
desc.getFileNames().end());
string_vec_t collections_list = match_desc->getFontCollectionsList();
collections_list.insert(collections_list.begin(),
desc.getFontCollectionsList().begin(),
desc.getFontCollectionsList().end());
LLFontDescriptor new_desc = *match_desc;
new_desc.getFileNames() = match_file_names;
new_desc.getFontCollectionsList() = collections_list;
registry->mFontMap.erase(*match_desc);
registry->mFontMap[new_desc] = NULL;
}
@ -429,6 +458,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
// Build list of font names to look for.
// Files specified for this font come first, followed by those from the default descriptor.
string_vec_t file_names = match_desc->getFileNames();
string_vec_t ft_collection_list = match_desc->getFontCollectionsList();
string_vec_t default_file_names;
LLFontDescriptor default_desc("default",s_template_string,0);
const LLFontDescriptor *match_default_desc = getMatchingFontDesc(default_desc);
@ -437,6 +467,9 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
file_names.insert(file_names.end(),
match_default_desc->getFileNames().begin(),
match_default_desc->getFileNames().end());
ft_collection_list.insert(ft_collection_list.end(),
match_default_desc->getFontCollectionsList().begin(),
match_default_desc->getFontCollectionsList().end());
}
// Add ultimate fallback list - generated dynamically on linux,
@ -471,52 +504,64 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
file_name_it != file_names.end();
++file_name_it)
{
LLFontGL *fontp = new LLFontGL;
std::string font_path = local_path + *file_name_it;
LLFontGL *fontp = NULL;
string_vec_t font_paths;
font_paths.push_back(local_path + *file_name_it);
font_paths.push_back(sys_path + *file_name_it);
// <FS:Kadah> User fonts: Also load from user_settings/fonts
font_paths.push_back(usr_path + *file_name_it);
#if LL_DARWIN
font_paths.push_back(MACOSX_FONT_PATH_LIBRARY + *file_name_it);
#endif
bool is_ft_collection = (std::find(ft_collection_list.begin(), ft_collection_list.end(), *file_name_it) != ft_collection_list.end());
// *HACK: Fallback fonts don't render, so we can use that to suppress
// creation of OpenGL textures for test apps. JC
BOOL is_fallback = !is_first_found || !mCreateGLTextures;
F32 extra_scale = (is_fallback)?fallback_scale:1.0;
if (!fontp->loadFace(font_path, extra_scale * point_size,
LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))
F32 point_size_scale = extra_scale * point_size;
bool is_font_loaded = false;
for(string_vec_t::iterator font_paths_it = font_paths.begin();
font_paths_it != font_paths.end();
++font_paths_it)
{
// <FS:Kadah> User fonts: Also load from user_settings/fonts
std::string font_path = usr_path + *file_name_it;
// *HACK: Fallback fonts don't render, so we can use that to suppress
// creation of OpenGL textures for test apps. JC
BOOL is_fallback = !is_first_found || !mCreateGLTextures;
F32 extra_scale = (is_fallback)?fallback_scale:1.0;
if (!fontp->loadFace(font_path, extra_scale * point_size,
LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))
fontp = new LLFontGL;
S32 num_faces = is_ft_collection ? fontp->getNumFaces(*font_paths_it) : 1;
for (S32 i = 0; i < num_faces; i++)
{
// </FS:Kadah>
font_path = sys_path + *file_name_it;
if (!fontp->loadFace(font_path, extra_scale * point_size,
LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))
{
LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << " from path " << local_path << LL_ENDL;
delete fontp;
fontp = NULL;
if (fontp == NULL)
{
fontp = new LLFontGL;
}
if (fontp->loadFace(*font_paths_it, point_size_scale,
LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback, i))
{
is_font_loaded = true;
if (is_first_found)
{
result = fontp;
is_first_found = false;
}
else
{
fontlist.push_back(fontp->mFontFreetype);
delete fontp;
fontp = NULL;
}
}
else
{
delete fontp;
fontp = NULL;
}
}
// <FS:Kadah> User fonts: Also load from user_settings/fonts
}
// </FS:Kadah>
if (is_font_loaded) break;
}
if(fontp)
if(!is_font_loaded)
{
if (is_first_found)
{
result = fontp;
is_first_found = false;
}
else
{
fontlist.push_back(fontp->mFontFreetype);
delete fontp;
fontp = NULL;
}
LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << LL_ENDL;
delete fontp;
fontp = NULL;
}
}

View File

@ -40,6 +40,7 @@ public:
LLFontDescriptor();
LLFontDescriptor(const std::string& name, const std::string& size, const U8 style);
LLFontDescriptor(const std::string& name, const std::string& size, const U8 style, const string_vec_t& file_names);
LLFontDescriptor(const std::string& name, const std::string& size, const U8 style, const string_vec_t& file_names, const string_vec_t& font_collections);
LLFontDescriptor normalize() const;
bool operator<(const LLFontDescriptor& b) const;
@ -52,6 +53,8 @@ public:
void setSize(const std::string& size) { mSize = size; }
const std::vector<std::string>& getFileNames() const { return mFileNames; }
std::vector<std::string>& getFileNames() { return mFileNames; }
const std::vector<std::string>& getFontCollectionsList() const { return mFontCollectionsList; }
std::vector<std::string>& getFontCollectionsList() { return mFontCollectionsList; }
const U8 getStyle() const { return mStyle; }
void setStyle(U8 style) { mStyle = style; }
@ -59,6 +62,7 @@ private:
std::string mName;
std::string mSize;
string_vec_t mFileNames;
string_vec_t mFontCollectionsList;
U8 mStyle;
};

View File

@ -744,6 +744,17 @@ void LLWindowWin32::restore()
SetFocus(mWindowHandle);
}
bool destroy_window_handler(HWND &hWnd)
{
__try
{
return DestroyWindow(hWnd);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return false;
}
}
// close() destroys all OS-specific code associated with a window.
// Usually called from LLWindowManager::destroyWindow()
@ -817,7 +828,7 @@ void LLWindowWin32::close()
ShowWindow(mWindowHandle, SW_HIDE);
// This causes WM_DESTROY to be sent *immediately*
if (!DestroyWindow(mWindowHandle))
if (!destroy_window_handler(mWindowHandle))
{
OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
mCallbacks->translateString("MBShutdownErr"),

View File

@ -534,7 +534,12 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
}
// now we can set page zoom factor
mCEFLib->setPageZoom(message_in.getValueReal("factor"));
F32 factor = (F32)message_in.getValueReal("factor");
#if LL_DARWIN
//temporary fix for SL-10473: issue with displaying checkboxes on Mojave
factor*=1.001;
#endif
mCEFLib->setPageZoom(factor);
// Plugin gets to decide the texture parameters to use.
mDepth = 4;
@ -740,6 +745,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
if (message_name == "set_page_zoom_factor")
{
F32 factor = (F32)message_in.getValueReal("factor");
#if LL_DARWIN
//temporary fix for SL-10473: issue with displaying checkboxes on Mojave
factor*=1.001;
#endif
mCEFLib->setPageZoom(factor);
}
if (message_name == "browse_stop")
@ -817,7 +826,8 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_dat
// adding new code below in unicodeInput means we don't send ascii chars
// here too or we get double key presses on a mac.
bool esc_key = (event_umodchars == 27);
if (esc_key || ((unsigned char)event_chars < 0x10 || (unsigned char)event_chars >= 0x7f ))
bool tab_key_up = (event_umodchars == 9) && (key_event == dullahan::EKeyEvent::KE_KEY_UP);
if ((esc_key || ((unsigned char)event_chars < 0x10 || (unsigned char)event_chars >= 0x7f )) && !tab_key_up)
{
mCEFLib->nativeKeyboardEventOSX(key_event, event_modifiers,
event_keycode, event_chars,

View File

@ -2281,12 +2281,12 @@ if (WINDOWS)
# sets the 'working directory' for debugging from visual studio.
# Condition for version can be moved to requirements once build agents will be updated (see TOOL-3865)
if ((NOT UNATTENDED) AND (${CMAKE_VERSION} VERSION_GREATER "3.7.2"))
if (NOT UNATTENDED)
set_property(
TARGET ${VIEWER_BINARY_NAME}
PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
endif ((NOT UNATTENDED) AND (${CMAKE_VERSION} VERSION_GREATER "3.7.2"))
endif (NOT UNATTENDED)
if (PACKAGE)
add_custom_command(

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -14,6 +14,7 @@
<file>seguisym.ttf</file>
<file>nirmala.ttf</file>
<file>tahoma.ttf</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -28,6 +29,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -863,7 +863,7 @@ BOOL LLAgent::getFlying() const
//-----------------------------------------------------------------------------
// setFlying()
//-----------------------------------------------------------------------------
void LLAgent::setFlying(BOOL fly)
void LLAgent::setFlying(BOOL fly, BOOL fail_sound)
{
if (isAgentAvatarValid())
{
@ -899,7 +899,10 @@ void LLAgent::setFlying(BOOL fly)
// parcel doesn't let you start fly
// gods can always fly
// and it's OK if you're already flying
make_ui_sound("UISndBadKeystroke");
if (fail_sound)
{
make_ui_sound("UISndBadKeystroke");
}
return;
}
if( !was_flying )

View File

@ -352,7 +352,7 @@ private:
//--------------------------------------------------------------------
public:
BOOL getFlying() const;
void setFlying(BOOL fly);
void setFlying(BOOL fly, BOOL fail_sound = FALSE);
static void toggleFlying();
static bool enableFlying();
BOOL canFly(); // Does this parcel allow you to fly?

View File

@ -2180,6 +2180,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id)
static U32 lastGroupMemberRequestFrame = 0;
// Have we requested the information already this frame?
// Todo: make this per group, we can invite to one group and simultaneously be checking another one
if ((lastGroupMemberRequestFrame == gFrameCount) || (mMemberRequestInFlight))
return;
@ -2209,6 +2210,9 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id)
return;
}
LLGroupMgrGroupData* group_datap = createGroupData(group_id); //make sure group exists
group_datap->mMemberRequestID.generate(); // mark as pending
lastGroupMemberRequestFrame = gFrameCount;
LLCoros::instance().launch("LLGroupMgr::groupMembersRequestCoro",

View File

@ -268,6 +268,11 @@ public:
// bool isRoleMemberDataComplete() { return mRoleMemberDataComplete; }
// bool isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
bool isMemberDataPending() { return mMemberRequestID.notNull(); }
bool isRoleDataPending() { return mRoleDataRequestID.notNull(); }
bool isRoleMemberDataPending() { return (mRoleMembersRequestID.notNull() || mPendingRoleMemberRequest); }
bool isGroupTitlePending() { return mTitlesRequestID.notNull(); }
bool isSingleMemberNotOwner();
F32 getAccessTime() const { return mAccessTime; }

View File

@ -8093,8 +8093,7 @@ bool LLFolderViewGroupedItemBridge::canWearSelected(uuid_vec_t item_ids)
for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
LLAssetType::EType asset_type = item->getType();
if (!item || (asset_type >= LLAssetType::AT_COUNT) || (asset_type <= LLAssetType::AT_NONE))
if (!item || (item->getType() >= LLAssetType::AT_COUNT) || (item->getType() <= LLAssetType::AT_NONE))
{
return false;
}

View File

@ -65,11 +65,11 @@ public:
S32 LLMachineID::init()
{
memset(static_unique_id,0,sizeof(static_unique_id));
size_t len = sizeof(static_unique_id);
memset(static_unique_id, 0, len);
S32 ret_code = 0;
#if LL_WINDOWS
# pragma comment(lib, "wbemuuid.lib")
size_t len = sizeof(static_unique_id);
// algorithm to detect BIOS serial number found at:
// http://msdn.microsoft.com/en-us/library/aa394077%28VS.85%29.aspx
@ -218,16 +218,19 @@ S32 LLMachineID::init()
// Get the value of the Name property
hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0);
LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL;
// use characters in the returned Serial Number to create a byte array of size len
BSTR serialNumber ( vtProp.bstrVal);
unsigned int serial_size = SysStringLen(serialNumber);
unsigned int j = 0;
while( vtProp.bstrVal[j] != 0)
while (j < serial_size)
{
for (unsigned int i = 0; i < len; i++)
{
if (vtProp.bstrVal[j] == 0)
if (j >= serial_size)
break;
static_unique_id[i] = (unsigned int)(static_unique_id[i] + serialNumber[j]);
j++;
}
@ -254,6 +257,21 @@ S32 LLMachineID::init()
ret_code = LLUUID::getNodeID(staticPtr);
#endif
has_static_unique_id = true;
LL_INFOS("AppInit") << "UniqueID: 0x";
// Code between here and LL_ENDL is not executed unless the LL_DEBUGS
// actually produces output
for (size_t i = 0; i < len; ++i)
{
// Copy each char to unsigned int to hexify. Sending an unsigned
// char to a std::ostream tries to represent it as a char, not
// what we want here.
unsigned byte = static_unique_id[i];
LL_CONT << std::hex << std::setw(2) << std::setfill('0') << byte;
}
// Reset default output formatting to avoid nasty surprises!
LL_CONT << std::dec << std::setw(0) << std::setfill(' ') << LL_ENDL;
return ret_code;
}
@ -263,19 +281,6 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)
if (has_static_unique_id)
{
memcpy ( unique_id, &static_unique_id, len);
LL_INFOS_ONCE("AppInit") << "UniqueID: 0x";
// Code between here and LL_ENDL is not executed unless the LL_DEBUGS
// actually produces output
for (size_t i = 0; i < len; ++i)
{
// Copy each char to unsigned int to hexify. Sending an unsigned
// char to a std::ostream tries to represent it as a char, not
// what we want here.
unsigned byte = unique_id[i];
LL_CONT << std::hex << std::setw(2) << std::setfill('0') << byte;
}
// Reset default output formatting to avoid nasty surprises!
LL_CONT << std::dec << std::setw(0) << std::setfill(' ') << LL_ENDL;
return 1;
}
return 0;

View File

@ -606,11 +606,30 @@ void LLPanelGroupInvite::updateLists()
{
if (!mPendingUpdate)
{
// Note: this will partially fail if some requests are already in progress
LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID);
LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID);
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID);
LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID);
}
else if (gdatap)
{
// restart requests that were interrupted/dropped/failed to start
if (!gdatap->isRoleDataPending() && !gdatap->isRoleDataComplete())
{
LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID);
}
if (!gdatap->isRoleMemberDataPending() && !gdatap->isRoleMemberDataComplete())
{
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID);
}
// sendCapGroupMembersRequest has a per frame send limitation that could have
// interrupted previous request
if (!gdatap->isMemberDataPending() && !gdatap->isMemberDataComplete())
{
LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID);
}
}
mPendingUpdate = TRUE;
}
else

View File

@ -50,21 +50,21 @@ public:
virtual ~LLPreviewNotecard();
bool saveItem();
void setObjectID(const LLUUID& object_id);
void setObjectID(const LLUUID& object_id) override;
// llview
virtual void draw();
void draw() override;
// [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-11-05 (Catznip-2.3.0a) | Added: Catznip-2.3.0a
virtual bool hasAccelerators() const;
// [/SL:KB]
virtual BOOL handleKeyHere(KEY key, MASK mask);
virtual void setEnabled( BOOL enabled );
virtual BOOL handleKeyHere(KEY key, MASK mask) override;
virtual void setEnabled( BOOL enabled ) override;
// llfloater
virtual BOOL canClose();
BOOL canClose() override;
// llpanel
virtual BOOL postBuild();
BOOL postBuild() override;
// reach into the text editor, and grab the drag item
const LLInventoryItem* getDragItem();
@ -86,8 +86,8 @@ public:
protected:
void updateTitleButtons();
virtual void loadAsset();
void updateTitleButtons() override;
void loadAsset() override;
bool saveIfNeeded(LLInventoryItem* copyitem = NULL);
void deleteNotecard();

View File

@ -125,17 +125,13 @@ void ll::statusbar::SearchableItem::setNotHighlighted( )
}
}
bool ll::statusbar::SearchableItem::hightlightAndHide( LLWString const &aFilter )
bool ll::statusbar::SearchableItem::hightlightAndHide(LLWString const &aFilter, bool hide)
{
if( mMenu && !mMenu->getVisible() && !mWasHiddenBySearch )
if ((mMenu && !mMenu->getVisible() && !mWasHiddenBySearch) || dynamic_cast<LLMenuItemTearOffGL*>(mMenu))
return false;
setNotHighlighted( );
bool bVisible(false);
for( tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr )
bVisible |= (*itr)->hightlightAndHide( aFilter );
if( aFilter.empty() )
{
if( mCtrl )
@ -143,17 +139,22 @@ bool ll::statusbar::SearchableItem::hightlightAndHide( LLWString const &aFilter
return true;
}
bool bHighlighted(!hide);
if( mLabel.find( aFilter ) != LLWString::npos )
{
if( mCtrl )
mCtrl->setHighlighted( true );
return true;
bHighlighted = true;
}
if( mCtrl && !bVisible )
bool bVisible(false);
for (tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr)
bVisible |= (*itr)->hightlightAndHide(aFilter, !bHighlighted);
if (mCtrl && !bVisible && !bHighlighted)
{
mWasHiddenBySearch = true;
mMenu->setVisible(FALSE);
}
return bVisible;
return bVisible || bHighlighted;
}

View File

@ -107,7 +107,7 @@ namespace ll
SearchableItem();
void setNotHighlighted( );
bool hightlightAndHide( LLWString const &aFilter );
bool hightlightAndHide( LLWString const &aFilter, bool hide = true );
};
struct SearchData

View File

@ -3992,6 +3992,14 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r
return TRUE;
}
BOOL LLSelectMgr::isSelfAvatarSelected()
{
if (mAllowSelectAvatar)
{
return (getSelection()->getObjectCount() == 1) && (getSelection()->getFirstRootObject() == gAgentAvatarp);
}
return FALSE;
}
//--------------------------------------------------------------------
// Duplicate objects
@ -7026,11 +7034,31 @@ void LLSelectMgr::pauseAssociatedAvatars()
mSelectedObjects->mSelectType = getSelectTypeForObject(object);
if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT &&
// <FS:Ansariel> Chalice Yao's pause agent on attachment selection
//isAgentAvatarValid() && object->getParent() != NULL)
object->getParent() != NULL)
// </FS:Ansariel>
bool is_attached = false;
// <FS:Ansariel> Chalice Yao's pause agent on attachment selection
//if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT &&
// isAgentAvatarValid())
if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT)
// </FS:Ansariel>
{
// Selection can be obsolete, confirm that this is an attachment
LLViewerObject* parent = (LLViewerObject*)object->getParent();
while (parent != NULL)
{
if (parent->isAvatar())
{
is_attached = true;
break;
}
else
{
parent = (LLViewerObject*)parent->getParent();
}
}
}
if (is_attached)
{
if (object->isAnimatedObject())
{
@ -7092,14 +7120,12 @@ void LLSelectMgr::pauseAssociatedAvatars()
// </FS:Ansariel>
}
}
else
else if (object && object->isAnimatedObject() && object->getControlAvatar())
{
if (object && object->isAnimatedObject() && object->getControlAvatar())
{
// Is a non-attached animated object. Pause the control avatar.
mPauseRequests.push_back(object->getControlAvatar()->requestPause());
}
// Is a non-attached animated object. Pause the control avatar.
mPauseRequests.push_back(object->getControlAvatar()->requestPause());
}
}
}

View File

@ -788,6 +788,8 @@ public:
LLPermissions* findObjectPermissions(const LLViewerObject* object);
BOOL isSelfAvatarSelected();
void selectDelete(); // Delete on simulator
void selectForceDelete(); // just delete, no into trash
void selectDuplicate(const LLVector3& offset, BOOL select_copy); // Duplicate on simulator

View File

@ -271,7 +271,7 @@ BOOL LLToolCompTranslate::handleHover(S32 x, S32 y, MASK mask)
BOOL LLToolCompTranslate::handleMouseDown(S32 x, S32 y, MASK mask)
{
mMouseDown = TRUE;
gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE);
gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE, LLFloaterReg::instanceVisible("build"));
return TRUE;
}

View File

@ -70,7 +70,12 @@ LLViewerKeyboard gViewerKeyboard;
void agent_jump( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
static BOOL first_fly_attempt(TRUE);
if (KEYSTATE_UP == s)
{
first_fly_attempt = TRUE;
return;
}
F32 time = gKeyboard->getCurKeyElapsedTime();
S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
@ -90,7 +95,8 @@ void agent_jump( EKeystate s )
}
else
{
gAgent.setFlying(TRUE);
gAgent.setFlying(TRUE, first_fly_attempt);
first_fly_attempt = FALSE;
gAgent.moveUp(1);
}
}

View File

@ -4978,7 +4978,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
BOOL draw_handles = TRUE;
if (tool == LLToolCompTranslate::getInstance() && !all_selected_objects_move)
if (tool == LLToolCompTranslate::getInstance() && !all_selected_objects_move && !LLSelectMgr::getInstance()->isSelfAvatarSelected())
{
draw_handles = FALSE;
}

View File

@ -824,12 +824,9 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
{
#ifndef VIVOXDAEMON_REMOTEHOST
// Launch the voice daemon
#if defined(LL_WINDOWS) || defined(LL_LINUX)
std::string exe_path = gDirUtilp->getExecutableDir();
#else
std::string exe_path = gDirUtilp->getAppRODataDir();
#endif
#if LL_WINDOWS
// On windows use exe (not work or RO) directory
std::string exe_path = gDirUtilp->getExecutableDir();
// <FS:Ansariel> FIRE-22709: Local voice not working in OpenSim
#ifdef OPENSIM
if (!LLGridManager::instance().isInSecondLife())
@ -841,6 +838,8 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
// </FS:Ansariel>
gDirUtilp->append(exe_path, "SLVoice.exe");
#elif LL_DARWIN
// On MAC use resource directory
std::string exe_path = gDirUtilp->getAppRODataDir();
// <FS:Ansariel/TS> FIRE-22709: Local voice not working in OpenSim
//gDirUtilp->append(exe_path, "SLVoice");
#ifdef OPENSIM
@ -857,6 +856,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
#endif
// </FS:Ansariel/TS>
#else
std::string exe_path = gDirUtilp->getExecutableDir();
// <FS:ND> On Linux the viewer can run SLVoice.exe through wine (https://www.winehq.org/)
//gDirUtilp->append(exe_path, "SLVoice");
if( !viewerUsesWineForVoice() )

View File

@ -10,6 +10,7 @@
<file>simhei.ttf</file>
<file>ArialUni.ttf</file>
<file>msyh.ttc</file>
<file load_collection="true">Cambria.ttc</file>
</os>
<os name="Mac">
<file>ヒラギノ角ゴシック W3.ttc</file>
@ -21,6 +22,7 @@
<file>AppleSDGothicNeo-Regular.otf</file>
<file>华文细黑.ttf</file>
<file>PingFang.ttc</file>
<file>STIXGeneral.otf</file>
</os>
</font>

View File

@ -349,7 +349,7 @@ Hover your mouse over the options for more help.
layout="topleft" />
<combo_box
name="group_mature_check"
tool_tip="Sets whether your group contains information rated as Moderate"
tool_tip="Maturity ratings designate the type of content and behavior allowed in a group"
left="0"
top_pad="8"
right="-1"