Sync with Alchemy, includes much awaited lib updates for Linux
Applies ALCH-420 - Replace all invisiprims with fully transparent texture and remove dead code paths -ARC no longer takes invisis into consideration. Syncs some script keywords updates. Changes all "\n" in llfloaterabout.cpp to '\n' because screw.dat
This commit is contained in:
446
autobuild.xml
446
autobuild.xml
File diff suppressed because it is too large
Load Diff
@@ -37,4 +37,9 @@ elseif (DARWIN)
|
||||
)
|
||||
|
||||
elseif (LINUX)
|
||||
set(CEF_PLUGIN_LIBRARIES
|
||||
llceflib
|
||||
cef_dll_wrapper
|
||||
cef
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
@@ -137,7 +137,7 @@ elseif(LINUX)
|
||||
libatk-1.0.so
|
||||
libexpat.so
|
||||
libexpat.so.1
|
||||
libfreetype.so.6.12.0
|
||||
libfreetype.so.6.12.3
|
||||
libfreetype.so.6
|
||||
libfreetype.so
|
||||
libGLOD.so
|
||||
|
||||
@@ -4,69 +4,60 @@
|
||||
* @date 2006-02-05
|
||||
* @brief Implementation of the date class
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "lldate.h"
|
||||
|
||||
#include "apr_time.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <locale.h>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "llfasttimer.h"
|
||||
#include "lltimer.h"
|
||||
#include "llstring.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
#if defined(LL_WINDOWS) && !defined(timegm)
|
||||
# define timegm _mkgmtime
|
||||
#endif
|
||||
|
||||
#define EPOCH_STR "1970-01-01T00:00:00Z"
|
||||
static const F64 DATE_EPOCH = 0.0;
|
||||
|
||||
static const F64 LL_APR_USEC_PER_SEC = 1000000.0;
|
||||
// should be APR_USEC_PER_SEC, but that relies on INT64_C which
|
||||
// isn't defined in glib under our build set up for some reason
|
||||
|
||||
static std::string sPrevLocale = "";
|
||||
|
||||
LLDate::LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
LLDate::LLDate(const LLDate& date) :
|
||||
mSecondsSinceEpoch(date.mSecondsSinceEpoch)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
LLDate::LLDate(F64 seconds_since_epoch) :
|
||||
mSecondsSinceEpoch(seconds_since_epoch)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
LLDate::LLDate(const std::string& iso8601_date)
|
||||
{
|
||||
@@ -92,37 +83,43 @@ std::string LLDate::asString() const
|
||||
// is one of the standards used and the prefered format
|
||||
std::string LLDate::asRFC1123() const
|
||||
{
|
||||
return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT"));
|
||||
return toHTTPDateString(LLStringExplicit("%A, %d %b %Y %H:%M:%S GMT"));
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer FT_DATE_FORMAT("Date Format");
|
||||
|
||||
std::string LLDate::toHTTPDateString (std::string fmt) const
|
||||
std::string LLDate::toHTTPDateString(std::string fmt) const
|
||||
{
|
||||
LLFastTimer ft1(FT_DATE_FORMAT);
|
||||
|
||||
time_t locSeconds = (time_t) mSecondsSinceEpoch;
|
||||
struct tm * gmt = gmtime (&locSeconds);
|
||||
std::time_t locSeconds = (std::time_t) mSecondsSinceEpoch;
|
||||
std::tm * gmt = gmtime (&locSeconds);
|
||||
if (!gmt)
|
||||
{
|
||||
LL_WARNS() << "The impossible has happened!" << LL_ENDL;
|
||||
return LLStringExplicit(EPOCH_STR);
|
||||
}
|
||||
return toHTTPDateString(gmt, fmt);
|
||||
}
|
||||
|
||||
std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
|
||||
std::string LLDate::toHTTPDateString(tm * gmt, std::string fmt)
|
||||
{
|
||||
LLFastTimer ft1(FT_DATE_FORMAT);
|
||||
|
||||
// avoid calling setlocale() unnecessarily - it's expensive.
|
||||
static std::string prev_locale = "";
|
||||
std::string this_locale = LLStringUtil::getLocale();
|
||||
if (this_locale != prev_locale)
|
||||
if (this_locale != sPrevLocale)
|
||||
{
|
||||
setlocale(LC_TIME, this_locale.c_str());
|
||||
prev_locale = this_locale;
|
||||
sPrevLocale = this_locale;
|
||||
}
|
||||
|
||||
// use strftime() as it appears to be faster than std::time_put
|
||||
char buffer[128];
|
||||
strftime(buffer, 128, fmt.c_str(), gmt);
|
||||
if (std::strftime(buffer, 128, fmt.c_str(), gmt) == 0)
|
||||
return LLStringExplicit(EPOCH_STR);
|
||||
std::string res(buffer);
|
||||
|
||||
#if LL_WINDOWS
|
||||
// Convert from locale-dependant charset to UTF-8 (EXT-8524).
|
||||
res = ll_convert_string_to_utf8_string(res);
|
||||
@@ -132,39 +129,56 @@ std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
|
||||
|
||||
void LLDate::toStream(std::ostream& s) const
|
||||
{
|
||||
apr_time_t time = (apr_time_t)(mSecondsSinceEpoch * LL_APR_USEC_PER_SEC);
|
||||
std::ios::fmtflags f( s.flags() );
|
||||
|
||||
apr_time_exp_t exp_time;
|
||||
if (apr_time_exp_gmt(&exp_time, time) != APR_SUCCESS)
|
||||
std::tm exp_time = {0};
|
||||
std::time_t time = static_cast<std::time_t>(mSecondsSinceEpoch);
|
||||
|
||||
#if LL_WINDOWS
|
||||
if (gmtime_s(&exp_time, &time) != 0)
|
||||
#else
|
||||
if (!gmtime_r(&time, &exp_time))
|
||||
#endif
|
||||
{
|
||||
s << "1970-01-01T00:00:00Z";
|
||||
s << EPOCH_STR;
|
||||
return;
|
||||
}
|
||||
|
||||
s << std::dec << std::setfill('0');
|
||||
#if( LL_WINDOWS || __GNUC__ > 2)
|
||||
s << std::right;
|
||||
#else
|
||||
s.setf(ios::right);
|
||||
#endif
|
||||
s << std::setw(4) << (exp_time.tm_year + 1900)
|
||||
<< '-' << std::setw(2) << (exp_time.tm_mon + 1)
|
||||
<< '-' << std::setw(2) << (exp_time.tm_mday)
|
||||
<< 'T' << std::setw(2) << (exp_time.tm_hour)
|
||||
<< ':' << std::setw(2) << (exp_time.tm_min)
|
||||
<< ':' << std::setw(2) << (exp_time.tm_sec);
|
||||
if (exp_time.tm_usec > 0)
|
||||
{
|
||||
s << '.' << std::setw(2)
|
||||
<< (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100));
|
||||
}
|
||||
s << 'Z'
|
||||
<< std::setfill(' ');
|
||||
|
||||
s.flags( f );
|
||||
}
|
||||
|
||||
bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const
|
||||
{
|
||||
apr_time_t time = (apr_time_t)(mSecondsSinceEpoch * LL_APR_USEC_PER_SEC);
|
||||
std::tm exp_time = {0};
|
||||
std::time_t time = static_cast<std::time_t>(mSecondsSinceEpoch);
|
||||
|
||||
apr_time_exp_t exp_time;
|
||||
if (apr_time_exp_gmt(&exp_time, time) != APR_SUCCESS)
|
||||
#if LL_WINDOWS
|
||||
if (gmtime_s(&exp_time, &time) != 0)
|
||||
#else
|
||||
if (!gmtime_r(&time, &exp_time))
|
||||
#endif
|
||||
{
|
||||
*year = 1970;
|
||||
*month = 01;
|
||||
*day = 01;
|
||||
*hour = 00;
|
||||
*min = 00;
|
||||
*sec = 00;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -197,60 +211,63 @@ bool LLDate::fromString(const std::string& iso8601_date)
|
||||
|
||||
bool LLDate::fromStream(std::istream& s)
|
||||
{
|
||||
struct apr_time_exp_t exp_time;
|
||||
apr_int32_t tm_part;
|
||||
std::tm time = {0};
|
||||
int c;
|
||||
|
||||
#if LL_WINDOWS || LL_LINUX // GCC 4.8 lacks this Windows has broken std::get_time() Time for things to get ugly!
|
||||
int32_t tm_part;
|
||||
s >> tm_part;
|
||||
exp_time.tm_year = tm_part - 1900;
|
||||
time.tm_year = tm_part - 1900;
|
||||
c = s.get(); // skip the hypen
|
||||
if (c != '-') { return false; }
|
||||
s >> tm_part;
|
||||
exp_time.tm_mon = tm_part - 1;
|
||||
time.tm_mon = tm_part - 1;
|
||||
c = s.get(); // skip the hypen
|
||||
if (c != '-') { return false; }
|
||||
s >> tm_part;
|
||||
exp_time.tm_mday = tm_part;
|
||||
time.tm_mday = tm_part;
|
||||
|
||||
c = s.get(); // skip the T
|
||||
if (c != 'T') { return false; }
|
||||
|
||||
s >> tm_part;
|
||||
exp_time.tm_hour = tm_part;
|
||||
time.tm_hour = tm_part;
|
||||
c = s.get(); // skip the :
|
||||
if (c != ':') { return false; }
|
||||
s >> tm_part;
|
||||
exp_time.tm_min = tm_part;
|
||||
time.tm_min = tm_part;
|
||||
c = s.get(); // skip the :
|
||||
if (c != ':') { return false; }
|
||||
s >> tm_part;
|
||||
exp_time.tm_sec = tm_part;
|
||||
time.tm_sec = tm_part;
|
||||
|
||||
// zero out the unused fields
|
||||
exp_time.tm_usec = 0;
|
||||
exp_time.tm_wday = 0;
|
||||
exp_time.tm_yday = 0;
|
||||
exp_time.tm_isdst = 0;
|
||||
exp_time.tm_gmtoff = 0;
|
||||
|
||||
// generate a time_t from that
|
||||
apr_time_t time;
|
||||
if (apr_time_exp_gmt_get(&time, &exp_time) != APR_SUCCESS)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
F64 seconds_since_epoch = time / LL_APR_USEC_PER_SEC;
|
||||
|
||||
// check for fractional
|
||||
c = s.peek();
|
||||
if(c == '.')
|
||||
{
|
||||
F64 fractional = 0.0;
|
||||
s >> fractional;
|
||||
seconds_since_epoch += fractional;
|
||||
}
|
||||
|
||||
#else
|
||||
std::string this_locale = LLStringUtil::getLocale();
|
||||
if (this_locale != sPrevLocale)
|
||||
{
|
||||
setlocale(LC_TIME, this_locale.c_str());
|
||||
sPrevLocale = this_locale;
|
||||
}
|
||||
|
||||
// Isn't stdlib nice?
|
||||
s.imbue(std::locale(sPrevLocale.c_str()));
|
||||
s >> std::get_time(&time, "%Y-%m-%dT%H:%M:%S");
|
||||
if (s.fail())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
std::time_t tm = timegm(&time);
|
||||
if (tm == -1)
|
||||
return false;
|
||||
|
||||
F64 seconds_since_epoch = static_cast<F64>(tm);
|
||||
c = s.peek(); // check for offset
|
||||
if (c == '+' || c == '-')
|
||||
{
|
||||
@@ -266,7 +283,6 @@ bool LLDate::fromStream(std::istream& s)
|
||||
{
|
||||
s >> offset_minutes;
|
||||
}
|
||||
|
||||
offset_in_seconds = (offset_hours * 60 + offset_sign * offset_minutes) * 60;
|
||||
seconds_since_epoch -= offset_in_seconds;
|
||||
}
|
||||
@@ -278,7 +294,7 @@ bool LLDate::fromStream(std::istream& s)
|
||||
|
||||
bool LLDate::fromYMDHMS(S32 year, S32 month, S32 day, S32 hour, S32 min, S32 sec)
|
||||
{
|
||||
struct apr_time_exp_t exp_time;
|
||||
std::tm exp_time = {0};
|
||||
|
||||
exp_time.tm_year = year - 1900;
|
||||
exp_time.tm_mon = month - 1;
|
||||
@@ -287,21 +303,11 @@ bool LLDate::fromYMDHMS(S32 year, S32 month, S32 day, S32 hour, S32 min, S32 sec
|
||||
exp_time.tm_min = min;
|
||||
exp_time.tm_sec = sec;
|
||||
|
||||
// zero out the unused fields
|
||||
exp_time.tm_usec = 0;
|
||||
exp_time.tm_wday = 0;
|
||||
exp_time.tm_yday = 0;
|
||||
exp_time.tm_isdst = 0;
|
||||
exp_time.tm_gmtoff = 0;
|
||||
|
||||
// generate a time_t from that
|
||||
apr_time_t time;
|
||||
if (apr_time_exp_gmt_get(&time, &exp_time) != APR_SUCCESS)
|
||||
{
|
||||
std::time_t tm = timegm(&exp_time);
|
||||
if (tm == -1)
|
||||
return false;
|
||||
}
|
||||
|
||||
mSecondsSinceEpoch = time / LL_APR_USEC_PER_SEC;
|
||||
mSecondsSinceEpoch = static_cast<F64>(tm);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,10 @@
|
||||
|
||||
#if LL_GTK
|
||||
extern "C" {
|
||||
# include "gtk/gtk.h"
|
||||
# include <gtk/gtk.h>
|
||||
#if GTK_CHECK_VERSION(2, 24, 0)
|
||||
#include <gdk/gdkx.h>
|
||||
#endif
|
||||
}
|
||||
#include <locale.h>
|
||||
#endif // LL_GTK
|
||||
@@ -86,23 +89,6 @@ static bool ATIbug = false;
|
||||
// be only one object of this class at any time. Currently this is true.
|
||||
static LLWindowSDL *gWindowImplementation = NULL;
|
||||
|
||||
|
||||
void maybe_lock_display(void)
|
||||
{
|
||||
if (gWindowImplementation && gWindowImplementation->Lock_Display) {
|
||||
gWindowImplementation->Lock_Display();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void maybe_unlock_display(void)
|
||||
{
|
||||
if (gWindowImplementation && gWindowImplementation->Unlock_Display) {
|
||||
gWindowImplementation->Unlock_Display();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if LL_GTK
|
||||
// Lazily initialize and check the runtime GTK version for goodness.
|
||||
// static
|
||||
@@ -116,9 +102,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)
|
||||
if (!done_setlocale)
|
||||
{
|
||||
LL_INFOS() << "Starting GTK Initialization." << LL_ENDL;
|
||||
maybe_lock_display();
|
||||
gtk_disable_setlocale();
|
||||
maybe_unlock_display();
|
||||
done_setlocale = TRUE;
|
||||
}
|
||||
|
||||
@@ -128,9 +112,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)
|
||||
#if !GLIB_CHECK_VERSION(2, 32, 0)
|
||||
if (!g_thread_supported ()) g_thread_init (NULL);
|
||||
#endif
|
||||
maybe_lock_display();
|
||||
gtk_is_good = gtk_init_check(NULL, NULL);
|
||||
maybe_unlock_display();
|
||||
if (!gtk_is_good)
|
||||
LL_WARNS() << "GTK Initialization failed." << LL_ENDL;
|
||||
}
|
||||
@@ -146,12 +128,10 @@ bool LLWindowSDL::ll_try_gtk_init(void)
|
||||
<< gtk_major_version << "."
|
||||
<< gtk_minor_version << "."
|
||||
<< gtk_micro_version << LL_ENDL;
|
||||
maybe_lock_display();
|
||||
const gchar* gtk_warning = gtk_check_version(
|
||||
GTK_MAJOR_VERSION,
|
||||
GTK_MINOR_VERSION,
|
||||
GTK_MICRO_VERSION);
|
||||
maybe_unlock_display();
|
||||
if (gtk_warning)
|
||||
{
|
||||
LL_WARNS() << "- GTK COMPATIBILITY WARNING: " <<
|
||||
@@ -198,13 +178,13 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
||||
BOOL ignore_pixel_depth, U32 fsaa_samples)
|
||||
: LLWindow(callbacks, fullscreen, flags),
|
||||
Lock_Display(NULL),
|
||||
Unlock_Display(NULL), mGamma(1.0f)
|
||||
{
|
||||
// Initialize the keyboard
|
||||
gKeyboard = new LLKeyboardSDL();
|
||||
gKeyboard->setCallbacks(callbacks);
|
||||
// Note that we can't set up key-repeat until after SDL has init'd video
|
||||
|
||||
// Ignore use_gl for now, only used for drones on PC
|
||||
mWindow = NULL;
|
||||
mNeedsResize = FALSE;
|
||||
mOverrideAspectRatio = 0.f;
|
||||
@@ -230,7 +210,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
|
||||
mOriginalAspectRatio = 1024.0 / 768.0;
|
||||
|
||||
if (title.empty())
|
||||
mWindowTitle = "SDL Window"; // *FIX: (???)
|
||||
mWindowTitle = "SDL Window"; // *FIX: (?)
|
||||
else
|
||||
mWindowTitle = title;
|
||||
|
||||
@@ -315,7 +295,7 @@ static int x11_detect_VRAM_kb()
|
||||
#if LL_SOLARIS && defined(__sparc)
|
||||
// NOTE: there's no Xorg server on SPARC so just return 0
|
||||
// and allow SDL to attempt to get the amount of VRAM
|
||||
return(0);
|
||||
return 0;
|
||||
#else
|
||||
|
||||
std::string x_log_location("/var/log/");
|
||||
@@ -594,7 +574,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
|
||||
}
|
||||
|
||||
|
||||
if (!mWindow)
|
||||
{
|
||||
LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL;
|
||||
@@ -607,13 +586,14 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
}
|
||||
|
||||
// Detect video memory size.
|
||||
# if LL_X11
|
||||
#if LL_X11
|
||||
gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024;
|
||||
if (gGLManager.mVRAM != 0)
|
||||
{
|
||||
LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;
|
||||
} else
|
||||
# endif // LL_X11
|
||||
}
|
||||
else
|
||||
#endif // LL_X11
|
||||
{
|
||||
// fallback to letting SDL detect VRAM.
|
||||
// note: I've not seen SDL's detection ever actually find
|
||||
@@ -677,23 +657,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if 0 // *FIX: we're going to brave it for now...
|
||||
if (alphaBits < 8)
|
||||
{
|
||||
close();
|
||||
setupFailure(
|
||||
"Second Life is unable to run because it can't get an 8 bit alpha\n"
|
||||
"channel. Usually this is due to video card driver issues.\n"
|
||||
"Please make sure you have the latest video card drivers installed.\n"
|
||||
"Also be sure your monitor is set to True Color (32-bit) in\n"
|
||||
"Control Panels -> Display -> Settings.\n"
|
||||
"If you continue to receive this message, contact customer service.",
|
||||
"Error",
|
||||
OSMB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LL_X11
|
||||
/* Grab the window manager specific information */
|
||||
SDL_SysWMinfo info;
|
||||
@@ -705,8 +668,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
{
|
||||
mSDL_Display = info.info.x11.display;
|
||||
mSDL_XWindowID = info.info.x11.wmwindow;
|
||||
Lock_Display = info.info.x11.lock_func;
|
||||
Unlock_Display = info.info.x11.unlock_func;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -804,8 +765,6 @@ void LLWindowSDL::destroyContext()
|
||||
#if LL_X11
|
||||
mSDL_Display = NULL;
|
||||
mSDL_XWindowID = None;
|
||||
Lock_Display = NULL;
|
||||
Unlock_Display = NULL;
|
||||
#endif // LL_X11
|
||||
|
||||
// Clean up remaining GL state before blowing away window
|
||||
@@ -960,7 +919,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
|
||||
{
|
||||
if(mWindow)
|
||||
{
|
||||
// *FIX: (???)
|
||||
// *FIX: (?)
|
||||
//MacMoveWindow(mWindow, position.mX, position.mY, false);
|
||||
}
|
||||
|
||||
@@ -1206,9 +1165,7 @@ void LLWindowSDL::beforeDialog()
|
||||
{
|
||||
// Everything that we/SDL asked for should happen before we
|
||||
// potentially hand control over to GTK.
|
||||
maybe_lock_display();
|
||||
XSync(mSDL_Display, False);
|
||||
maybe_unlock_display();
|
||||
}
|
||||
#endif // LL_X11
|
||||
|
||||
@@ -1217,8 +1174,6 @@ void LLWindowSDL::beforeDialog()
|
||||
// diagnostics, if not already done.
|
||||
ll_try_gtk_init();
|
||||
#endif // LL_GTK
|
||||
|
||||
maybe_lock_display();
|
||||
}
|
||||
|
||||
void LLWindowSDL::afterDialog()
|
||||
@@ -1230,8 +1185,6 @@ void LLWindowSDL::afterDialog()
|
||||
|
||||
LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL;
|
||||
|
||||
maybe_unlock_display();
|
||||
|
||||
if (mFullscreen)
|
||||
{
|
||||
// need to restore fullscreen mode after dialog - only works
|
||||
@@ -1254,7 +1207,6 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
|
||||
|
||||
LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL;
|
||||
|
||||
maybe_lock_display();
|
||||
wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID);
|
||||
if (!wm_hints)
|
||||
wm_hints = XAllocWMHints();
|
||||
@@ -1267,7 +1219,6 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
|
||||
XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints);
|
||||
XFree(wm_hints);
|
||||
XSync(mSDL_Display, False);
|
||||
maybe_unlock_display();
|
||||
}
|
||||
}
|
||||
#endif // LL_X11
|
||||
@@ -1567,12 +1518,10 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
|
||||
{
|
||||
//LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL;
|
||||
//newmode = SDL_WM_GrabInput(wantmode);
|
||||
maybe_lock_display();
|
||||
result = XGrabPointer(mSDL_Display, mSDL_XWindowID,
|
||||
True, 0, GrabModeAsync,
|
||||
GrabModeAsync,
|
||||
None, None, CurrentTime);
|
||||
maybe_unlock_display();
|
||||
if (GrabSuccess == result)
|
||||
newmode = SDL_GRAB_ON;
|
||||
else
|
||||
@@ -1583,11 +1532,9 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
|
||||
newmode = SDL_GRAB_OFF;
|
||||
//newmode = SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
|
||||
maybe_lock_display();
|
||||
XUngrabPointer(mSDL_Display, CurrentTime);
|
||||
// Make sure the ungrab happens RIGHT NOW.
|
||||
XSync(mSDL_Display, False);
|
||||
maybe_unlock_display();
|
||||
} else
|
||||
{
|
||||
newmode = SDL_GRAB_QUERY; // neutral
|
||||
@@ -1784,6 +1731,7 @@ void LLWindowSDL::gatherInput()
|
||||
mKeyScanCode = event.key.keysym.scancode;
|
||||
mKeyVirtualKey = event.key.keysym.unicode;
|
||||
mKeyModifiers = event.key.keysym.mod;
|
||||
mKeySym = event.key.keysym.sym;
|
||||
|
||||
gKeyboard->handleKeyDown(event.key.keysym.sym, event.key.keysym.mod);
|
||||
// part of the fix for SL-13243
|
||||
@@ -1801,6 +1749,7 @@ void LLWindowSDL::gatherInput()
|
||||
mKeyScanCode = event.key.keysym.scancode;
|
||||
mKeyVirtualKey = event.key.keysym.unicode;
|
||||
mKeyModifiers = event.key.keysym.mod;
|
||||
mKeySym = event.key.keysym.sym;
|
||||
|
||||
if (SDLCheckGrabbyKeys(event.key.keysym.sym, FALSE) == 0)
|
||||
SDLReallyCaptureInput(FALSE); // part of the fix for SL-13243
|
||||
@@ -2312,8 +2261,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
|
||||
{
|
||||
gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
|
||||
GdkWindow *gdkwin = gdk_window_foreign_new(gWindowImplementation->mSDL_XWindowID);
|
||||
gdk_window_set_transient_for(GTK_WIDGET(win)->window,
|
||||
gdkwin);
|
||||
gdk_window_set_transient_for(GTK_WIDGET(win)->window, gdkwin);
|
||||
}
|
||||
# endif //LL_X11
|
||||
|
||||
@@ -2402,6 +2350,7 @@ LLSD LLWindowSDL::getNativeKeyData()
|
||||
result["scan_code"] = (S32)mKeyScanCode;
|
||||
result["virtual_key"] = (S32)mKeyVirtualKey;
|
||||
result["modifiers"] = (S32)modifiers;
|
||||
result[ "sdl_sym" ] = (S32)mKeySym;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -2427,8 +2376,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)
|
||||
{
|
||||
gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
|
||||
GdkWindow *gdkwin = gdk_window_foreign_new(mSDL_XWindowID);
|
||||
gdk_window_set_transient_for(GTK_WIDGET(win)->window,
|
||||
gdkwin);
|
||||
gdk_window_set_transient_for(GTK_WIDGET(win)->window, gdkwin);
|
||||
}
|
||||
# endif //LL_X11
|
||||
|
||||
@@ -2551,10 +2499,8 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
|
||||
# if LL_X11
|
||||
if (mSDL_Display)
|
||||
{
|
||||
maybe_lock_display();
|
||||
// Just in case - before forking.
|
||||
XSync(mSDL_Display, False);
|
||||
maybe_unlock_display();
|
||||
}
|
||||
# endif // LL_X11
|
||||
|
||||
@@ -2571,19 +2517,12 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
|
||||
LL_INFOS() << "spawn_web_browser returning." << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLWindowSDL::setTitle(const std::string &title)
|
||||
{
|
||||
mWindowTitle = title;
|
||||
SDL_WM_SetCaption(mWindowTitle.c_str(),mWindowTitle.c_str());
|
||||
}
|
||||
|
||||
void *LLWindowSDL::getPlatformWindow()
|
||||
{
|
||||
#if LL_GTK && LL_LLMOZLIB_ENABLED
|
||||
if (LLWindowSDL::ll_try_gtk_init())
|
||||
{
|
||||
maybe_lock_display();
|
||||
|
||||
GtkWidget *owin = gtk_window_new(GTK_WINDOW_POPUP);
|
||||
// Why a layout widget? A MozContainer would be ideal, but
|
||||
// it involves exposing Mozilla headers to mozlib-using apps.
|
||||
@@ -2595,8 +2534,6 @@ void *LLWindowSDL::getPlatformWindow()
|
||||
gtk_widget_realize(rtnw);
|
||||
GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(rtnw), GTK_NO_WINDOW);
|
||||
|
||||
maybe_unlock_display();
|
||||
|
||||
return rtnw;
|
||||
}
|
||||
#endif // LL_GTK && LL_LLMOZLIB_ENABLED
|
||||
@@ -2612,10 +2549,8 @@ void LLWindowSDL::bringToFront()
|
||||
#if LL_X11
|
||||
if (mSDL_Display && !mFullscreen)
|
||||
{
|
||||
maybe_lock_display();
|
||||
XRaiseWindow(mSDL_Display, mSDL_XWindowID);
|
||||
XSync(mSDL_Display, False);
|
||||
maybe_unlock_display();
|
||||
}
|
||||
#endif // LL_X11
|
||||
}
|
||||
@@ -2626,7 +2561,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
|
||||
// Use libfontconfig to find us a nice ordered list of fallback fonts
|
||||
// specific to this system.
|
||||
std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf");
|
||||
const int max_font_count_cutoff = 100; // fonts are expensive in the current system, don't enumerate an arbitrary number of them
|
||||
const int max_font_count_cutoff = 40; // fonts are expensive in the current system, don't enumerate an arbitrary number of them
|
||||
// Our 'ideal' font properties which define the sorting results.
|
||||
// slant=0 means Roman, index=0 means the first face in a font file
|
||||
// (the one we actually use), weight=80 means medium weight,
|
||||
@@ -2721,4 +2656,10 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
|
||||
return rtns;
|
||||
}
|
||||
|
||||
void LLWindowSDL::setTitle(const std::string& title)
|
||||
{
|
||||
mWindowTitle = title;
|
||||
SDL_WM_SetCaption(mWindowTitle.c_str(),mWindowTitle.c_str());
|
||||
}
|
||||
|
||||
#endif // LL_SDL
|
||||
|
||||
@@ -135,8 +135,6 @@ public:
|
||||
Window mSDL_XWindowID;
|
||||
Display *mSDL_Display;
|
||||
#endif
|
||||
void (*Lock_Display)(void);
|
||||
void (*Unlock_Display)(void);
|
||||
|
||||
#if LL_GTK
|
||||
// Lazily initialize and check the runtime GTK version for goodness.
|
||||
@@ -216,6 +214,7 @@ private:
|
||||
U32 mKeyScanCode;
|
||||
U32 mKeyVirtualKey;
|
||||
SDLMod mKeyModifiers;
|
||||
U32 mKeySym;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1539,6 +1539,7 @@ if (WINDOWS)
|
||||
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
generate_viewer_version
|
||||
stage_third_party_libs
|
||||
${COPY_INPUT_DEPENDENCIES}
|
||||
COMMENT "Performing viewer_manifest copy"
|
||||
|
||||
@@ -182,6 +182,8 @@ PSYS_SRC_PATTERN_ANGLE_CONE
|
||||
PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
|
||||
|
||||
OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type
|
||||
OBJECT_HOVER_HEIGHT This is a flag used with llGetObjectDetails to get hover height of the avatar. If no data is available, 0.0 is returned.
|
||||
OBJECT_LAST_OWNER_ID Gets the object's last owner ID.
|
||||
OBJECT_NAME Used with llGetObjectDetails to get an object's name
|
||||
OBJECT_DESC Used with llGetObjectDetails to get an object's description
|
||||
OBJECT_POS Used with llGetObjectDetails to get an object's position
|
||||
@@ -189,6 +191,7 @@ OBJECT_ROT Used with llGetObjectDetails to get an o
|
||||
OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity
|
||||
OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned
|
||||
OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key
|
||||
OBJECT_CLICK_ACTION This is a flag used with llGetObjectDetails to get the click action. The default is 0.
|
||||
OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key
|
||||
OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent
|
||||
OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent.
|
||||
@@ -199,6 +202,7 @@ OBJECT_SERVER_COST Used with llGetObjectDetails to get the
|
||||
OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost.
|
||||
OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost.
|
||||
OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings.
|
||||
OBJECT_BODY_SHAPE_TYPE This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data. If no data is available, -1.0 is returned. This is normally between 0 and 1.0, with 0.5 and larger considered 'male'
|
||||
OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters.
|
||||
OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID.
|
||||
OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point.
|
||||
@@ -454,6 +458,7 @@ PRIM_SHINY_LOW Low shininess
|
||||
PRIM_SHINY_MEDIUM Medium shininess
|
||||
PRIM_SHINY_HIGH High shininess
|
||||
|
||||
|
||||
PRIM_BUMP_NONE No bump map
|
||||
PRIM_BUMP_BRIGHT Generate bump map from highlights
|
||||
PRIM_BUMP_DARK Generate bump map from lowlights
|
||||
|
||||
@@ -86,18 +86,6 @@
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>SianaRenderDeferredInvisiprim</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Support invisiprims in deferred mode</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>SianaVoidWaterSubdivision</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -75,9 +75,6 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0)
|
||||
case POOL_FULLBRIGHT:
|
||||
poolp = new LLDrawPoolFullbright();
|
||||
break;
|
||||
case POOL_INVISIBLE:
|
||||
poolp = new LLDrawPoolInvisible();
|
||||
break;
|
||||
case POOL_GLOW:
|
||||
poolp = new LLDrawPoolGlow();
|
||||
break;
|
||||
|
||||
@@ -58,18 +58,12 @@ public:
|
||||
POOL_SKY,
|
||||
POOL_WL_SKY,
|
||||
POOL_GRASS,
|
||||
POOL_INVISIBLE, // see below *
|
||||
POOL_AVATAR,
|
||||
POOL_VOIDWATER,
|
||||
POOL_WATER,
|
||||
POOL_GLOW,
|
||||
POOL_ALPHA,
|
||||
NUM_POOL_TYPES,
|
||||
// * invisiprims work by rendering to the depth buffer but not the color buffer, occluding anything rendered after them
|
||||
// - and the LLDrawPool types enum controls what order things are rendered in
|
||||
// - so, it has absolute control over what invisprims block
|
||||
// ...invisiprims being rendered in pool_invisible
|
||||
// ...shiny/bump mapped objects in rendered in POOL_BUMP
|
||||
};
|
||||
|
||||
LLDrawPool(const U32 type);
|
||||
@@ -126,8 +120,6 @@ public:
|
||||
PASS_SIMPLE = NUM_POOL_TYPES,
|
||||
PASS_GRASS,
|
||||
PASS_FULLBRIGHT,
|
||||
PASS_INVISIBLE,
|
||||
PASS_INVISI_SHINY,
|
||||
PASS_FULLBRIGHT_SHINY,
|
||||
PASS_SHINY,
|
||||
PASS_BUMP,
|
||||
|
||||
@@ -918,7 +918,7 @@ void LLDrawPoolAvatar::beginRiggedShinySimple()
|
||||
llassert_always(sVertexProgram->mProgramObject > 0);
|
||||
|
||||
sVertexProgram->bind();
|
||||
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
|
||||
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel);
|
||||
}
|
||||
|
||||
void LLDrawPoolAvatar::endRiggedShinySimple()
|
||||
@@ -928,7 +928,7 @@ void LLDrawPoolAvatar::endRiggedShinySimple()
|
||||
if(!sVertexProgram)
|
||||
return;
|
||||
|
||||
LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
|
||||
LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel);
|
||||
sVertexProgram->unbind();
|
||||
sVertexProgram = NULL;
|
||||
}
|
||||
@@ -951,7 +951,7 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
|
||||
llassert_always(sVertexProgram->mProgramObject > 0);
|
||||
|
||||
sVertexProgram->bind();
|
||||
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
|
||||
LLDrawPoolBump::bindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel);
|
||||
if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred)
|
||||
{
|
||||
sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f);
|
||||
@@ -971,7 +971,7 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny()
|
||||
if(!sVertexProgram)
|
||||
return;
|
||||
|
||||
LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel, false);
|
||||
LLDrawPoolBump::unbindCubeMap(sVertexProgram, 2, sDiffuseChannel, cube_channel);
|
||||
sVertexProgram->unbind();
|
||||
sVertexProgram = NULL;
|
||||
}
|
||||
|
||||
@@ -330,11 +330,10 @@ void LLDrawPoolBump::endRenderPass(S32 pass)
|
||||
}
|
||||
|
||||
//static
|
||||
void LLDrawPoolBump::beginShiny(bool invisible)
|
||||
void LLDrawPoolBump::beginShiny()
|
||||
{
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))||
|
||||
(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
|
||||
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -342,7 +341,7 @@ void LLDrawPoolBump::beginShiny(bool invisible)
|
||||
mShiny = TRUE;
|
||||
sVertexMask = VERTEX_MASK_SHINY;
|
||||
// Second pass: environment map
|
||||
if (!invisible && mVertexShaderLevel > 1)
|
||||
if (mVertexShaderLevel > 1)
|
||||
{
|
||||
sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD0;
|
||||
}
|
||||
@@ -357,7 +356,7 @@ void LLDrawPoolBump::beginShiny(bool invisible)
|
||||
shader = NULL;
|
||||
}
|
||||
|
||||
bindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel, invisible);
|
||||
bindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel);
|
||||
|
||||
if (mVertexShaderLevel > 1)
|
||||
{ //indexed texture rendering, channel 0 is always diffuse
|
||||
@@ -366,12 +365,12 @@ void LLDrawPoolBump::beginShiny(bool invisible)
|
||||
}
|
||||
|
||||
//static
|
||||
void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible)
|
||||
void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel)
|
||||
{
|
||||
LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;
|
||||
if( cube_map )
|
||||
{
|
||||
if (!invisible && shader )
|
||||
if (shader)
|
||||
{
|
||||
LLMatrix4 mat(gGLModelView.getF32ptr());
|
||||
LLVector3 vec = LLVector3(gShinyOrigin) * mat;
|
||||
@@ -412,11 +411,10 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolBump::renderShiny(bool invisible)
|
||||
void LLDrawPoolBump::renderShiny()
|
||||
{
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))||
|
||||
(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
|
||||
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -424,28 +422,24 @@ void LLDrawPoolBump::renderShiny(bool invisible)
|
||||
if( gSky.mVOSkyp->getCubeMap() )
|
||||
{
|
||||
LLGLEnable blend_enable(GL_BLEND);
|
||||
if (!invisible && mVertexShaderLevel > 1)
|
||||
if (mVertexShaderLevel > 1)
|
||||
{
|
||||
LLRenderPass::pushBatches(LLRenderPass::PASS_SHINY, sVertexMask | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
|
||||
}
|
||||
else if (!invisible)
|
||||
else
|
||||
{
|
||||
renderGroups(LLRenderPass::PASS_SHINY, sVertexMask);
|
||||
}
|
||||
//else // invisible (deprecated)
|
||||
//{
|
||||
//renderGroups(LLRenderPass::PASS_INVISI_SHINY, sVertexMask);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible)
|
||||
void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel)
|
||||
{
|
||||
LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;
|
||||
if( cube_map )
|
||||
{
|
||||
if (!invisible && shader_level > 1)
|
||||
if (shader_level > 1)
|
||||
{
|
||||
shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
|
||||
|
||||
@@ -473,16 +467,15 @@ void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32&
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolBump::endShiny(bool invisible)
|
||||
void LLDrawPoolBump::endShiny()
|
||||
{
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))||
|
||||
(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
|
||||
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unbindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel, invisible);
|
||||
unbindCubeMap(shader, mVertexShaderLevel, diffuse_channel, cube_channel);
|
||||
if (shader)
|
||||
{
|
||||
shader->unbind();
|
||||
@@ -1545,76 +1538,3 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolInvisible::render(S32 pass)
|
||||
{ //render invisiprims
|
||||
LLFastTimer t(FTM_RENDER_INVISIBLE);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gOcclusionProgram.bind();
|
||||
}
|
||||
|
||||
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
|
||||
glStencilMask(0);
|
||||
gGL.setColorMask(false, false);
|
||||
pushBatches(LLRenderPass::PASS_INVISIBLE, invisi_mask, FALSE);
|
||||
gGL.setColorMask(true, false);
|
||||
glStencilMask(0xFFFFFFFF);
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
gOcclusionProgram.unbind();
|
||||
}
|
||||
|
||||
/*if (gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)) // invisible (deprecated)
|
||||
{
|
||||
beginShiny(true);
|
||||
renderShiny(true);
|
||||
endShiny(true);
|
||||
}*/
|
||||
}
|
||||
|
||||
void LLDrawPoolInvisible::beginDeferredPass(S32 pass)
|
||||
{
|
||||
static const LLCachedControl<bool> enable("SianaRenderDeferredInvisiprim");
|
||||
if (!enable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
beginRenderPass(pass);
|
||||
}
|
||||
|
||||
void LLDrawPoolInvisible::endDeferredPass( S32 pass )
|
||||
{
|
||||
endRenderPass(pass);
|
||||
}
|
||||
|
||||
void LLDrawPoolInvisible::renderDeferred( S32 pass )
|
||||
{ //render invisiprims; this doesn't work becaue it also blocks all the post-deferred stuff
|
||||
static const LLCachedControl<bool> enable("SianaRenderDeferredInvisiprim");
|
||||
if (!enable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLFastTimer t(FTM_RENDER_INVISIBLE);
|
||||
|
||||
gOcclusionProgram.bind();
|
||||
|
||||
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
|
||||
glStencilMask(0);
|
||||
gGL.setColorMask(false, false);
|
||||
pushBatches(LLRenderPass::PASS_INVISIBLE, invisi_mask, FALSE);
|
||||
gGL.setColorMask(true, true);
|
||||
glStencilMask(0xFFFFFFFF);
|
||||
|
||||
gOcclusionProgram.unbind();
|
||||
|
||||
/*if (gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)) // invisible (deprecated)
|
||||
{
|
||||
beginShiny(true);
|
||||
renderShiny(true);
|
||||
endShiny(true);
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ public:
|
||||
|
||||
S32 numBumpPasses();
|
||||
|
||||
void beginShiny(bool invisible = false);
|
||||
void renderShiny(bool invisible = false);
|
||||
void endShiny(bool invisible = false);
|
||||
void beginShiny();
|
||||
void renderShiny();
|
||||
void endShiny();
|
||||
|
||||
void beginFullbrightShiny();
|
||||
void renderFullbrightShiny();
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
void renderBump(U32 pass = LLRenderPass::PASS_BUMP);
|
||||
void endBump(U32 pass = LLRenderPass::PASS_BUMP);
|
||||
|
||||
static void bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible);
|
||||
static void unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel, bool invisible);
|
||||
static void bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel);
|
||||
static void unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel);
|
||||
|
||||
virtual S32 getNumDeferredPasses();
|
||||
/*virtual*/ void beginDeferredPass(S32 pass);
|
||||
@@ -173,30 +173,4 @@ private:
|
||||
|
||||
extern LLBumpImageList gBumpImageList;
|
||||
|
||||
class LLDrawPoolInvisible : public LLDrawPoolBump
|
||||
{
|
||||
public:
|
||||
LLDrawPoolInvisible() : LLDrawPoolBump(LLDrawPool::POOL_INVISIBLE) { }
|
||||
|
||||
enum
|
||||
{
|
||||
VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX
|
||||
};
|
||||
|
||||
virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
|
||||
|
||||
virtual void prerender() { }
|
||||
|
||||
virtual void render(S32 pass = 0);
|
||||
virtual void beginRenderPass( S32 pass ) { }
|
||||
virtual void endRenderPass( S32 pass ) { }
|
||||
virtual S32 getNumPasses() {return 1;}
|
||||
|
||||
virtual S32 getNumDeferredPasses() { return 1; }
|
||||
/*virtual*/ void beginDeferredPass(S32 pass);
|
||||
/*virtual*/ void endDeferredPass(S32 pass);
|
||||
/*virtual*/ void renderDeferred(S32 pass);
|
||||
};
|
||||
|
||||
|
||||
#endif // LL_LLDRAWPOOLBUMP_H
|
||||
|
||||
@@ -74,20 +74,11 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
|
||||
// Hack!
|
||||
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
|
||||
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
|
||||
mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
|
||||
TRUE, LLGLTexture::BOOST_UI,
|
||||
LLViewerTexture::FETCHED_TEXTURE,
|
||||
int_format, format,
|
||||
LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
|
||||
|
||||
//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
|
||||
mAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
||||
m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
|
||||
TRUE, LLGLTexture::BOOST_UI,
|
||||
LLViewerTexture::FETCHED_TEXTURE,
|
||||
int_format, format,
|
||||
LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
|
||||
int_format, format);
|
||||
|
||||
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
|
||||
m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
||||
@@ -76,9 +76,7 @@ public:
|
||||
/*virtual*/ LLViewerTexture *getDebugTexture();
|
||||
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
|
||||
|
||||
LLPointer<LLViewerTexture> mAlphaRampImagep;
|
||||
LLPointer<LLViewerTexture> m2DAlphaRampImagep;
|
||||
LLPointer<LLViewerTexture> mAlphaNoiseImagep;
|
||||
|
||||
static S32 sDetailMode;
|
||||
static F32 sDetailScale; // meters per texture
|
||||
|
||||
@@ -70,9 +70,7 @@
|
||||
#include "lldxhardware.h"
|
||||
#endif
|
||||
|
||||
#if !LL_LINUX
|
||||
#include "cef/llceflib.h"
|
||||
#endif
|
||||
|
||||
extern LLMemoryInfo gSysMemory;
|
||||
extern U32 gPacketsIn;
|
||||
@@ -199,10 +197,10 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
else
|
||||
support.append(RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
|
||||
// [/RLVa:KN]
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
support.append(gLastVersionChannel);
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
|
||||
|
||||
@@ -224,7 +222,7 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
// CPU
|
||||
support.append("CPU: ");
|
||||
support.append( gSysCPU.getCPUString() );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
/* This is confusing and WRONG.
|
||||
support.append("SSE Support:");
|
||||
@@ -243,15 +241,15 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
|
||||
support.append("OS Version: ");
|
||||
support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
support.append("Graphics Card Vendor: ");
|
||||
support.append( (const char*) glGetString(GL_VENDOR) );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
support.append("Graphics Card: ");
|
||||
support.append( (const char*) glGetString(GL_RENDERER) );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
#if LL_WINDOWS
|
||||
getWindow()->incBusyCount();
|
||||
@@ -262,7 +260,7 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
{
|
||||
support.append(driver_info["DriverVersion"]);
|
||||
}
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
getWindow()->decBusyCount();
|
||||
getWindow()->setCursor(UI_CURSOR_ARROW);
|
||||
#endif
|
||||
@@ -270,30 +268,27 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
support.append("OpenGL Version: ");
|
||||
support.append( (const char*) glGetString(GL_VERSION) );
|
||||
// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0)
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
support.append("RLV Version: " + (RlvActions::isRlvEnabled() ? RlvStrings::getVersionAbout() : "(disabled)"));
|
||||
// [/RLVa:KB]
|
||||
support.append("\n\n");
|
||||
|
||||
support.append("libcurl Version: ");
|
||||
support.append( LLCurl::getVersionString() );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
support.append("J2C Decoder Version: ");
|
||||
support.append( LLImageJ2C::getEngineInfo() );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
support.append("Audio Driver Version: ");
|
||||
bool want_fullname = true;
|
||||
support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" );
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
|
||||
#if !LL_LINUX
|
||||
// TODO: Implement media plugin version query
|
||||
support.append("LLCEFLib/CEF Version: ");
|
||||
support.append(LLCEFLIB_VERSION);
|
||||
support.append("\n");
|
||||
#endif
|
||||
support.append('\n');
|
||||
|
||||
if (gPacketsIn > 0)
|
||||
{
|
||||
@@ -302,7 +297,7 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
F32(gPacketsIn),
|
||||
100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
|
||||
support.append(packet_loss);
|
||||
support.append("\n");
|
||||
support.append('\n');
|
||||
}
|
||||
|
||||
support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
|
||||
@@ -328,7 +323,7 @@ LLFloaterAbout::LLFloaterAbout()
|
||||
licenses_widget->clear();
|
||||
while (std::getline(licenses_file, license_line))
|
||||
{
|
||||
licenses_widget->appendColoredText(license_line + "\n", FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
|
||||
licenses_widget->appendColoredText(license_line + '\n', FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
|
||||
}
|
||||
licenses_file.close();
|
||||
}
|
||||
|
||||
@@ -1213,8 +1213,6 @@ void render_hud_attachments()
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_SHINY);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_INVISIBLE);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY);
|
||||
|
||||
gPipeline.stateSort(hud_cam, result);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ const S32 NUDGE_FRAMES = 2;
|
||||
const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed
|
||||
|
||||
struct LLKeyboardActionRegistry
|
||||
: public LLRegistrySingleton<std::string, boost::function<void (EKeystate keystate)>, LLKeyboardActionRegistry>
|
||||
: public LLRegistrySingleton<std::string, std::function<void (EKeystate keystate)>, LLKeyboardActionRegistry>
|
||||
{
|
||||
};
|
||||
|
||||
@@ -87,7 +87,7 @@ void agent_jump( EKeystate s )
|
||||
gAgent.moveUp(1);
|
||||
}
|
||||
}
|
||||
// <singu>
|
||||
|
||||
void agent_toggle_down( EKeystate s )
|
||||
{
|
||||
if (KEYSTATE_UP == s) return;
|
||||
@@ -101,7 +101,6 @@ void agent_toggle_down( EKeystate s )
|
||||
}
|
||||
gAgent.moveUp(-1);
|
||||
}
|
||||
// </singu>
|
||||
|
||||
void agent_push_down( EKeystate s )
|
||||
{
|
||||
@@ -574,11 +573,11 @@ void start_gesture( EKeystate s )
|
||||
#define REGISTER_KEYBOARD_ACTION(KEY, ACTION) LLREGISTER_STATIC(LLKeyboardActionRegistry, KEY, ACTION);
|
||||
REGISTER_KEYBOARD_ACTION("jump", agent_jump);
|
||||
REGISTER_KEYBOARD_ACTION("push_down", agent_push_down);
|
||||
REGISTER_KEYBOARD_ACTION("toggle_down", agent_toggle_down);
|
||||
REGISTER_KEYBOARD_ACTION("push_forward", agent_push_forward);
|
||||
REGISTER_KEYBOARD_ACTION("push_backward", agent_push_backward);
|
||||
REGISTER_KEYBOARD_ACTION("look_up", agent_look_up);
|
||||
REGISTER_KEYBOARD_ACTION("look_down", agent_look_down);
|
||||
REGISTER_KEYBOARD_ACTION("toggle_down", agent_toggle_down);
|
||||
REGISTER_KEYBOARD_ACTION("toggle_fly", agent_toggle_fly);
|
||||
REGISTER_KEYBOARD_ACTION("turn_left", agent_turn_left);
|
||||
REGISTER_KEYBOARD_ACTION("turn_right", agent_turn_right);
|
||||
@@ -714,8 +713,8 @@ BOOL LLViewerKeyboard::handleKeyUp(KEY translated_key, MASK translated_mask)
|
||||
BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name)
|
||||
{
|
||||
S32 index;
|
||||
typedef boost::function<void(EKeystate)> function_t;
|
||||
function_t function = NULL;
|
||||
typedef std::function<void(EKeystate)> function_t;
|
||||
function_t function;
|
||||
std::string name;
|
||||
|
||||
// Allow remapping of F2-F12
|
||||
|
||||
@@ -171,6 +171,20 @@ void LLViewerTextureList::doPreloadImages()
|
||||
image->setAddressMode(LLTexUnit::TAM_WRAP);
|
||||
mImagePreloads.insert(image);
|
||||
}
|
||||
image = LLViewerTextureManager::getFetchedTextureFromFile("transparent.j2c", MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE,
|
||||
0,0,LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
|
||||
if (image)
|
||||
{
|
||||
image->setAddressMode(LLTexUnit::TAM_WRAP);
|
||||
mImagePreloads.insert(image);
|
||||
}
|
||||
image = LLViewerTextureManager::getFetchedTextureFromFile("transparent.j2c", MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE,
|
||||
0,0,LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
|
||||
if (image)
|
||||
{
|
||||
image->setAddressMode(LLTexUnit::TAM_WRAP);
|
||||
mImagePreloads.insert(image);
|
||||
}
|
||||
//Hideous hack to set filtering and address modes without messing with our texture classes.
|
||||
{
|
||||
LLPointer<LLUIImage> temp_image = image_list->getUIImage("checkerboard.tga",LLViewerFetchedTexture::BOOST_UI);
|
||||
|
||||
@@ -3073,7 +3073,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
||||
static const F32 ARC_BUMP_MULT = 1.25f; // tested based on performance
|
||||
static const F32 ARC_FLEXI_MULT = 5; // tested based on performance
|
||||
static const F32 ARC_SHINY_MULT = 1.6f; // tested based on performance
|
||||
static const F32 ARC_INVISI_COST = 1.2f; // tested based on performance
|
||||
static const F32 ARC_WEIGHTED_MESH = 1.2f; // tested based on performance
|
||||
|
||||
static const F32 ARC_PLANAR_COST = 1.0f; // tested based on performance to have negligible impact
|
||||
@@ -3082,7 +3081,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
||||
|
||||
F32 shame = 0;
|
||||
|
||||
U32 invisi = 0;
|
||||
U32 shiny = 0;
|
||||
U32 glow = 0;
|
||||
U32 alpha = 0;
|
||||
@@ -3190,10 +3188,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
||||
{
|
||||
alpha = 1;
|
||||
}
|
||||
else if (img && img->getPrimaryFormat() == GL_ALPHA)
|
||||
{
|
||||
invisi = 1;
|
||||
}
|
||||
if (face->hasMedia())
|
||||
{
|
||||
media_faces++;
|
||||
@@ -3247,11 +3241,6 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
||||
shame *= alpha * ARC_ALPHA_COST;
|
||||
}
|
||||
|
||||
if(invisi)
|
||||
{
|
||||
shame *= invisi * ARC_INVISI_COST;
|
||||
}
|
||||
|
||||
if (glow)
|
||||
{
|
||||
shame *= glow * ARC_GLOW_MULT;
|
||||
@@ -4057,11 +4046,6 @@ bool can_batch_texture(const LLFace* facep)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (facep->getTexture() && facep->getTexture()->getPrimaryFormat() == GL_ALPHA)
|
||||
{ //can't batch invisiprims
|
||||
return false;
|
||||
}
|
||||
|
||||
if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
|
||||
{ //texture animation breaks batches
|
||||
return false;
|
||||
@@ -4080,11 +4064,6 @@ bool can_batch_texture(const LLFace* facep)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (facep->getPoolType() != LLDrawPool::POOL_ALPHA && facep->getTexture() && facep->getTexture()->getPrimaryFormat() == GL_ALPHA)
|
||||
{ //can't batch invisiprims
|
||||
return false;
|
||||
}
|
||||
|
||||
if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
|
||||
{ //texture animation breaks batches
|
||||
return false;
|
||||
@@ -4118,7 +4097,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
||||
|
||||
if(!facep->mShinyInAlpha)
|
||||
facep->mShinyInAlpha = (type == LLRenderPass::PASS_FULLBRIGHT_SHINY) ||
|
||||
(type == LLRenderPass::PASS_INVISI_SHINY) ||
|
||||
(type == LLRenderPass::PASS_SHINY) ||
|
||||
(LLPipeline::sRenderDeferred && type == LLRenderPass::PASS_BUMP) ||
|
||||
(LLPipeline::sRenderDeferred && type == LLRenderPass::PASS_SIMPLE);
|
||||
@@ -4133,7 +4111,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
||||
if(!alt_batching)
|
||||
{
|
||||
fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) ||
|
||||
(type == LLRenderPass::PASS_INVISIBLE) ||
|
||||
(type == LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK) ||
|
||||
(type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)) ||
|
||||
(facep->getTextureEntry()->getFullbright());
|
||||
@@ -6050,12 +6027,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
|
||||
&& te->getShiny()
|
||||
&& can_be_shiny)
|
||||
{ //shiny
|
||||
if (tex->getPrimaryFormat() == GL_ALPHA)
|
||||
{ //invisiprim+shiny
|
||||
registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY);
|
||||
registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
|
||||
}
|
||||
else if (LLPipeline::sRenderDeferred && !hud_group)
|
||||
if (LLPipeline::sRenderDeferred && !hud_group)
|
||||
{ //deferred rendering
|
||||
if (te->getFullbright())
|
||||
{ //register in post deferred fullbright shiny pass
|
||||
@@ -6086,11 +6058,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
|
||||
}
|
||||
else
|
||||
{ //not alpha and not shiny
|
||||
if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA)
|
||||
{ //invisiprim
|
||||
registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
|
||||
}
|
||||
else if (fullbright)
|
||||
if (fullbright)
|
||||
{ //fullbright
|
||||
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{
|
||||
@@ -6213,15 +6181,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tex->getPrimaryFormat() == GL_ALPHA)
|
||||
{
|
||||
if(is_shiny_shader && facep->getPoolType() == LLDrawPool::POOL_BUMP)
|
||||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY);
|
||||
}
|
||||
registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
|
||||
}
|
||||
else if (facep->getPoolType() == LLDrawPool::POOL_SIMPLE)
|
||||
if (facep->getPoolType() == LLDrawPool::POOL_SIMPLE)
|
||||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,6 @@ const LLMatrix4a* gGLLastMatrix = NULL;
|
||||
|
||||
LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY("Geometry");
|
||||
LLFastTimer::DeclareTimer FTM_RENDER_GRASS("Grass");
|
||||
LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE("Invisible");
|
||||
LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION("Occlusion");
|
||||
LLFastTimer::DeclareTimer FTM_RENDER_SHINY("Shiny");
|
||||
LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE("Simple");
|
||||
@@ -234,7 +233,6 @@ std::string gPoolNames[] =
|
||||
"POOL_SKY",
|
||||
"POOL_WL_SKY",
|
||||
"POOL_GRASS",
|
||||
"POOL_INVISIBLE",
|
||||
"POOL_AVATAR",
|
||||
"POOL_VOIDWATER",
|
||||
"POOL_WATER",
|
||||
@@ -382,7 +380,6 @@ LLPipeline::LLPipeline() :
|
||||
mAlphaMaskPool(NULL),
|
||||
mFullbrightAlphaMaskPool(NULL),
|
||||
mFullbrightPool(NULL),
|
||||
mInvisiblePool(NULL),
|
||||
mGlowPool(NULL),
|
||||
mBumpPool(NULL),
|
||||
mMaterialsPool(NULL),
|
||||
@@ -421,7 +418,6 @@ void LLPipeline::init()
|
||||
getPool(LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK);
|
||||
getPool(LLDrawPool::POOL_GRASS);
|
||||
getPool(LLDrawPool::POOL_FULLBRIGHT);
|
||||
getPool(LLDrawPool::POOL_INVISIBLE);
|
||||
getPool(LLDrawPool::POOL_BUMP);
|
||||
getPool(LLDrawPool::POOL_MATERIALS);
|
||||
getPool(LLDrawPool::POOL_GLOW);
|
||||
@@ -553,8 +549,6 @@ void LLPipeline::cleanup()
|
||||
mSimplePool = NULL;
|
||||
delete mFullbrightPool;
|
||||
mFullbrightPool = NULL;
|
||||
delete mInvisiblePool;
|
||||
mInvisiblePool = NULL;
|
||||
delete mGlowPool;
|
||||
mGlowPool = NULL;
|
||||
delete mBumpPool;
|
||||
@@ -1395,10 +1389,6 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0)
|
||||
poolp = mFullbrightPool;
|
||||
break;
|
||||
|
||||
case LLDrawPool::POOL_INVISIBLE:
|
||||
poolp = mInvisiblePool;
|
||||
break;
|
||||
|
||||
case LLDrawPool::POOL_GLOW:
|
||||
poolp = mGlowPool;
|
||||
break;
|
||||
@@ -5059,18 +5049,6 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
|
||||
}
|
||||
break;
|
||||
|
||||
case LLDrawPool::POOL_INVISIBLE:
|
||||
if (mInvisiblePool)
|
||||
{
|
||||
llassert(0);
|
||||
LL_WARNS() << "Ignoring duplicate simple pool." << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
mInvisiblePool = (LLRenderPass*) new_poolp;
|
||||
}
|
||||
break;
|
||||
|
||||
case LLDrawPool::POOL_GLOW:
|
||||
if (mGlowPool)
|
||||
{
|
||||
@@ -5221,11 +5199,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
|
||||
mFullbrightPool = NULL;
|
||||
break;
|
||||
|
||||
case LLDrawPool::POOL_INVISIBLE:
|
||||
llassert(mInvisiblePool == poolp);
|
||||
mInvisiblePool = NULL;
|
||||
break;
|
||||
|
||||
case LLDrawPool::POOL_WL_SKY:
|
||||
llassert(mWLSkyPool == poolp);
|
||||
mWLSkyPool = NULL;
|
||||
@@ -8314,8 +8287,6 @@ void LLPipeline::renderDeferredLighting()
|
||||
LLPipeline::RENDER_TYPE_PASS_GLOW,
|
||||
LLPipeline::RENDER_TYPE_PASS_GRASS,
|
||||
LLPipeline::RENDER_TYPE_PASS_SHINY,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISIBLE,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY,
|
||||
LLPipeline::RENDER_TYPE_AVATAR,
|
||||
LLPipeline::RENDER_TYPE_ALPHA_MASK,
|
||||
LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK,
|
||||
@@ -8886,8 +8857,6 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
|
||||
LLPipeline::RENDER_TYPE_PASS_GLOW,
|
||||
LLPipeline::RENDER_TYPE_PASS_GRASS,
|
||||
LLPipeline::RENDER_TYPE_PASS_SHINY,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISIBLE,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY,
|
||||
LLPipeline::RENDER_TYPE_AVATAR,
|
||||
LLPipeline::RENDER_TYPE_ALPHA_MASK,
|
||||
LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK,
|
||||
@@ -10542,12 +10511,9 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
|
||||
LLPipeline::RENDER_TYPE_PASS_GLOW,
|
||||
LLPipeline::RENDER_TYPE_PASS_GRASS,
|
||||
LLPipeline::RENDER_TYPE_PASS_SHINY,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISIBLE,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY,
|
||||
LLPipeline::RENDER_TYPE_AVATAR,
|
||||
LLPipeline::RENDER_TYPE_ALPHA_MASK,
|
||||
LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK,
|
||||
LLPipeline::RENDER_TYPE_INVISIBLE,
|
||||
LLPipeline::RENDER_TYPE_SIMPLE,
|
||||
END_RENDER_TYPES);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,6 @@ void glh_set_current_projection(const LLMatrix4a& mat);
|
||||
|
||||
extern LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY;
|
||||
extern LLFastTimer::DeclareTimer FTM_RENDER_GRASS;
|
||||
extern LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE;
|
||||
extern LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION;
|
||||
extern LLFastTimer::DeclareTimer FTM_RENDER_SHINY;
|
||||
extern LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE;
|
||||
@@ -448,7 +447,6 @@ public:
|
||||
RENDER_TYPE_MATERIALS = LLDrawPool::POOL_MATERIALS,
|
||||
RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR,
|
||||
RENDER_TYPE_TREE = LLDrawPool::POOL_TREE,
|
||||
RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE,
|
||||
RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER,
|
||||
RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
|
||||
RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
|
||||
@@ -456,8 +454,6 @@ public:
|
||||
RENDER_TYPE_PASS_SIMPLE = LLRenderPass::PASS_SIMPLE,
|
||||
RENDER_TYPE_PASS_GRASS = LLRenderPass::PASS_GRASS,
|
||||
RENDER_TYPE_PASS_FULLBRIGHT = LLRenderPass::PASS_FULLBRIGHT,
|
||||
RENDER_TYPE_PASS_INVISIBLE = LLRenderPass::PASS_INVISIBLE,
|
||||
RENDER_TYPE_PASS_INVISI_SHINY = LLRenderPass::PASS_INVISI_SHINY,
|
||||
RENDER_TYPE_PASS_FULLBRIGHT_SHINY = LLRenderPass::PASS_FULLBRIGHT_SHINY,
|
||||
RENDER_TYPE_PASS_SHINY = LLRenderPass::PASS_SHINY,
|
||||
RENDER_TYPE_PASS_BUMP = LLRenderPass::PASS_BUMP,
|
||||
@@ -771,7 +767,6 @@ private:
|
||||
LLRenderPass* mAlphaMaskPool;
|
||||
LLRenderPass* mFullbrightAlphaMaskPool;
|
||||
LLRenderPass* mFullbrightPool;
|
||||
LLDrawPool* mInvisiblePool;
|
||||
LLDrawPool* mGlowPool;
|
||||
LLDrawPool* mBumpPool;
|
||||
LLDrawPool* mMaterialsPool;
|
||||
|
||||
@@ -182,6 +182,8 @@ PSYS_SRC_PATTERN_ANGLE_CONE
|
||||
PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
|
||||
|
||||
OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type
|
||||
OBJECT_HOVER_HEIGHT This is a flag used with llGetObjectDetails to get hover height of the avatar. If no data is available, 0.0 is returned.
|
||||
OBJECT_LAST_OWNER_ID Gets the object's last owner ID.
|
||||
OBJECT_NAME Used with llGetObjectDetails to get an object's name
|
||||
OBJECT_DESC Used with llGetObjectDetails to get an object's description
|
||||
OBJECT_POS Used with llGetObjectDetails to get an object's position
|
||||
@@ -189,6 +191,7 @@ OBJECT_ROT Used with llGetObjectDetails to get an o
|
||||
OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity
|
||||
OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned
|
||||
OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key
|
||||
OBJECT_CLICK_ACTION This is a flag used with llGetObjectDetails to get the click action. The default is 0.
|
||||
OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key
|
||||
OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent
|
||||
OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent.
|
||||
@@ -199,6 +202,7 @@ OBJECT_SERVER_COST Used with llGetObjectDetails to get the
|
||||
OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost.
|
||||
OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost.
|
||||
OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings.
|
||||
OBJECT_BODY_SHAPE_TYPE This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data. If no data is available, -1.0 is returned. This is normally between 0 and 1.0, with 0.5 and larger considered 'male'
|
||||
OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters.
|
||||
OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID.
|
||||
OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
none
|
||||
</defaultwidget>
|
||||
<defaultimpl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</defaultimpl>
|
||||
<widgetset name="web">
|
||||
<label name="web_label">
|
||||
@@ -120,7 +120,7 @@
|
||||
none
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="none/none">
|
||||
@@ -131,7 +131,7 @@
|
||||
none
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/*">
|
||||
@@ -164,7 +164,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
|
||||
@@ -186,7 +186,7 @@
|
||||
web
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/ogg">
|
||||
@@ -208,7 +208,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/postscript">
|
||||
@@ -219,7 +219,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/rtf">
|
||||
@@ -230,7 +230,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/smil">
|
||||
@@ -241,7 +241,7 @@
|
||||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/xhtml+xml">
|
||||
@@ -252,7 +252,7 @@
|
||||
web
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/x-director">
|
||||
@@ -263,7 +263,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/mid">
|
||||
@@ -318,7 +318,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="image/gif">
|
||||
@@ -329,7 +329,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="image/jpeg">
|
||||
@@ -340,7 +340,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="image/png">
|
||||
@@ -351,7 +351,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="image/svg+xml">
|
||||
@@ -362,7 +362,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="image/tiff">
|
||||
@@ -373,7 +373,7 @@
|
||||
image
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="text/html">
|
||||
@@ -384,7 +384,7 @@
|
||||
web
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="text/plain">
|
||||
@@ -395,7 +395,7 @@
|
||||
text
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="text/xml">
|
||||
@@ -406,7 +406,7 @@
|
||||
text
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_webkit
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/mpeg">
|
||||
|
||||
@@ -182,6 +182,8 @@ PSYS_SRC_PATTERN_ANGLE_CONE
|
||||
PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
|
||||
|
||||
OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type
|
||||
OBJECT_HOVER_HEIGHT This is a flag used with llGetObjectDetails to get hover height of the avatar. If no data is available, 0.0 is returned.
|
||||
OBJECT_LAST_OWNER_ID Gets the object's last owner ID.
|
||||
OBJECT_NAME Used with llGetObjectDetails to get an object's name
|
||||
OBJECT_DESC Used with llGetObjectDetails to get an object's description
|
||||
OBJECT_POS Used with llGetObjectDetails to get an object's position
|
||||
@@ -189,6 +191,7 @@ OBJECT_ROT Used with llGetObjectDetails to get an o
|
||||
OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity
|
||||
OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned
|
||||
OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key
|
||||
OBJECT_CLICK_ACTION This is a flag used with llGetObjectDetails to get the click action. The default is 0.
|
||||
OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key
|
||||
OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent
|
||||
OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent.
|
||||
@@ -199,6 +202,7 @@ OBJECT_SERVER_COST Used with llGetObjectDetails to get the
|
||||
OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost.
|
||||
OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost.
|
||||
OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings.
|
||||
OBJECT_BODY_SHAPE_TYPE This is a flag used with llGetObjectDetails to get the body type of the avatar, based on shape data. If no data is available, -1.0 is returned. This is normally between 0 and 1.0, with 0.5 and larger considered 'male'
|
||||
OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters.
|
||||
OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID.
|
||||
OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point.
|
||||
|
||||
@@ -107,6 +107,8 @@ class ViewerManifest(LLManifest):
|
||||
self.path("default/*.xml")
|
||||
self.path("dark.xml")
|
||||
self.path("dark/*.xml")
|
||||
self.path("Gemini.xml")
|
||||
self.path("gemini/*")
|
||||
# include the entire textures directory recursively
|
||||
if self.prefix(src="default/textures"):
|
||||
self.path("*.tga")
|
||||
@@ -971,12 +973,88 @@ class LinuxManifest(ViewerManifest):
|
||||
# plugins
|
||||
if self.prefix(src="", dst="bin/llplugin"):
|
||||
self.path2basename("../plugins/filepicker", "libbasic_plugin_filepicker.so")
|
||||
self.path2basename("../plugins/webkit", "libmedia_plugin_webkit.so")
|
||||
self.path("../plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
|
||||
self.path("../plugins/cef/libmedia_plugin_cef.so", "libmedia_plugin_webkitcef.so")
|
||||
self.end_prefix("bin/llplugin")
|
||||
|
||||
self.path("featuretable_linux.txt")
|
||||
# CEF files
|
||||
if self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="bin"):
|
||||
self.path("chrome-sandbox")
|
||||
self.path("llceflib_host")
|
||||
self.path("natives_blob.bin")
|
||||
self.path("snapshot_blob.bin")
|
||||
self.end_prefix()
|
||||
|
||||
if self.prefix(src=os.path.join(pkgdir, 'resources'), dst="bin"):
|
||||
self.path("cef.pak")
|
||||
self.path("cef_extensions.pak")
|
||||
self.path("cef_100_percent.pak")
|
||||
self.path("cef_200_percent.pak")
|
||||
self.path("devtools_resources.pak")
|
||||
self.path("icudtl.dat")
|
||||
self.end_prefix()
|
||||
|
||||
if self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst=os.path.join('bin', 'locales')):
|
||||
self.path("am.pak")
|
||||
self.path("ar.pak")
|
||||
self.path("bg.pak")
|
||||
self.path("bn.pak")
|
||||
self.path("ca.pak")
|
||||
self.path("cs.pak")
|
||||
self.path("da.pak")
|
||||
self.path("de.pak")
|
||||
self.path("el.pak")
|
||||
self.path("en-GB.pak")
|
||||
self.path("en-US.pak")
|
||||
self.path("es.pak")
|
||||
self.path("es-419.pak")
|
||||
self.path("et.pak")
|
||||
self.path("fa.pak")
|
||||
self.path("fi.pak")
|
||||
self.path("fil.pak")
|
||||
self.path("fr.pak")
|
||||
self.path("gu.pak")
|
||||
self.path("he.pak")
|
||||
self.path("hi.pak")
|
||||
self.path("hr.pak")
|
||||
self.path("hu.pak")
|
||||
self.path("id.pak")
|
||||
self.path("it.pak")
|
||||
self.path("ja.pak")
|
||||
self.path("kn.pak")
|
||||
self.path("ko.pak")
|
||||
self.path("lt.pak")
|
||||
self.path("lv.pak")
|
||||
self.path("ml.pak")
|
||||
self.path("mr.pak")
|
||||
self.path("ms.pak")
|
||||
self.path("nb.pak")
|
||||
self.path("nl.pak")
|
||||
self.path("pl.pak")
|
||||
self.path("pt-BR.pak")
|
||||
self.path("pt-PT.pak")
|
||||
self.path("ro.pak")
|
||||
self.path("ru.pak")
|
||||
self.path("sk.pak")
|
||||
self.path("sl.pak")
|
||||
self.path("sr.pak")
|
||||
self.path("sv.pak")
|
||||
self.path("sw.pak")
|
||||
self.path("ta.pak")
|
||||
self.path("te.pak")
|
||||
self.path("th.pak")
|
||||
self.path("tr.pak")
|
||||
self.path("uk.pak")
|
||||
self.path("vi.pak")
|
||||
self.path("zh-CN.pak")
|
||||
self.path("zh-TW.pak")
|
||||
self.end_prefix()
|
||||
|
||||
# llcommon
|
||||
if not self.path("../llcommon/libllcommon.so", "lib/libllcommon.so"):
|
||||
print "Skipping llcommon.so (assuming llcommon was linked statically)"
|
||||
|
||||
self.path("featuretable_linux.txt")
|
||||
|
||||
|
||||
def package_finish(self):
|
||||
@@ -1020,7 +1098,9 @@ class LinuxManifest(ViewerManifest):
|
||||
def strip_binaries(self):
|
||||
if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
|
||||
print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
|
||||
self.run_command(r"find %(d)r/bin %(d)r/lib %(d)r/lib32 %(d)r/lib64 -type f \! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
|
||||
# makes some small assumptions about our packaged dir structure
|
||||
self.run_command(r"find %(d)r/lib %(d)r/lib32 %(d)r/lib64 -type f \! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} )
|
||||
self.run_command(r"find %(d)r/bin -executable -type f \! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} )
|
||||
|
||||
|
||||
class Linux_i686_Manifest(LinuxManifest):
|
||||
@@ -1031,18 +1111,13 @@ class Linux_i686_Manifest(LinuxManifest):
|
||||
relpkgdir = os.path.join(pkgdir, "lib", "release")
|
||||
debpkgdir = os.path.join(pkgdir, "lib", "debug")
|
||||
|
||||
# llcommon
|
||||
if not self.path("../llcommon/libllcommon.so", "lib/libllcommon.so"):
|
||||
print "Skipping llcommon.so (assuming llcommon was linked statically)"
|
||||
|
||||
if (not self.standalone()) and self.prefix(src=relpkgdir, dst="lib"):
|
||||
self.path("libapr-1.so*")
|
||||
self.path("libaprutil-1.so*")
|
||||
|
||||
self.path("libexpat.so*")
|
||||
self.path("libcef.so")
|
||||
self.path("libexpat.so.*")
|
||||
self.path("libGLOD.so")
|
||||
self.path("libSDL-1.2.so*")
|
||||
# OpenAL
|
||||
self.path("libSDL-1.2.so.*")
|
||||
self.path("libalut.so")
|
||||
self.path("libopenal.so.1")
|
||||
|
||||
@@ -1067,10 +1142,6 @@ class Linux_x86_64_Manifest(LinuxManifest):
|
||||
def construct(self):
|
||||
super(Linux_x86_64_Manifest, self).construct()
|
||||
|
||||
# llcommon
|
||||
if not self.path("../llcommon/libllcommon.so", "lib64/libllcommon.so"):
|
||||
print "Skipping llcommon.so (assuming llcommon was linked statically)"
|
||||
|
||||
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
|
||||
relpkgdir = os.path.join(pkgdir, "lib", "release")
|
||||
debpkgdir = os.path.join(pkgdir, "lib", "debug")
|
||||
@@ -1114,6 +1185,11 @@ class Linux_x86_64_Manifest(LinuxManifest):
|
||||
self.path("libvivoxplatform.so")
|
||||
self.end_prefix("lib32")
|
||||
|
||||
# plugin runtime
|
||||
if self.prefix(src=relpkgdir, dst="lib64"):
|
||||
self.path("libcef.so")
|
||||
self.end_prefix("lib64")
|
||||
|
||||
|
||||
################################################################
|
||||
|
||||
|
||||
@@ -3,16 +3,17 @@
|
||||
add_subdirectory(base_basic)
|
||||
add_subdirectory(base_media)
|
||||
add_subdirectory(filepicker)
|
||||
if (NOT LINUX)
|
||||
add_subdirectory(cef)
|
||||
endif (NOT LINUX)
|
||||
|
||||
if (LINUX)
|
||||
add_subdirectory(gstreamer010)
|
||||
endif (LINUX)
|
||||
|
||||
add_subdirectory(cef)
|
||||
|
||||
if (WINDOWS OR DARWIN)
|
||||
add_subdirectory(quicktime)
|
||||
if(NOT WORD_SIZE EQUAL 64)
|
||||
add_subdirectory(quicktime)
|
||||
endif(NOT WORD_SIZE EQUAL 64)
|
||||
endif (WINDOWS OR DARWIN)
|
||||
|
||||
add_subdirectory(example_basic)
|
||||
|
||||
@@ -13,6 +13,7 @@ include(Linking)
|
||||
include(PluginAPI)
|
||||
include(MediaPluginBase)
|
||||
include(OpenGL)
|
||||
include(PulseAudio)
|
||||
|
||||
include(CEFPlugin)
|
||||
|
||||
@@ -28,6 +29,7 @@ include_directories(
|
||||
)
|
||||
include_directories(SYSTEM
|
||||
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
|
||||
${PULSEAUDIO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
|
||||
@@ -57,9 +59,14 @@ set (media_plugin_cef_LINK_LIBRARIES
|
||||
|
||||
# Select which VolumeCatcher implementation to use
|
||||
if (LINUX)
|
||||
message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n"
|
||||
" Please create a volume_catcher implementation for this platform.")
|
||||
|
||||
if (PULSEAUDIO_FOUND)
|
||||
list(APPEND media_plugin_cef_SOURCE_FILES linux_volume_catcher.cpp)
|
||||
else (PULSEAUDIO_FOUND)
|
||||
list(APPEND media_plugin_cef_SOURCE_FILES dummy_volume_catcher.cpp)
|
||||
endif (PULSEAUDIO_FOUND)
|
||||
list(APPEND media_plugin_webkit_LINK_LIBRARIES
|
||||
${UI_LIBRARIES} # for glib/GTK
|
||||
)
|
||||
elseif (DARWIN)
|
||||
list(APPEND media_plugin_cef_SOURCE_FILES mac_volume_catcher.cpp)
|
||||
find_library(CORESERVICES_LIBRARY CoreServices)
|
||||
@@ -112,4 +119,12 @@ if (DARWIN)
|
||||
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
|
||||
)
|
||||
|
||||
add_custom_command(TARGET media_plugin_cef
|
||||
POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework"
|
||||
"@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework"
|
||||
"$<TARGET_FILE:media_plugin_cef>"
|
||||
VERBATIM
|
||||
COMMENT "Fixing path to CEF Framework"
|
||||
)
|
||||
|
||||
endif (DARWIN)
|
||||
|
||||
58
indra/plugins/cef/dummy_volume_catcher.cpp
Normal file
58
indra/plugins/cef/dummy_volume_catcher.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* @file dummy_volume_catcher.cpp
|
||||
* @brief A null implementation of the "VolumeCatcher" class for platforms where it's not implemented yet.
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
#include "volume_catcher.h"
|
||||
|
||||
|
||||
class VolumeCatcherImpl
|
||||
{
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
VolumeCatcher::VolumeCatcher()
|
||||
{
|
||||
pimpl = NULL;
|
||||
}
|
||||
|
||||
VolumeCatcher::~VolumeCatcher()
|
||||
{
|
||||
}
|
||||
|
||||
void VolumeCatcher::setVolume(F32 volume)
|
||||
{
|
||||
}
|
||||
|
||||
void VolumeCatcher::setPan(F32 pan)
|
||||
{
|
||||
}
|
||||
|
||||
void VolumeCatcher::pump()
|
||||
{
|
||||
}
|
||||
|
||||
468
indra/plugins/cef/linux_volume_catcher.cpp
Normal file
468
indra/plugins/cef/linux_volume_catcher.cpp
Normal file
@@ -0,0 +1,468 @@
|
||||
/**
|
||||
* @file linux_volume_catcher.cpp
|
||||
* @brief A Linux-specific, PulseAudio-specific hack to detect and volume-adjust new audio sources
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
/*
|
||||
The high-level design is as follows:
|
||||
1) Connect to the PulseAudio daemon
|
||||
2) Watch for the creation of new audio players connecting to the daemon (this includes ALSA clients running on the PulseAudio emulation layer, such as Flash plugins)
|
||||
3) Examine any new audio player's PID to see if it belongs to our own process
|
||||
4) If so, tell PA to adjust the volume of that audio player ('sink input' in PA parlance)
|
||||
5) Keep a list of all living audio players that we care about, adjust the volumes of all of them when we get a new setVolume() call
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "volume_catcher.h"
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include <pulse/introspect.h>
|
||||
#include <pulse/context.h>
|
||||
#include <pulse/subscribe.h>
|
||||
#include <pulse/glib-mainloop.h> // There's no special reason why we want the *glib* PA mainloop, but the generic polling implementation seems broken.
|
||||
|
||||
#include "apr_pools.h"
|
||||
#include "apr_dso.h"
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
#define DEBUGMSG(...) do {} while(0)
|
||||
#define INFOMSG(...) do {} while(0)
|
||||
#define WARNMSG(...) do {} while(0)
|
||||
|
||||
#define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) RTN (*ll##PASYM)(__VA_ARGS__) = NULL
|
||||
#include "linux_volume_catcher_pa_syms.inc"
|
||||
#include "linux_volume_catcher_paglib_syms.inc"
|
||||
#undef LL_PA_SYM
|
||||
|
||||
static bool sSymsGrabbed = false;
|
||||
static apr_pool_t *sSymPADSOMemoryPool = NULL;
|
||||
static apr_dso_handle_t *sSymPADSOHandleG = NULL;
|
||||
|
||||
bool grab_pa_syms(std::string pulse_dso_name)
|
||||
{
|
||||
if (sSymsGrabbed)
|
||||
{
|
||||
// already have grabbed good syms
|
||||
return true;
|
||||
}
|
||||
|
||||
bool sym_error = false;
|
||||
bool rtn = false;
|
||||
apr_status_t rv;
|
||||
apr_dso_handle_t *sSymPADSOHandle = NULL;
|
||||
|
||||
#define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##PASYM, sSymPADSOHandle, #PASYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #PASYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #PASYM, (void*)ll##PASYM);}while(0)
|
||||
|
||||
//attempt to load the shared library
|
||||
apr_pool_create(&sSymPADSOMemoryPool, NULL);
|
||||
|
||||
if ( APR_SUCCESS == (rv = apr_dso_load(&sSymPADSOHandle,
|
||||
pulse_dso_name.c_str(),
|
||||
sSymPADSOMemoryPool) ))
|
||||
{
|
||||
INFOMSG("Found DSO: %s", pulse_dso_name.c_str());
|
||||
|
||||
#include "linux_volume_catcher_pa_syms.inc"
|
||||
#include "linux_volume_catcher_paglib_syms.inc"
|
||||
|
||||
if ( sSymPADSOHandle )
|
||||
{
|
||||
sSymPADSOHandleG = sSymPADSOHandle;
|
||||
sSymPADSOHandle = NULL;
|
||||
}
|
||||
|
||||
rtn = !sym_error;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFOMSG("Couldn't load DSO: %s", pulse_dso_name.c_str());
|
||||
rtn = false; // failure
|
||||
}
|
||||
|
||||
if (sym_error)
|
||||
{
|
||||
WARNMSG("Failed to find necessary symbols in PulseAudio libraries.");
|
||||
}
|
||||
#undef LL_PA_SYM
|
||||
|
||||
sSymsGrabbed = rtn;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
|
||||
void ungrab_pa_syms()
|
||||
{
|
||||
// should be safe to call regardless of whether we've
|
||||
// actually grabbed syms.
|
||||
|
||||
if ( sSymPADSOHandleG )
|
||||
{
|
||||
apr_dso_unload(sSymPADSOHandleG);
|
||||
sSymPADSOHandleG = NULL;
|
||||
}
|
||||
|
||||
if ( sSymPADSOMemoryPool )
|
||||
{
|
||||
apr_pool_destroy(sSymPADSOMemoryPool);
|
||||
sSymPADSOMemoryPool = NULL;
|
||||
}
|
||||
|
||||
// NULL-out all of the symbols we'd grabbed
|
||||
#define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) do{ll##PASYM = NULL;}while(0)
|
||||
#include "linux_volume_catcher_pa_syms.inc"
|
||||
#include "linux_volume_catcher_paglib_syms.inc"
|
||||
#undef LL_PA_SYM
|
||||
|
||||
sSymsGrabbed = false;
|
||||
}
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
// PulseAudio requires a chain of callbacks with C linkage
|
||||
extern "C" {
|
||||
void callback_discovered_sinkinput(pa_context *context, const pa_sink_input_info *i, int eol, void *userdata);
|
||||
void callback_subscription_alert(pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata);
|
||||
void callback_context_state(pa_context *context, void *userdata);
|
||||
}
|
||||
|
||||
|
||||
class VolumeCatcherImpl
|
||||
{
|
||||
public:
|
||||
VolumeCatcherImpl();
|
||||
~VolumeCatcherImpl();
|
||||
|
||||
void setVolume(F32 volume);
|
||||
void pump(void);
|
||||
|
||||
// for internal use - can't be private because used from our C callbacks
|
||||
|
||||
bool loadsyms(std::string pulse_dso_name);
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
void update_all_volumes(F32 volume);
|
||||
void update_index_volume(U32 index, F32 volume);
|
||||
void connected_okay();
|
||||
|
||||
std::set<U32> mSinkInputIndices;
|
||||
std::map<U32,U32> mSinkInputNumChannels;
|
||||
F32 mDesiredVolume;
|
||||
pa_glib_mainloop *mMainloop;
|
||||
pa_context *mPAContext;
|
||||
bool mConnected;
|
||||
bool mGotSyms;
|
||||
};
|
||||
|
||||
VolumeCatcherImpl::VolumeCatcherImpl()
|
||||
: mDesiredVolume(0.0f),
|
||||
mMainloop(NULL),
|
||||
mPAContext(NULL),
|
||||
mConnected(false),
|
||||
mGotSyms(false)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
VolumeCatcherImpl::~VolumeCatcherImpl()
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
bool VolumeCatcherImpl::loadsyms(std::string pulse_dso_name)
|
||||
{
|
||||
return grab_pa_syms(pulse_dso_name);
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::init()
|
||||
{
|
||||
// try to be as defensive as possible because PA's interface is a
|
||||
// bit fragile and (for our purposes) we'd rather simply not function
|
||||
// than crash
|
||||
|
||||
// we cheat and rely upon libpulse-mainloop-glib.so.0 to pull-in
|
||||
// libpulse.so.0 - this isn't a great assumption, and the two DSOs should
|
||||
// probably be loaded separately. Our Linux DSO framework needs refactoring,
|
||||
// we do this sort of thing a lot with practically identical logic...
|
||||
mGotSyms = loadsyms("libpulse-mainloop-glib.so.0");
|
||||
if (!mGotSyms) return;
|
||||
|
||||
// better make double-sure glib itself is initialized properly.
|
||||
if (!g_thread_supported ()) g_thread_init (NULL);
|
||||
g_type_init();
|
||||
|
||||
mMainloop = llpa_glib_mainloop_new(g_main_context_default());
|
||||
if (mMainloop)
|
||||
{
|
||||
pa_mainloop_api *api = llpa_glib_mainloop_get_api(mMainloop);
|
||||
if (api)
|
||||
{
|
||||
pa_proplist *proplist = llpa_proplist_new();
|
||||
if (proplist)
|
||||
{
|
||||
llpa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "multimedia-player");
|
||||
llpa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "com.secondlife.viewer.mediaplugvoladjust");
|
||||
llpa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, "SL Plugin Volume Adjuster");
|
||||
llpa_proplist_sets(proplist, PA_PROP_APPLICATION_VERSION, "1");
|
||||
|
||||
// plain old pa_context_new() is broken!
|
||||
mPAContext = llpa_context_new_with_proplist(api, NULL, proplist);
|
||||
llpa_proplist_free(proplist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now we've set up a PA context and mainloop, try connecting the
|
||||
// PA context to a PA daemon.
|
||||
if (mPAContext)
|
||||
{
|
||||
llpa_context_set_state_callback(mPAContext, callback_context_state, this);
|
||||
pa_context_flags_t cflags = (pa_context_flags)0; // maybe add PA_CONTEXT_NOAUTOSPAWN?
|
||||
if (llpa_context_connect(mPAContext, NULL, cflags, NULL) >= 0)
|
||||
{
|
||||
// Okay! We haven't definitely connected, but we
|
||||
// haven't definitely failed yet.
|
||||
}
|
||||
else
|
||||
{
|
||||
// Failed to connect to PA manager... we'll leave
|
||||
// things like that. Perhaps we should try again later.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::cleanup()
|
||||
{
|
||||
mConnected = false;
|
||||
|
||||
if (mGotSyms && mPAContext)
|
||||
{
|
||||
llpa_context_disconnect(mPAContext);
|
||||
llpa_context_unref(mPAContext);
|
||||
}
|
||||
mPAContext = NULL;
|
||||
|
||||
if (mGotSyms && mMainloop)
|
||||
{
|
||||
llpa_glib_mainloop_free(mMainloop);
|
||||
}
|
||||
mMainloop = NULL;
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::setVolume(F32 volume)
|
||||
{
|
||||
mDesiredVolume = volume;
|
||||
|
||||
if (!mGotSyms) return;
|
||||
|
||||
if (mConnected && mPAContext)
|
||||
{
|
||||
update_all_volumes(mDesiredVolume);
|
||||
}
|
||||
|
||||
pump();
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::pump()
|
||||
{
|
||||
gboolean may_block = FALSE;
|
||||
g_main_context_iteration(g_main_context_default(), may_block);
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::connected_okay()
|
||||
{
|
||||
pa_operation *op;
|
||||
|
||||
// fetch global list of existing sinkinputs
|
||||
if ((op = llpa_context_get_sink_input_info_list(mPAContext,
|
||||
callback_discovered_sinkinput,
|
||||
this)))
|
||||
{
|
||||
llpa_operation_unref(op);
|
||||
}
|
||||
|
||||
// subscribe to future global sinkinput changes
|
||||
llpa_context_set_subscribe_callback(mPAContext,
|
||||
callback_subscription_alert,
|
||||
this);
|
||||
if ((op = llpa_context_subscribe(mPAContext, (pa_subscription_mask_t)
|
||||
(PA_SUBSCRIPTION_MASK_SINK_INPUT),
|
||||
NULL, NULL)))
|
||||
{
|
||||
llpa_operation_unref(op);
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::update_all_volumes(F32 volume)
|
||||
{
|
||||
for (std::set<U32>::iterator it = mSinkInputIndices.begin();
|
||||
it != mSinkInputIndices.end(); ++it)
|
||||
{
|
||||
update_index_volume(*it, volume);
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeCatcherImpl::update_index_volume(U32 index, F32 volume)
|
||||
{
|
||||
static pa_cvolume cvol;
|
||||
llpa_cvolume_set(&cvol, mSinkInputNumChannels[index],
|
||||
llpa_sw_volume_from_linear(volume));
|
||||
|
||||
pa_context *c = mPAContext;
|
||||
uint32_t idx = index;
|
||||
const pa_cvolume *cvolumep = &cvol;
|
||||
pa_context_success_cb_t cb = NULL; // okay as null
|
||||
void *userdata = NULL; // okay as null
|
||||
|
||||
pa_operation *op;
|
||||
if ((op = llpa_context_set_sink_input_volume(c, idx, cvolumep, cb, userdata)))
|
||||
{
|
||||
llpa_operation_unref(op);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void callback_discovered_sinkinput(pa_context *context, const pa_sink_input_info *sii, int eol, void *userdata)
|
||||
{
|
||||
VolumeCatcherImpl *impl = dynamic_cast<VolumeCatcherImpl*>((VolumeCatcherImpl*)userdata);
|
||||
llassert(impl);
|
||||
|
||||
if (0 == eol)
|
||||
{
|
||||
pa_proplist *proplist = sii->proplist;
|
||||
pid_t sinkpid = atoll(llpa_proplist_gets(proplist, PA_PROP_APPLICATION_PROCESS_ID));
|
||||
|
||||
if (sinkpid == getpid()) // does the discovered sinkinput belong to this process?
|
||||
{
|
||||
bool is_new = (impl->mSinkInputIndices.find(sii->index) ==
|
||||
impl->mSinkInputIndices.end());
|
||||
|
||||
impl->mSinkInputIndices.insert(sii->index);
|
||||
impl->mSinkInputNumChannels[sii->index] = sii->channel_map.channels;
|
||||
|
||||
if (is_new)
|
||||
{
|
||||
// new!
|
||||
impl->update_index_volume(sii->index, impl->mDesiredVolume);
|
||||
}
|
||||
else
|
||||
{
|
||||
// seen it already, do nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void callback_subscription_alert(pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata)
|
||||
{
|
||||
VolumeCatcherImpl *impl = dynamic_cast<VolumeCatcherImpl*>((VolumeCatcherImpl*)userdata);
|
||||
llassert(impl);
|
||||
|
||||
switch (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) {
|
||||
case PA_SUBSCRIPTION_EVENT_SINK_INPUT:
|
||||
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) ==
|
||||
PA_SUBSCRIPTION_EVENT_REMOVE)
|
||||
{
|
||||
// forget this sinkinput, if we were caring about it
|
||||
impl->mSinkInputIndices.erase(index);
|
||||
impl->mSinkInputNumChannels.erase(index);
|
||||
}
|
||||
else if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) ==
|
||||
PA_SUBSCRIPTION_EVENT_NEW)
|
||||
{
|
||||
// ask for more info about this new sinkinput
|
||||
pa_operation *op;
|
||||
if ((op = llpa_context_get_sink_input_info(impl->mPAContext, index, callback_discovered_sinkinput, impl)))
|
||||
{
|
||||
llpa_operation_unref(op);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// property change on this sinkinput - we don't care.
|
||||
}
|
||||
break;
|
||||
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
void callback_context_state(pa_context *context, void *userdata)
|
||||
{
|
||||
VolumeCatcherImpl *impl = dynamic_cast<VolumeCatcherImpl*>((VolumeCatcherImpl*)userdata);
|
||||
llassert(impl);
|
||||
|
||||
switch (llpa_context_get_state(context))
|
||||
{
|
||||
case PA_CONTEXT_READY:
|
||||
impl->mConnected = true;
|
||||
impl->connected_okay();
|
||||
break;
|
||||
case PA_CONTEXT_TERMINATED:
|
||||
impl->mConnected = false;
|
||||
break;
|
||||
case PA_CONTEXT_FAILED:
|
||||
impl->mConnected = false;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
VolumeCatcher::VolumeCatcher()
|
||||
{
|
||||
pimpl = new VolumeCatcherImpl();
|
||||
}
|
||||
|
||||
VolumeCatcher::~VolumeCatcher()
|
||||
{
|
||||
delete pimpl;
|
||||
pimpl = NULL;
|
||||
}
|
||||
|
||||
void VolumeCatcher::setVolume(F32 volume)
|
||||
{
|
||||
llassert(pimpl);
|
||||
pimpl->setVolume(volume);
|
||||
}
|
||||
|
||||
void VolumeCatcher::setPan(F32 pan)
|
||||
{
|
||||
// TODO: implement this (if possible)
|
||||
}
|
||||
|
||||
void VolumeCatcher::pump()
|
||||
{
|
||||
llassert(pimpl);
|
||||
pimpl->pump();
|
||||
}
|
||||
21
indra/plugins/cef/linux_volume_catcher_pa_syms.inc
Normal file
21
indra/plugins/cef/linux_volume_catcher_pa_syms.inc
Normal file
@@ -0,0 +1,21 @@
|
||||
// required symbols to grab
|
||||
LL_PA_SYM(true, pa_context_connect, int, pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
|
||||
LL_PA_SYM(true, pa_context_disconnect, void, pa_context *c);
|
||||
LL_PA_SYM(true, pa_context_get_sink_input_info, pa_operation*, pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata);
|
||||
LL_PA_SYM(true, pa_context_get_sink_input_info_list, pa_operation*, pa_context *c, pa_sink_input_info_cb_t cb, void *userdata);
|
||||
LL_PA_SYM(true, pa_context_get_state, pa_context_state_t, pa_context *c);
|
||||
LL_PA_SYM(true, pa_context_new_with_proplist, pa_context*, pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist);
|
||||
LL_PA_SYM(true, pa_context_set_sink_input_volume, pa_operation*, pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata);
|
||||
LL_PA_SYM(true, pa_context_set_state_callback, void, pa_context *c, pa_context_notify_cb_t cb, void *userdata);
|
||||
LL_PA_SYM(true, pa_context_set_subscribe_callback, void, pa_context *c, pa_context_subscribe_cb_t cb, void *userdata);
|
||||
LL_PA_SYM(true, pa_context_subscribe, pa_operation*, pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata);
|
||||
LL_PA_SYM(true, pa_context_unref, void, pa_context *c);
|
||||
LL_PA_SYM(true, pa_cvolume_set, pa_cvolume*, pa_cvolume *a, unsigned channels, pa_volume_t v);
|
||||
LL_PA_SYM(true, pa_operation_unref, void, pa_operation *o);
|
||||
LL_PA_SYM(true, pa_proplist_free, void, pa_proplist* p);
|
||||
LL_PA_SYM(true, pa_proplist_gets, const char*, pa_proplist *p, const char *key);
|
||||
LL_PA_SYM(true, pa_proplist_new, pa_proplist*, void);
|
||||
LL_PA_SYM(true, pa_proplist_sets, int, pa_proplist *p, const char *key, const char *value);
|
||||
LL_PA_SYM(true, pa_sw_volume_from_linear, pa_volume_t, double v);
|
||||
|
||||
// optional symbols to grab
|
||||
6
indra/plugins/cef/linux_volume_catcher_paglib_syms.inc
Normal file
6
indra/plugins/cef/linux_volume_catcher_paglib_syms.inc
Normal file
@@ -0,0 +1,6 @@
|
||||
// required symbols to grab
|
||||
LL_PA_SYM(true, pa_glib_mainloop_free, void, pa_glib_mainloop* g);
|
||||
LL_PA_SYM(true, pa_glib_mainloop_get_api, pa_mainloop_api*, pa_glib_mainloop* g);
|
||||
LL_PA_SYM(true, pa_glib_mainloop_new, pa_glib_mainloop *, GMainContext *c);
|
||||
|
||||
// optional symbols to grab
|
||||
@@ -180,7 +180,7 @@ void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int x, int y,
|
||||
{
|
||||
memcpy(mPixels, pixels, mWidth * mHeight * mDepth);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
setDirty(0, 0, mWidth, mHeight);
|
||||
}
|
||||
@@ -252,7 +252,7 @@ void MediaPluginCEF::onAddressChangeCallback(std::string url)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed");
|
||||
message.setValue("uri", url);
|
||||
sendMessage(message);
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -465,6 +465,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
|
||||
settings.initial_width = 1024;
|
||||
settings.initial_height = 1024;
|
||||
settings.plugins_enabled = mPluginsEnabled;
|
||||
settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granualrity/query UI
|
||||
settings.javascript_enabled = mJavascriptEnabled;
|
||||
settings.cookies_enabled = mCookiesEnabled;
|
||||
settings.cookie_store_path = mCookiePath;
|
||||
@@ -643,11 +644,11 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
|
||||
{
|
||||
key_event = LLCEFLib::KE_KEY_REPEAT;
|
||||
}
|
||||
|
||||
|
||||
keyEvent(key_event, key, LLCEFLib::KM_MODIFIER_NONE, native_key_data);
|
||||
|
||||
|
||||
#endif
|
||||
#elif LL_WINDOWS
|
||||
#else
|
||||
std::string event = message_in.getValue("event");
|
||||
S32 key = message_in.getValueS32("key");
|
||||
std::string modifiers = message_in.getValue("modifiers");
|
||||
@@ -784,6 +785,13 @@ void MediaPluginCEF::deserializeKeyboardData(LLSD native_key_data, uint32_t& nat
|
||||
native_scan_code = (uint32_t)(native_key_data["scan_code"].asInteger());
|
||||
native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger());
|
||||
// TODO: I don't think we need to do anything with native modifiers here -- please verify
|
||||
#elif LL_LINUX
|
||||
native_scan_code = (uint32_t)(native_key_data["sdl_sym"].asInteger());
|
||||
native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger());
|
||||
native_modifiers = (uint32_t)(native_key_data["cef_modifiers"].asInteger());
|
||||
|
||||
if( native_scan_code == '\n' )
|
||||
native_scan_code = '\r';
|
||||
#endif
|
||||
};
|
||||
};
|
||||
@@ -808,18 +816,25 @@ void MediaPluginCEF::keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib::
|
||||
char eventChars = static_cast<char>(native_key_data["event_chars"].isUndefined() ? 0 : native_key_data["event_chars"].asInteger());
|
||||
char eventUChars = static_cast<char>(native_key_data["event_umodchars"].isUndefined() ? 0 : native_key_data["event_umodchars"].asInteger());
|
||||
bool eventIsRepeat = native_key_data["event_isrepeat"].asBoolean();
|
||||
|
||||
|
||||
mLLCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL,
|
||||
(eventUChars) ? &eventUChars : NULL, eventIsRepeat, eventKeycode);
|
||||
|
||||
|
||||
#elif LL_WINDOWS
|
||||
U32 msg = ll_U32_from_sd(native_key_data["msg"]);
|
||||
U32 wparam = ll_U32_from_sd(native_key_data["w_param"]);
|
||||
U64 lparam = ll_U32_from_sd(native_key_data["l_param"]);
|
||||
|
||||
|
||||
mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam);
|
||||
#elif LL_LINUX
|
||||
uint32_t native_scan_code = 0;
|
||||
uint32_t native_virtual_key = 0;
|
||||
uint32_t native_modifiers = 0;
|
||||
deserializeKeyboardData(native_key_data, native_scan_code, native_virtual_key, native_modifiers);
|
||||
|
||||
mLLCEFLib->nativeKeyboardEvent(key_event, native_scan_code, native_virtual_key, native_modifiers);
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap())
|
||||
{
|
||||
@@ -833,14 +848,22 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboar
|
||||
uint32_t unmodifiedChar = native_key_data["event_umodchars"].asInteger();
|
||||
uint32_t keyCode = native_key_data["event_keycode"].asInteger();
|
||||
uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger();
|
||||
|
||||
|
||||
mLLCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers);
|
||||
|
||||
|
||||
#elif LL_WINDOWS
|
||||
U32 msg = ll_U32_from_sd(native_key_data["msg"]);
|
||||
U32 wparam = ll_U32_from_sd(native_key_data["w_param"]);
|
||||
U64 lparam = ll_U32_from_sd(native_key_data["l_param"]);
|
||||
mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam);
|
||||
#elif LL_LINUX
|
||||
uint32_t native_scan_code = 0;
|
||||
uint32_t native_virtual_key = 0;
|
||||
uint32_t native_modifiers = 0;
|
||||
deserializeKeyboardData(native_key_data, native_scan_code, native_virtual_key, native_modifiers);
|
||||
|
||||
mLLCEFLib->nativeKeyboardEvent(LLCEFLib::KE_KEY_DOWN, native_scan_code, native_virtual_key, native_modifiers);
|
||||
mLLCEFLib->nativeKeyboardEvent(LLCEFLib::KE_KEY_UP, native_scan_code, native_virtual_key, native_modifiers);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -896,8 +919,10 @@ bool MediaPluginCEF::init()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
int create_plugin(LLPluginInstance::sendMessageFunction send_message_function, LLPluginInstance* plugin_instance, BasicPluginBase** plugin_object)
|
||||
{
|
||||
*plugin_object = new MediaPluginCEF(send_message_function, plugin_instance);
|
||||
return 0;
|
||||
int create_plugin(LLPluginInstance::sendMessageFunction send_message_function,
|
||||
LLPluginInstance* plugin_instance,
|
||||
BasicPluginBase** plugin_object)
|
||||
{
|
||||
*plugin_object = new MediaPluginCEF(send_message_function, plugin_instance);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user