Merge remote-tracking branch 'singu/master'
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -26,3 +26,6 @@ qtcreator-build/
|
||||
/.pc
|
||||
/build-*
|
||||
/viewer-*
|
||||
/indra/newview/res/viewerRes.rc
|
||||
/indra/newview/res/viewerRes_bc.rc
|
||||
/indra/newview/English.lproj/InfoPlist.strings
|
||||
|
||||
@@ -33,6 +33,25 @@ configure_file(
|
||||
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h
|
||||
)
|
||||
|
||||
if (WINDOWS)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc.in
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
if (DARWIN)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in
|
||||
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings
|
||||
)
|
||||
endif (DARWIN)
|
||||
|
||||
# Compose the version.
|
||||
set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
||||
if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||
|
||||
@@ -81,6 +81,7 @@ set(cmake_SOURCE_FILES
|
||||
Linking.cmake
|
||||
MediaPluginBase.cmake
|
||||
NDOF.cmake
|
||||
NVAPI.cmake
|
||||
OPENAL.cmake
|
||||
OpenGL.cmake
|
||||
OpenJPEG.cmake
|
||||
|
||||
21
indra/cmake/NVAPI.cmake
Normal file
21
indra/cmake/NVAPI.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(Variables)
|
||||
|
||||
set(NVAPI ON CACHE BOOL "Use NVAPI.")
|
||||
|
||||
if (NVAPI)
|
||||
if (WINDOWS)
|
||||
use_prebuilt_binary(nvapi)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(NVAPI_LIBRARY nvapi)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set(NVAPI_LIBRARY nvapi64)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
else (WINDOWS)
|
||||
set(NVAPI_LIBRARY "")
|
||||
endif (WINDOWS)
|
||||
else (NVAPI)
|
||||
set(NVAPI_LIBRARY "")
|
||||
endif (NVAPI)
|
||||
|
||||
@@ -140,12 +140,13 @@ endif(WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
set(GRID agni CACHE STRING "Target Grid")
|
||||
|
||||
set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name")
|
||||
set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing")
|
||||
set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing")
|
||||
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)")
|
||||
|
||||
# *TODO: break out proper Branding-secondlife.cmake, Branding-snowglobe.cmake, etc
|
||||
set(VIEWER_BRANDING_NAME "Singularity")
|
||||
set(VIEWER_BRANDING_NAME_CAMELCASE "Singularity")
|
||||
string(REGEX REPLACE " +" "" VIEWER_CHANNEL_ONE_WORD "${VIEWER_CHANNEL}")
|
||||
set(VIEWER_BRANDING_NAME "${VIEWER_CHANNEL_ONE_WORD}")
|
||||
set(VIEWER_BRANDING_NAME_CAMELCASE "${VIEWER_CHANNEL_ONE_WORD}")
|
||||
|
||||
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
|
||||
|
||||
|
||||
@@ -39,6 +39,13 @@ LLListener_OpenAL::~LLListener_OpenAL()
|
||||
{
|
||||
}
|
||||
|
||||
void LLListener_OpenAL::init()
|
||||
{
|
||||
// do inherited
|
||||
LLListener::init();
|
||||
mRolloffFactor = 1.0f;
|
||||
}
|
||||
|
||||
void LLListener_OpenAL::translate(LLVector3 offset)
|
||||
{
|
||||
//llinfos << "LLListener_OpenAL::translate() : " << offset << llendl;
|
||||
|
||||
@@ -38,6 +38,7 @@ class LLListener_OpenAL : public LLListener
|
||||
public:
|
||||
LLListener_OpenAL();
|
||||
virtual ~LLListener_OpenAL();
|
||||
virtual void init();
|
||||
|
||||
virtual void translate(LLVector3 offset);
|
||||
virtual void setPosition(LLVector3 pos);
|
||||
|
||||
@@ -2,37 +2,32 @@
|
||||
* @file llfontfreetype.cpp
|
||||
* @brief Freetype font library wrapper
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&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 "llfontfreetype.h"
|
||||
#include "llfontgl.h"
|
||||
|
||||
// Freetype stuff
|
||||
#include <ft2build.h>
|
||||
@@ -103,36 +98,18 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index)
|
||||
mYBitmapOffset(0), // Offset to the origin in the bitmap
|
||||
mXBearing(0), // Distance from baseline to left in pixels
|
||||
mYBearing(0), // Distance from baseline to top in pixels
|
||||
mBitmapNum(0), // Which bitmap in the bitmap cache contains this glyph
|
||||
mIsRendered(FALSE),
|
||||
mMetricsValid(FALSE)
|
||||
{}
|
||||
|
||||
LLFontList::LLFontList()
|
||||
{
|
||||
}
|
||||
|
||||
LLFontList::~LLFontList()
|
||||
{
|
||||
LLFontList::iterator iter;
|
||||
for(iter = this->begin(); iter != this->end(); iter++)
|
||||
{
|
||||
delete *iter;
|
||||
// The (now dangling) pointers in the vector will be cleaned up when the vector is deleted by the superclass destructor.
|
||||
}
|
||||
}
|
||||
void LLFontList::addAtEnd(LLFontFreetype *font)
|
||||
{
|
||||
// Purely a convenience function
|
||||
this->push_back(font);
|
||||
}
|
||||
|
||||
LLFontFreetype::LLFontFreetype()
|
||||
: mFontBitmapCachep(new LLFontBitmapCache),
|
||||
mValid(FALSE),
|
||||
mAscender(0.f),
|
||||
mDescender(0.f),
|
||||
mLineHeight(0.f),
|
||||
mFallbackFontp(NULL),
|
||||
mIsFallback(FALSE),
|
||||
mFTFace(NULL),
|
||||
mRenderGlyphCount(0),
|
||||
@@ -222,8 +199,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size,
|
||||
|
||||
if (!mIsFallback || !sOpenGLcrashOnRestart) // because this often crashes under Linux...
|
||||
{
|
||||
// Add the empty glyph`5
|
||||
addGlyph(0, 0);
|
||||
// Add the default glyph
|
||||
addGlyphFromFont(this, 0, 0);
|
||||
}
|
||||
|
||||
mName = filename;
|
||||
@@ -232,19 +209,26 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLFontFreetype::setFallbackFonts(const font_vector_t &font)
|
||||
{
|
||||
mFallbackFonts = font;
|
||||
}
|
||||
|
||||
const LLFontFreetype::font_vector_t &LLFontFreetype::getFallbackFonts() const
|
||||
{
|
||||
return mFallbackFonts;
|
||||
}
|
||||
|
||||
F32 LLFontFreetype::getLineHeight() const
|
||||
{
|
||||
return mLineHeight;
|
||||
}
|
||||
|
||||
//virtual
|
||||
F32 LLFontFreetype::getAscenderHeight() const
|
||||
{
|
||||
return mAscender;
|
||||
}
|
||||
|
||||
//virtual
|
||||
F32 LLFontFreetype::getDescenderHeight() const
|
||||
{
|
||||
return mDescender;
|
||||
@@ -256,7 +240,7 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const
|
||||
return 0.0;
|
||||
|
||||
llassert(!mIsFallback);
|
||||
U32 glyph_index;
|
||||
//U32 glyph_index;
|
||||
|
||||
// Return existing info only if it is current
|
||||
LLFontGlyphInfo* gi = getGlyphInfo(wch);
|
||||
@@ -264,18 +248,26 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const
|
||||
{
|
||||
return gi->mXAdvance;
|
||||
}
|
||||
|
||||
const LLFontFreetype* fontp = this;
|
||||
//new
|
||||
else
|
||||
{
|
||||
char_glyph_info_map_t::iterator found_it = mCharGlyphInfoMap.find((llwchar)0);
|
||||
if (found_it != mCharGlyphInfoMap.end())
|
||||
{
|
||||
return found_it->second->mXAdvance;
|
||||
}
|
||||
}
|
||||
/*const LLFontFreetype* fontp = this;
|
||||
|
||||
// Initialize char to glyph map
|
||||
glyph_index = FT_Get_Char_Index(mFTFace, wch);
|
||||
if (glyph_index == 0 && mFallbackFontp)
|
||||
if (glyph_index == 0)
|
||||
{
|
||||
LLFontList::iterator iter;
|
||||
for(iter = mFallbackFontp->begin(); (iter != mFallbackFontp->end()) && (glyph_index == 0); iter++)
|
||||
font_vector_t::const_iterator iter;
|
||||
for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++)
|
||||
{
|
||||
glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch);
|
||||
if(glyph_index)
|
||||
if (glyph_index)
|
||||
{
|
||||
fontp = *iter;
|
||||
}
|
||||
@@ -306,6 +298,7 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const
|
||||
gi->mXAdvance = fontp->mFTFace->glyph->advance.x / 64.f;
|
||||
gi->mYAdvance = fontp->mFTFace->glyph->advance.y / 64.f;
|
||||
gi->mMetricsValid = TRUE;
|
||||
//gi->mIsRendered = TRUE;
|
||||
return gi->mXAdvance;
|
||||
}
|
||||
else
|
||||
@@ -315,7 +308,7 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const
|
||||
{
|
||||
return gi->mXAdvance;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Last ditch fallback - no glyphs defined at all.
|
||||
return (F32)mFontBitmapCachep->getMaxCharWidth();
|
||||
@@ -343,7 +336,8 @@ F32 LLFontFreetype::getXKerning(const llwchar char_left, const llwchar char_righ
|
||||
BOOL LLFontFreetype::hasGlyph(const llwchar wch) const
|
||||
{
|
||||
llassert(!mIsFallback);
|
||||
const LLFontGlyphInfo* gi = getGlyphInfo(wch);
|
||||
return(mCharGlyphInfoMap.find(wch) != mCharGlyphInfoMap.end());
|
||||
/*const LLFontGlyphInfo* gi = getGlyphInfo(wch);
|
||||
if (gi && gi->mIsRendered)
|
||||
{
|
||||
return TRUE;
|
||||
@@ -351,10 +345,10 @@ BOOL LLFontFreetype::hasGlyph(const llwchar wch) const
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
BOOL LLFontFreetype::addChar(const llwchar wch) const
|
||||
BOOL LLFontFreetype::addGlyph(const llwchar wch) const
|
||||
{
|
||||
if (mFTFace == NULL)
|
||||
return FALSE;
|
||||
@@ -368,19 +362,15 @@ BOOL LLFontFreetype::addChar(const llwchar wch) const
|
||||
glyph_index = FT_Get_Char_Index(mFTFace, wch);
|
||||
if (glyph_index == 0)
|
||||
{
|
||||
// Try looking it up in the backup Unicode font
|
||||
if (mFallbackFontp)
|
||||
//llinfos << "Trying to add glyph from fallback font!" << llendl;
|
||||
font_vector_t::const_iterator iter;
|
||||
for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++)
|
||||
{
|
||||
//llinfos << "Trying to add glyph from fallback font!" << llendl;
|
||||
LLFontList::iterator iter;
|
||||
for(iter = mFallbackFontp->begin(); iter != mFallbackFontp->end(); iter++)
|
||||
glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch);
|
||||
if (glyph_index)
|
||||
{
|
||||
glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch);
|
||||
if (glyph_index)
|
||||
{
|
||||
addGlyphFromFont(*iter, wch, glyph_index);
|
||||
return TRUE;
|
||||
}
|
||||
addGlyphFromFont(*iter, wch, glyph_index);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,8 +378,7 @@ BOOL LLFontFreetype::addChar(const llwchar wch) const
|
||||
char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.find(wch);
|
||||
if (iter == mCharGlyphInfoMap.end() || !(iter->second->mIsRendered))
|
||||
{
|
||||
BOOL result = addGlyph(wch, glyph_index);
|
||||
return result;
|
||||
return addGlyphFromFont(this, wch, glyph_index);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -492,6 +481,11 @@ BOOL LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, const llwchar
|
||||
// omit it from the font-image.
|
||||
}
|
||||
|
||||
//new
|
||||
LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num);
|
||||
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
|
||||
image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -502,6 +496,15 @@ LLFontGlyphInfo* LLFontFreetype::getGlyphInfo(const llwchar wch) const
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
else if(addGlyph(wch))//new
|
||||
{
|
||||
// this glyph doesn't yet exist, so render it and return the result
|
||||
char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.find(wch);
|
||||
if (iter != mCharGlyphInfoMap.end())
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -519,11 +522,6 @@ void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLFontFreetype::addGlyph(const llwchar wch, const U32 glyph_index) const
|
||||
{
|
||||
return addGlyphFromFont(this, wch, glyph_index);
|
||||
}
|
||||
|
||||
void LLFontFreetype::renderGlyph(const U32 glyph_index) const
|
||||
{
|
||||
if (mFTFace == NULL)
|
||||
@@ -536,34 +534,74 @@ void LLFontFreetype::renderGlyph(const U32 glyph_index) const
|
||||
mRenderGlyphCount++;
|
||||
}
|
||||
|
||||
void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi)
|
||||
{
|
||||
//new
|
||||
resetBitmapCache();
|
||||
loadFace(mName,mPointSize,vert_dpi,horz_dpi,mFontBitmapCachep->getNumComponents(),mIsFallback);
|
||||
if (!mIsFallback)
|
||||
{
|
||||
// This is the head of the list - need to rebuild ourself and all fallbacks.
|
||||
//loadFace(mName,mPointSize,vert_dpi,horz_dpi,mFontBitmapCachep->getNumComponents(),mIsFallback);
|
||||
if (mFallbackFonts.empty())
|
||||
{
|
||||
llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(font_vector_t::iterator it = mFallbackFonts.begin();
|
||||
it != mFallbackFonts.end();
|
||||
++it)
|
||||
{
|
||||
(*it)->reset(vert_dpi, horz_dpi);
|
||||
}
|
||||
}
|
||||
}
|
||||
//resetBitmapCache();
|
||||
}
|
||||
|
||||
void LLFontFreetype::resetBitmapCache()
|
||||
{
|
||||
// Iterate through glyphs and clear the mIsRendered flag
|
||||
for (char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.begin();
|
||||
/*for (char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.begin();
|
||||
iter != mCharGlyphInfoMap.end(); ++iter)
|
||||
{
|
||||
iter->second->mIsRendered = FALSE;
|
||||
//FIXME: this is only strictly necessary when resetting the entire font,
|
||||
//not just flushing the bitmap
|
||||
iter->second->mMetricsValid = FALSE;
|
||||
}
|
||||
}*/
|
||||
//new
|
||||
for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer());
|
||||
mCharGlyphInfoMap.clear();
|
||||
|
||||
mFontBitmapCachep->reset();
|
||||
|
||||
// Adding default glyph is skipped for fallback fonts here as well as in loadFace().
|
||||
// This if was added as fix for EXT-4971.
|
||||
if (!mIsFallback || !sOpenGLcrashOnRestart) // because this often crashes under Linux...
|
||||
{
|
||||
// Add the empty glyph`5
|
||||
addGlyph(0, 0);
|
||||
// Add the empty glyph
|
||||
addGlyphFromFont(this, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFontFreetype::destroyGL()
|
||||
{
|
||||
mFontBitmapCachep->destroyGL();
|
||||
}
|
||||
|
||||
void LLFontFreetype::setSubImageLuminanceAlpha(const U32 x,
|
||||
const U32 y,
|
||||
const U32 bitmap_num,
|
||||
const U32 width,
|
||||
const U32 height,
|
||||
const U8 *data,
|
||||
S32 stride) const
|
||||
const std::string &LLFontFreetype::getName() const
|
||||
{
|
||||
return mName;
|
||||
}
|
||||
|
||||
const LLPointer<LLFontBitmapCache> LLFontFreetype::getFontBitmapCache() const
|
||||
{
|
||||
return mFontBitmapCachep;
|
||||
}
|
||||
|
||||
void LLFontFreetype::setSubImageLuminanceAlpha(const U32 x, const U32 y, const U32 bitmap_num, const U32 width, const U32 height, const U8 *data, S32 stride) const
|
||||
{
|
||||
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
|
||||
|
||||
|
||||
@@ -1,32 +1,26 @@
|
||||
/**
|
||||
* @file llfont.h
|
||||
* @file llfontfreetype.h
|
||||
* @brief Font library wrapper
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&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$
|
||||
*/
|
||||
|
||||
@@ -34,7 +28,7 @@
|
||||
#define LL_LLFONTFREETYPE_H
|
||||
|
||||
#include <map>
|
||||
#include "llmemory.h"
|
||||
#include "llpointer.h"
|
||||
#include "llstl.h"
|
||||
|
||||
#include "llimagegl.h"
|
||||
@@ -51,25 +45,23 @@ class LLFontFreetype;
|
||||
struct FT_FaceRec_;
|
||||
typedef struct FT_FaceRec_* LLFT_Face;
|
||||
|
||||
extern LLFontManager *gFontManagerp;
|
||||
|
||||
class LLFontManager
|
||||
{
|
||||
public:
|
||||
static void initClass();
|
||||
static void cleanupClass();
|
||||
|
||||
public:
|
||||
private:
|
||||
LLFontManager();
|
||||
virtual ~LLFontManager();
|
||||
~LLFontManager();
|
||||
};
|
||||
|
||||
class LLFontGlyphInfo
|
||||
struct LLFontGlyphInfo
|
||||
{
|
||||
public:
|
||||
LLFontGlyphInfo(U32 index);
|
||||
public:
|
||||
|
||||
U32 mGlyphIndex;
|
||||
|
||||
// Metrics
|
||||
S32 mWidth; // In pixels
|
||||
S32 mHeight; // In pixels
|
||||
@@ -86,37 +78,29 @@ public:
|
||||
S32 mBitmapNum; // Which bitmap in the bitmap cache contains this glyph
|
||||
};
|
||||
|
||||
// Used for lists of fallback fonts
|
||||
class LLFontList : public std::vector<LLFontFreetype*>
|
||||
{
|
||||
public:
|
||||
LLFontList();
|
||||
~LLFontList();
|
||||
void addAtEnd(LLFontFreetype *font);
|
||||
};
|
||||
extern LLFontManager *gFontManagerp;
|
||||
|
||||
class LLFontFreetype
|
||||
class LLFontFreetype : public LLRefCount
|
||||
{
|
||||
public:
|
||||
LLFontFreetype();
|
||||
virtual ~LLFontFreetype();
|
||||
~LLFontFreetype();
|
||||
|
||||
// is_fallback should be true for fallback fonts that aren't used
|
||||
// to render directly (Unicode backup, primarily)
|
||||
virtual BOOL loadFace(const std::string& filename,
|
||||
const F32 point_size,
|
||||
const F32 vert_dpi,
|
||||
const F32 horz_dpi,
|
||||
const S32 components,
|
||||
BOOL is_fallback);
|
||||
void setFallbackFont(LLFontList *fontp) { mFallbackFontp = fontp; }
|
||||
BOOL loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback);
|
||||
|
||||
typedef std::vector<LLPointer<LLFontFreetype> > font_vector_t;
|
||||
|
||||
void setFallbackFonts(const font_vector_t &font);
|
||||
const font_vector_t &getFallbackFonts() const;
|
||||
|
||||
void setCharToGlyphMap(llwchar wch, U32 glyph_index) const;
|
||||
|
||||
// Global font metrics - in units of pixels
|
||||
virtual F32 getLineHeight() const;
|
||||
virtual F32 getAscenderHeight() const;
|
||||
virtual F32 getDescenderHeight() const;
|
||||
F32 getLineHeight() const;
|
||||
F32 getAscenderHeight() const;
|
||||
F32 getDescenderHeight() const;
|
||||
|
||||
|
||||
// For a lowercase "g":
|
||||
@@ -148,48 +132,49 @@ public:
|
||||
const LLFontGlyphInfo &getMetrics(const llwchar wc) const;
|
||||
F32 getXAdvance(const llwchar wc) const;
|
||||
F32 getXKerning(const llwchar char_left, const llwchar char_right) const; // Get the kerning between the two characters
|
||||
virtual void reset() = 0;
|
||||
LLFontGlyphInfo* getGlyphInfo(const llwchar wch) const;
|
||||
|
||||
void reset(F32 vert_dpi, F32 horz_dpi);
|
||||
|
||||
void destroyGL();
|
||||
|
||||
const std::string& getName() const;
|
||||
|
||||
const LLPointer<LLFontBitmapCache> getFontBitmapCache() const;
|
||||
|
||||
static bool sOpenGLcrashOnRestart;
|
||||
|
||||
protected:
|
||||
virtual BOOL hasGlyph(const llwchar wch) const; // Has a glyph for this character
|
||||
virtual BOOL addChar(const llwchar wch) const; // Add a new character to the font if necessary
|
||||
virtual BOOL addGlyph(const llwchar wch, const U32 glyph_index) const; // Add a new glyph to the existing font
|
||||
virtual BOOL addGlyphFromFont(const LLFontFreetype *fontp, const llwchar wch, const U32 glyph_index) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found)
|
||||
|
||||
virtual LLFontGlyphInfo* getGlyphInfo(const llwchar wch) const;
|
||||
|
||||
void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const;
|
||||
private:
|
||||
void resetBitmapCache();
|
||||
void setSubImageLuminanceAlpha(const U32 x, const U32 y, const U32 bitmap_num, const U32 width, const U32 height, const U8 *data, S32 stride = 0) const;
|
||||
public:
|
||||
BOOL hasGlyph(const llwchar wch) const; // Has a glyph for this character
|
||||
BOOL addGlyph(const llwchar wch) const; // Add a new character to the font if necessary
|
||||
private:
|
||||
BOOL addGlyphFromFont(const LLFontFreetype *fontp, const llwchar wch, const U32 glyph_index) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found)
|
||||
void renderGlyph(const U32 glyph_index) const;
|
||||
|
||||
void resetBitmapCache();
|
||||
void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const;
|
||||
|
||||
protected:
|
||||
std::string mName;
|
||||
|
||||
F32 mPointSize;
|
||||
F32 mAscender;
|
||||
F32 mDescender;
|
||||
F32 mLineHeight;
|
||||
|
||||
mutable LLPointer<LLFontBitmapCache> mFontBitmapCachep;
|
||||
|
||||
LLFT_Face mFTFace;
|
||||
|
||||
BOOL mIsFallback;
|
||||
LLFontList *mFallbackFontp; // A list of fallback fonts to look for glyphs in (for Unicode chars)
|
||||
font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars)
|
||||
|
||||
BOOL mValid;
|
||||
|
||||
typedef std::map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t;
|
||||
mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap
|
||||
|
||||
BOOL mValid;
|
||||
void setSubImageLuminanceAlpha(const U32 x,
|
||||
const U32 y,
|
||||
const U32 bitmap_num,
|
||||
const U32 width,
|
||||
const U32 height,
|
||||
const U8 *data,
|
||||
S32 stride = 0) const;
|
||||
mutable LLPointer<LLFontBitmapCache> mFontBitmapCachep;
|
||||
|
||||
mutable S32 mRenderGlyphCount;
|
||||
mutable S32 mAddGlyphCount;
|
||||
};
|
||||
|
||||
@@ -84,7 +84,6 @@ F32 llfont_round_y(F32 y)
|
||||
}
|
||||
|
||||
LLFontGL::LLFontGL()
|
||||
: LLFontFreetype()
|
||||
{
|
||||
clearEmbeddedChars();
|
||||
}
|
||||
@@ -96,66 +95,22 @@ LLFontGL::~LLFontGL()
|
||||
|
||||
void LLFontGL::reset()
|
||||
{
|
||||
if (!mIsFallback)
|
||||
{
|
||||
// This is the head of the list - need to rebuild ourself and all fallbacks.
|
||||
loadFace(mName,mPointSize,sVertDPI,sHorizDPI,mFontBitmapCachep->getNumComponents(),mIsFallback);
|
||||
if (mFallbackFontp==NULL)
|
||||
{
|
||||
llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (LLFontList::iterator it = mFallbackFontp->begin();
|
||||
it != mFallbackFontp->end();
|
||||
++it)
|
||||
{
|
||||
(*it)->reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
resetBitmapCache();
|
||||
mFontFreetype->reset(sVertDPI, sHorizDPI);
|
||||
}
|
||||
|
||||
bool findOrCreateFont(LLFontGL*& fontp, const LLFontDescriptor& desc)
|
||||
{
|
||||
// Don't delete existing fonts, if any, here, because they've
|
||||
// already been deleted by LLFontRegistry::clear()
|
||||
fontp = LLFontGL::getFont(desc);
|
||||
return (fontp != NULL);
|
||||
}
|
||||
|
||||
|
||||
void LLFontGL::destroyGL()
|
||||
{
|
||||
mFontBitmapCachep->destroyGL();
|
||||
mFontFreetype->destroyGL();
|
||||
}
|
||||
|
||||
BOOL LLFontGL::loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback)
|
||||
{
|
||||
if (!LLFontFreetype::loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback))
|
||||
if(mFontFreetype == reinterpret_cast<LLFontFreetype*>(NULL))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL LLFontGL::addChar(const llwchar wch) const
|
||||
{
|
||||
if (!LLFontFreetype::addChar(wch))
|
||||
{
|
||||
return FALSE;
|
||||
mFontFreetype = new LLFontFreetype;
|
||||
}
|
||||
|
||||
stop_glerror();
|
||||
|
||||
LLFontGlyphInfo *glyph_info = getGlyphInfo(wch);
|
||||
U32 bitmap_num = glyph_info->mBitmapNum;
|
||||
LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num);
|
||||
LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num);
|
||||
image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight());
|
||||
return TRUE;
|
||||
return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts");
|
||||
@@ -255,13 +210,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
||||
switch (valign)
|
||||
{
|
||||
case TOP:
|
||||
cur_y -= llceil(mAscender);
|
||||
cur_y -= llceil(mFontFreetype->getAscenderHeight());
|
||||
break;
|
||||
case BOTTOM:
|
||||
cur_y += llceil(mDescender);
|
||||
cur_y += llceil(mFontFreetype->getDescenderHeight());
|
||||
break;
|
||||
case VCENTER:
|
||||
cur_y -= llceil((llceil(mAscender) - llceil(mDescender))/2.f);
|
||||
cur_y -= llceil((llceil(mFontFreetype->getAscenderHeight()) - llceil(mFontFreetype->getDescenderHeight())) / 2.f);
|
||||
break;
|
||||
case BASELINE:
|
||||
// Baseline, do nothing.
|
||||
@@ -289,7 +244,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
||||
|
||||
F32 start_x = (F32)llround(cur_x);
|
||||
|
||||
const LLFontBitmapCache* font_bitmap_cache = mFontBitmapCachep;
|
||||
const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
|
||||
|
||||
F32 inv_width = 1.f / font_bitmap_cache->getBitmapWidth();
|
||||
F32 inv_height = 1.f / font_bitmap_cache->getBitmapHeight();
|
||||
@@ -351,7 +306,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
||||
|
||||
// snap origin to whole screen pixel
|
||||
const F32 ext_x = (F32)llround(cur_render_x + (EXT_X_BEARING * sScaleX));
|
||||
const F32 ext_y = (F32)llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mAscender - mLineHeight));
|
||||
const F32 ext_y = (F32)llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mFontFreetype->getAscenderHeight() - mFontFreetype->getLineHeight()));
|
||||
|
||||
LLRectf uv_rect(0.f, 1.f, 1.f, 0.f);
|
||||
LLRectf screen_rect(ext_x, ext_y + ext_height, ext_x + ext_width, ext_y);
|
||||
@@ -381,19 +336,20 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!hasGlyph(wch))
|
||||
//new
|
||||
/*if (!mFontFreetype->hasGlyph(wch))
|
||||
{
|
||||
addChar(wch);
|
||||
}
|
||||
}*/
|
||||
|
||||
const LLFontGlyphInfo* fgi= getGlyphInfo(wch);
|
||||
const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch);
|
||||
if (!fgi)
|
||||
{
|
||||
llerrs << "Missing Glyph Info" << llendl;
|
||||
break;
|
||||
}
|
||||
// Per-glyph bitmap texture.
|
||||
LLImageGL *image_gl = mFontBitmapCachep->getImageGL(fgi->mBitmapNum);
|
||||
LLImageGL *image_gl = font_bitmap_cache->getImageGL(fgi->mBitmapNum);
|
||||
if (last_bound_texture != image_gl)
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(image_gl);
|
||||
@@ -428,11 +384,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
||||
if (next_char && (next_char < LAST_CHARACTER))
|
||||
{
|
||||
// Kern this puppy.
|
||||
if (!hasGlyph(next_char))
|
||||
//new
|
||||
/*if (!mFontFreetype->hasGlyph(next_char))
|
||||
{
|
||||
addChar(next_char);
|
||||
}
|
||||
cur_x += getXKerning(wch, next_char);
|
||||
}*/
|
||||
mFontFreetype->getGlyphInfo(next_char);
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
@@ -454,7 +412,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
||||
|
||||
if (style & UNDERLINE)
|
||||
{
|
||||
F32 descender = (F32)llfloor(mDescender);
|
||||
F32 descender = (F32)llfloor(mFontFreetype->getDescenderHeight());
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.begin(LLRender::LINES);
|
||||
@@ -507,6 +465,22 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y
|
||||
return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, halign, valign, style, shadow, S32_MAX, S32_MAX, NULL, FALSE);
|
||||
}
|
||||
|
||||
// font metrics - override for LLFontFreetype that returns units of virtual pixels
|
||||
F32 LLFontGL::getAscenderHeight() const
|
||||
{
|
||||
return mFontFreetype->getAscenderHeight() / sScaleY;
|
||||
}
|
||||
|
||||
F32 LLFontGL::getDescenderHeight() const
|
||||
{
|
||||
return mFontFreetype->getDescenderHeight() / sScaleY;
|
||||
}
|
||||
|
||||
F32 LLFontGL::getLineHeight() const
|
||||
{
|
||||
return (F32)llround(mFontFreetype->getLineHeight() / sScaleY);
|
||||
}
|
||||
|
||||
S32 LLFontGL::getWidth(const std::string& utf8text) const
|
||||
{
|
||||
LLWString wtext = utf8str_to_wstring(utf8text);
|
||||
@@ -573,7 +547,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, const S32 begin_offset, const S
|
||||
}
|
||||
else
|
||||
{
|
||||
cur_x += getXAdvance(wch);
|
||||
cur_x += mFontFreetype->getXAdvance(wch);
|
||||
llwchar next_char = wchars[i+1];
|
||||
|
||||
if (((i + 1) < begin_offset + max_chars)
|
||||
@@ -581,7 +555,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, const S32 begin_offset, const S
|
||||
&& (next_char < LAST_CHARACTER))
|
||||
{
|
||||
// Kern this puppy.
|
||||
cur_x += getXKerning(wch, next_char);
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
}
|
||||
// Round after kerning.
|
||||
@@ -677,7 +651,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
|
||||
}
|
||||
}
|
||||
|
||||
cur_x += getXAdvance(wch);
|
||||
cur_x += mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if (scaled_max_pixels < cur_x)
|
||||
{
|
||||
@@ -688,7 +662,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
|
||||
if (((i+1) < max_chars) && wchars[i+1])
|
||||
{
|
||||
// Kern this puppy.
|
||||
cur_x += getXKerning(wch, wchars[i+1]);
|
||||
cur_x += mFontFreetype->getXKerning(wch, wchars[i+1]);
|
||||
}
|
||||
}
|
||||
// Round after kerning.
|
||||
@@ -743,7 +717,27 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
|
||||
llwchar wch = wchars[i];
|
||||
|
||||
const embedded_data_t* ext_data = getEmbeddedCharData(wch);
|
||||
F32 char_width = ext_data ? getEmbeddedCharAdvance(ext_data) : getXAdvance(wch);
|
||||
F32 char_width = 0;
|
||||
|
||||
if(ext_data)
|
||||
{
|
||||
char_width = getEmbeddedCharAdvance(ext_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
//new
|
||||
const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch);
|
||||
|
||||
// last character uses character width, since the whole character needs to be visible
|
||||
// other characters just use advance
|
||||
char_width = (i == start)
|
||||
? (F32)(fgi->mWidth + fgi->mXBearing) // use actual width for last character
|
||||
: fgi->mXAdvance; // use advance for all other characters
|
||||
|
||||
//old
|
||||
//const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch);
|
||||
//mFontFreetype->getXAdvance(wch);
|
||||
}
|
||||
|
||||
if( scaled_max_pixels < (total_width + char_width) )
|
||||
{
|
||||
@@ -761,7 +755,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
|
||||
if ( i > 0 )
|
||||
{
|
||||
// kerning
|
||||
total_width += ext_data ? (EXT_KERNING * sScaleX) : getXKerning(wchars[i-1], wch);
|
||||
total_width += ext_data ? (EXT_KERNING * sScaleX) : mFontFreetype->getXKerning(wchars[i-1], wch);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
@@ -780,7 +774,6 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset,
|
||||
}
|
||||
|
||||
F32 cur_x = 0;
|
||||
S32 pos = 0;
|
||||
|
||||
target_x *= sScaleX;
|
||||
|
||||
@@ -789,9 +782,10 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset,
|
||||
|
||||
F32 scaled_max_pixels = max_pixels * sScaleX;
|
||||
|
||||
for (S32 i = begin_offset; (i < max_index); i++)
|
||||
S32 pos;
|
||||
for (pos = begin_offset; pos < max_index; pos++)
|
||||
{
|
||||
llwchar wch = wchars[i];
|
||||
llwchar wch = wchars[pos];
|
||||
if (!wch)
|
||||
{
|
||||
break; // done
|
||||
@@ -826,8 +820,8 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset,
|
||||
pos++;
|
||||
cur_x += ext_advance;
|
||||
|
||||
if (((i + 1) < max_index)
|
||||
&& (wchars[(i + 1)]))
|
||||
if (((pos + 1) < max_index)
|
||||
&& (wchars[(pos + 1)]))
|
||||
{
|
||||
cur_x += EXT_KERNING * sScaleX;
|
||||
}
|
||||
@@ -836,7 +830,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset,
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 char_width = getXAdvance(wch);
|
||||
F32 char_width = mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if (round)
|
||||
{
|
||||
@@ -860,12 +854,11 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset,
|
||||
pos++;
|
||||
cur_x += char_width;
|
||||
|
||||
if (((i + 1) < max_index)
|
||||
&& (wchars[(i + 1)]))
|
||||
if (((pos + 1) < max_index)
|
||||
&& (wchars[(pos + 1)]))
|
||||
{
|
||||
llwchar next_char = wchars[i + 1];
|
||||
// Kern this puppy.
|
||||
cur_x += getXKerning(wch, next_char);
|
||||
cur_x += mFontFreetype->getXKerning(wch, wchars[pos + 1]);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
@@ -876,6 +869,10 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset,
|
||||
return pos;
|
||||
}
|
||||
|
||||
const LLFontDescriptor& LLFontGL::getFontDesc() const
|
||||
{
|
||||
return mFontDescriptor;
|
||||
}
|
||||
|
||||
const LLFontGL::embedded_data_t* LLFontGL::getEmbeddedCharData(const llwchar wch) const
|
||||
{
|
||||
@@ -1041,9 +1038,11 @@ std::string LLFontGL::getStringFromStyle(U8 style)
|
||||
}
|
||||
return style_string;
|
||||
}
|
||||
|
||||
// static
|
||||
std::string LLFontGL::nameFromFont(const LLFontGL* fontp)
|
||||
{
|
||||
return fontp->getFontDesc().getName();
|
||||
return fontp->mFontDescriptor.getName();
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -1249,7 +1248,7 @@ void LLFontGL::renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F3
|
||||
void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_strength) const
|
||||
{
|
||||
F32 slant_offset;
|
||||
slant_offset = ((style & ITALIC) ? ( -mAscender * 0.2f) : 0.f);
|
||||
slant_offset = ((style & ITALIC) ? ( -mFontFreetype->getAscenderHeight() * 0.2f) : 0.f);
|
||||
|
||||
gGL.begin(LLRender::QUADS);
|
||||
{
|
||||
|
||||
@@ -28,23 +28,24 @@
|
||||
#ifndef LL_LLFONTGL_H
|
||||
#define LL_LLFONTGL_H
|
||||
|
||||
#include "llfontfreetype.h"
|
||||
#include "lltexture.h"
|
||||
#include "v2math.h"
|
||||
#include "llcoord.h"
|
||||
#include "llrect.h"
|
||||
|
||||
#include "llfontregistry.h"
|
||||
#include "lltexture.h"
|
||||
#include "llpointer.h"
|
||||
#include "llrect.h"
|
||||
#include "v2math.h"
|
||||
|
||||
class LLImageGL;
|
||||
|
||||
class LLColor4;
|
||||
|
||||
// Key used to request a font.
|
||||
class LLFontDescriptor;
|
||||
class LLFontFreetype;
|
||||
|
||||
// Structure used to store previously requested fonts.
|
||||
class LLFontRegistry;
|
||||
|
||||
class LLFontGL : public LLFontFreetype
|
||||
class LLFontGL
|
||||
{
|
||||
public:
|
||||
enum HAlign
|
||||
@@ -88,7 +89,7 @@ public:
|
||||
|
||||
void destroyGL();
|
||||
|
||||
/* virtual*/ BOOL loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback);
|
||||
BOOL loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback);
|
||||
|
||||
S32 render(const LLWString &text, S32 begin_offset,
|
||||
const LLRect& rect,
|
||||
@@ -118,9 +119,9 @@ public:
|
||||
S32 renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style = NORMAL, ShadowType shadow = NO_SHADOW) const;
|
||||
|
||||
// font metrics - override for LLFont that returns units of virtual pixels
|
||||
/*virtual*/ F32 getLineHeight() const { return (F32)llround(mLineHeight / sScaleY); }
|
||||
/*virtual*/ F32 getAscenderHeight() const { return (F32)llround(mAscender / sScaleY); }
|
||||
/*virtual*/ F32 getDescenderHeight() const { return (F32)llround(mDescender / sScaleY); }
|
||||
F32 getAscenderHeight() const;
|
||||
F32 getDescenderHeight() const;
|
||||
F32 getLineHeight() const;
|
||||
|
||||
S32 getWidth(const std::string& utf8text) const;
|
||||
S32 getWidth(const llwchar* wchars) const;
|
||||
@@ -151,8 +152,7 @@ public:
|
||||
// Returns the index of the character closest to pixel position x (ignoring text to the right of max_pixels and max_chars)
|
||||
S32 charFromPixelOffset(const llwchar* wchars, const S32 char_offset, F32 x, F32 max_pixels=F32_MAX, S32 max_chars = S32_MAX, BOOL round = TRUE, BOOL use_embedded = FALSE) const;
|
||||
|
||||
const LLFontDescriptor &getFontDesc() const { return mFontDesc; }
|
||||
void setFontDesc(const LLFontDescriptor& font_desc) { mFontDesc = font_desc; }
|
||||
const LLFontDescriptor& getFontDesc() const;
|
||||
|
||||
LLTexture *getTexture() const;
|
||||
|
||||
@@ -217,19 +217,20 @@ public:
|
||||
static F32 sScaleY;
|
||||
static BOOL sDisplayFont ;
|
||||
static std::string sAppDir; // For loading fonts
|
||||
private:
|
||||
friend class LLFontRegistry;
|
||||
friend class LLTextBillboard;
|
||||
friend class LLHUDText;
|
||||
|
||||
LLFontGL(const LLFontGL &source);
|
||||
LLFontGL &operator=(const LLFontGL &source);
|
||||
protected:
|
||||
/*virtual*/ BOOL addChar(const llwchar wch) const;
|
||||
|
||||
protected:
|
||||
typedef std::map<llwchar,embedded_data_t*> embedded_map_t;
|
||||
mutable embedded_map_t mEmbeddedChars;
|
||||
|
||||
LLFontDescriptor mFontDesc;
|
||||
LLFontDescriptor mFontDescriptor;
|
||||
LLPointer<LLFontFreetype> mFontFreetype;
|
||||
|
||||
void renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const;
|
||||
void drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const;
|
||||
|
||||
@@ -421,7 +421,8 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
|
||||
llwarns << "createFont failed, no file names specified" << llendl;
|
||||
return NULL;
|
||||
}
|
||||
LLFontList *fontlistp = new LLFontList;
|
||||
|
||||
LLFontFreetype::font_vector_t fontlist;
|
||||
LLFontGL *result = NULL;
|
||||
|
||||
// Snarf all fonts we can into fontlistp. First will get pulled
|
||||
@@ -466,19 +467,24 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
|
||||
is_first_found = false;
|
||||
}
|
||||
else
|
||||
fontlistp->addAtEnd(fontp);
|
||||
{
|
||||
fontlist.push_back(fontp->mFontFreetype);
|
||||
delete fontp;
|
||||
fontp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result && !fontlistp->empty())
|
||||
|
||||
if (result && !fontlist.empty())
|
||||
{
|
||||
result->setFallbackFont(fontlistp);
|
||||
result->mFontFreetype->setFallbackFonts(fontlist);
|
||||
}
|
||||
|
||||
norm_desc.setStyle(match_desc->getStyle());
|
||||
if (result)
|
||||
result->setFontDesc(norm_desc);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
result->mFontDescriptor = desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "createFont failed in some way" << llendl;
|
||||
}
|
||||
|
||||
@@ -755,10 +755,12 @@ bool LLGLManager::initGL()
|
||||
#endif
|
||||
stop_glerror();
|
||||
|
||||
#if LL_WINDOWS
|
||||
if (mIsIntel && mGLVersion <= 3.f)
|
||||
{ //never try to use framebuffer objects on older intel drivers (crashy)
|
||||
mHasFramebufferObject = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
stop_glerror();
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
LL_WARNS("ShaderLoading") << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LL_DEBUGS("ShaderLoading") << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL;
|
||||
|
||||
if (filename.empty())
|
||||
@@ -610,6 +610,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
text[count++] = strdup("#define ATTRIBUTE attribute\n");
|
||||
text[count++] = strdup("#define VARYING varying\n");
|
||||
text[count++] = strdup("#define VARYING_FLAT varying\n");
|
||||
// Need to enable extensions here instead of in the shader files,
|
||||
// before any non-preprocessor directives (per spec)
|
||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
||||
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
|
||||
}
|
||||
else if (minor_version <= 29)
|
||||
{
|
||||
@@ -620,6 +624,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
text[count++] = strdup("#define ATTRIBUTE attribute\n");
|
||||
text[count++] = strdup("#define VARYING varying\n");
|
||||
text[count++] = strdup("#define VARYING_FLAT varying\n");
|
||||
// Need to enable extensions here instead of in the shader files,
|
||||
// before any non-preprocessor directives (per spec)
|
||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
||||
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -628,6 +636,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
{
|
||||
//set version to 1.30
|
||||
text[count++] = strdup("#version 130\n");
|
||||
// Need to enable extensions here instead of in the shader files,
|
||||
// before any non-preprocessor directives (per spec)
|
||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
||||
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
|
||||
|
||||
|
||||
//some implementations of GLSL 1.30 require integer precision be explicitly declared
|
||||
text[count++] = strdup("precision mediump int;\n");
|
||||
@@ -636,7 +649,12 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
|
||||
else
|
||||
{ //set version to 400
|
||||
text[count++] = strdup("#version 400\n");
|
||||
// Need to enable extensions here instead of in the shader files,
|
||||
// before any non-preprocessor directives (per spec)
|
||||
text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n");
|
||||
text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n");
|
||||
}
|
||||
|
||||
|
||||
text[count++] = strdup("#define DEFINE_GL_FRAGCOLOR 1\n");
|
||||
text[count++] = strdup("#define FXAA_GLSL_130 1\n");
|
||||
|
||||
@@ -2109,7 +2109,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
|
||||
|
||||
if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))))
|
||||
{
|
||||
LLFastTimer t(FTM_BIND_GL_BUFFER);
|
||||
//LLFastTimer t(FTM_BIND_GL_BUFFER);
|
||||
/*if (sMapped)
|
||||
{
|
||||
llerrs << "VBO bound while another VBO mapped!" << llendl;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llresmgr.h"
|
||||
#include "llimagegl.h"
|
||||
#include "llfontgl.h"
|
||||
#include "llerror.h"
|
||||
#include "llstring.h"
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llstyle.h"
|
||||
|
||||
#include "llfontgl.h"
|
||||
#include "llstring.h"
|
||||
#include "llui.h"
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ include(LLXML)
|
||||
#include(LScript)
|
||||
include(Linking)
|
||||
include(NDOF)
|
||||
include(NVAPI)
|
||||
include(StateMachine)
|
||||
include(TemplateCheck)
|
||||
include(UI)
|
||||
@@ -1140,7 +1141,6 @@ if (DARWIN)
|
||||
${VIEWER_BRANDING_ID}.icns
|
||||
macview.r
|
||||
gpu_table.txt
|
||||
Info-${VIEWER_BRANDING_NAME_CAMELCASE}.plist
|
||||
SecondLife.nib/
|
||||
# CMake doesn't seem to support Xcode language variants well just yet
|
||||
English.lproj/InfoPlist.strings
|
||||
@@ -1433,13 +1433,7 @@ if (!DISABLE_TEMPLATE_CHECK)
|
||||
check_message_template(${VIEWER_BINARY_NAME})
|
||||
endif (!DISABLE_TEMPLATE_CHECK)
|
||||
|
||||
# We package by default on Linux so we can run from newview/packaged.
|
||||
if (LINUX)
|
||||
set(PACKAGE_DEFAULT ON)
|
||||
else (LINUX)
|
||||
set(PACKAGE_DEFAULT OFF)
|
||||
endif (LINUX)
|
||||
set(PACKAGE ${PACKAGE_DEFAULT} CACHE BOOL
|
||||
set(PACKAGE OFF CACHE BOOL
|
||||
"Add a package target that builds an installer package.")
|
||||
|
||||
if (WINDOWS)
|
||||
@@ -1598,6 +1592,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${NDOF_LIBRARY}
|
||||
${NVAPI_LIBRARY}
|
||||
${viewer_LIBRARIES}
|
||||
${Boost_CONTEXT_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
@@ -1711,7 +1706,7 @@ if (DARWIN)
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "${VIEWER_BRANDING_NAME}"
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${viewer_VERSION}"
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION "${viewer_VERSION}"
|
||||
MACOSX_BUNDLE_COPYRIGHT "Copyright 2010 Balseraph Software Group"
|
||||
MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 Siana Gearz"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
@@ -1760,32 +1755,10 @@ if (DARWIN)
|
||||
--grid=${GRID}
|
||||
--login_channel=${VIEWER_LOGIN_CHANNEL}
|
||||
--source=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
|
||||
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${Product}.touched
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
)
|
||||
# Viewer-Development doesn't have this duplicate of the above command, here..
|
||||
# this may be a botched merge, but Mac seems to be picky, so I'm leaving it ~Liru
|
||||
add_custom_command(
|
||||
TARGET package POST_BUILD
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
--artwork=${ARTWORK_DIR}
|
||||
--branding_id=${VIEWER_BRANDING_ID}
|
||||
--build=${CMAKE_CURRENT_BINARY_DIR}
|
||||
--buildtype=${CMAKE_BUILD_TYPE}
|
||||
--channel=${VIEWER_CHANNEL}
|
||||
--configuration=${CMAKE_CFG_INTDIR}
|
||||
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
|
||||
--grid=${GRID}
|
||||
--login_channel=${VIEWER_LOGIN_CHANNEL}
|
||||
--source=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
)
|
||||
|
||||
endif (PACKAGE)
|
||||
endif (DARWIN)
|
||||
|
||||
@@ -1813,7 +1786,7 @@ if (PACKAGE)
|
||||
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
|
||||
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}")
|
||||
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2")
|
||||
set(VIEWER_EXE_GLOBS "'Singularity' SLPlugin")
|
||||
set(VIEWER_EXE_GLOBS "'${VIEWER_BRANDING_NAME}' SLPlugin")
|
||||
set(VIEWER_LIB_GLOB "*.dylib")
|
||||
endif (DARWIN)
|
||||
if (LINUX)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
CFBundleName = "Singularity";
|
||||
|
||||
CFBundleShortVersionString = "Singularity Viewer 1.7.0.0";
|
||||
CFBundleGetInfoString = "Singularity Viewer 1.7.0.0, Copyright 2012 Siana Gearz";
|
||||
|
||||
6
indra/newview/English.lproj/InfoPlist.strings.in
Normal file
6
indra/newview/English.lproj/InfoPlist.strings.in
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
CFBundleName = "${VIEWER_CHANNEL_ONE_WORD}";
|
||||
|
||||
CFBundleShortVersionString = "${VIEWER_CHANNEL} Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}";
|
||||
CFBundleGetInfoString = "${VIEWER_CHANNEL} Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}, Copyright 2012 Siana Gearz";
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Singularity</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>singularity.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.singularityviewer.singularity</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Singularity</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>Second Life URL</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>secondlife</string>
|
||||
</array>
|
||||
<key>LSIsAppleDefaultForScheme</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.0.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -13785,6 +13785,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RevokePermsOnStopAnimation</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Clear animation permssions when choosing "Stop Animating Me"</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RotateRight</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#define INDEXED 1
|
||||
#define NON_INDEXED 2
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
@@ -34,7 +34,7 @@ out vec4 frag_color;
|
||||
|
||||
#define FXAA_PC 1
|
||||
//#define FXAA_GLSL_130 1
|
||||
#define FXAA_QUALITY__PRESET 12
|
||||
#define FXAA_QUALITY_M_PRESET 12
|
||||
|
||||
/*============================================================================
|
||||
|
||||
@@ -67,7 +67,7 @@ Example,
|
||||
|
||||
#define FXAA_PC 1
|
||||
#define FXAA_HLSL_5 1
|
||||
#define FXAA_QUALITY__PRESET 12
|
||||
#define FXAA_QUALITY_M_PRESET 12
|
||||
|
||||
Or,
|
||||
|
||||
@@ -366,7 +366,7 @@ A. Or use FXAA_GREEN_AS_LUMA.
|
||||
/*============================================================================
|
||||
FXAA CONSOLE PS3 - TUNING KNOBS
|
||||
============================================================================*/
|
||||
#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
|
||||
#ifndef FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS
|
||||
//
|
||||
// Consoles the sharpness of edges on PS3 only.
|
||||
// Non-PS3 tuning is done with shader input.
|
||||
@@ -380,17 +380,17 @@ A. Or use FXAA_GREEN_AS_LUMA.
|
||||
// 2.0 is really soft (good for vector graphics inputs)
|
||||
//
|
||||
#if 1
|
||||
#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
|
||||
#define FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS 8.0
|
||||
#endif
|
||||
#if 0
|
||||
#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
|
||||
#define FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS 4.0
|
||||
#endif
|
||||
#if 0
|
||||
#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
|
||||
#define FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS 2.0
|
||||
#endif
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
|
||||
#ifndef FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD
|
||||
//
|
||||
// Only effects PS3.
|
||||
// Non-PS3 tuning is done with shader input.
|
||||
@@ -408,9 +408,9 @@ A. Or use FXAA_GREEN_AS_LUMA.
|
||||
// 0.25 leaves more aliasing, and is sharper
|
||||
//
|
||||
#if 1
|
||||
#define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
|
||||
#define FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD 0.125
|
||||
#else
|
||||
#define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
|
||||
#define FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD 0.25
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -419,7 +419,7 @@ A. Or use FXAA_GREEN_AS_LUMA.
|
||||
------------------------------------------------------------------------------
|
||||
NOTE the other tuning knobs are now in the shader function inputs!
|
||||
============================================================================*/
|
||||
#ifndef FXAA_QUALITY__PRESET
|
||||
#ifndef FXAA_QUALITY_M_PRESET
|
||||
//
|
||||
// Choose the quality preset.
|
||||
// This needs to be compiled into the shader as it effects code.
|
||||
@@ -440,7 +440,7 @@ NOTE the other tuning knobs are now in the shader function inputs!
|
||||
// _ = the lowest digit is directly related to performance
|
||||
// _ = the highest digit is directly related to style
|
||||
//
|
||||
#define FXAA_QUALITY__PRESET 12
|
||||
#define FXAA_QUALITY_M_PRESET 12
|
||||
#endif
|
||||
|
||||
|
||||
@@ -453,198 +453,198 @@ NOTE the other tuning knobs are now in the shader function inputs!
|
||||
/*============================================================================
|
||||
FXAA QUALITY - MEDIUM DITHER PRESETS
|
||||
============================================================================*/
|
||||
#if (FXAA_QUALITY__PRESET == 10)
|
||||
#define FXAA_QUALITY__PS 3
|
||||
#define FXAA_QUALITY__P0 1.5
|
||||
#define FXAA_QUALITY__P1 3.0
|
||||
#define FXAA_QUALITY__P2 12.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 10)
|
||||
#define FXAA_QUALITY_M_PS 3
|
||||
#define FXAA_QUALITY_M_P0 1.5
|
||||
#define FXAA_QUALITY_M_P1 3.0
|
||||
#define FXAA_QUALITY_M_P2 12.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 11)
|
||||
#define FXAA_QUALITY__PS 4
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 3.0
|
||||
#define FXAA_QUALITY__P3 12.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 11)
|
||||
#define FXAA_QUALITY_M_PS 4
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 3.0
|
||||
#define FXAA_QUALITY_M_P3 12.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 12)
|
||||
#define FXAA_QUALITY__PS 5
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 4.0
|
||||
#define FXAA_QUALITY__P4 12.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 12)
|
||||
#define FXAA_QUALITY_M_PS 5
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 4.0
|
||||
#define FXAA_QUALITY_M_P4 12.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 13)
|
||||
#define FXAA_QUALITY__PS 6
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 4.0
|
||||
#define FXAA_QUALITY__P5 12.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 13)
|
||||
#define FXAA_QUALITY_M_PS 6
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 4.0
|
||||
#define FXAA_QUALITY_M_P5 12.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 14)
|
||||
#define FXAA_QUALITY__PS 7
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 4.0
|
||||
#define FXAA_QUALITY__P6 12.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 14)
|
||||
#define FXAA_QUALITY_M_PS 7
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 4.0
|
||||
#define FXAA_QUALITY_M_P6 12.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 15)
|
||||
#define FXAA_QUALITY__PS 8
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 4.0
|
||||
#define FXAA_QUALITY__P7 12.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 15)
|
||||
#define FXAA_QUALITY_M_PS 8
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 2.0
|
||||
#define FXAA_QUALITY_M_P6 4.0
|
||||
#define FXAA_QUALITY_M_P7 12.0
|
||||
#endif
|
||||
|
||||
/*============================================================================
|
||||
FXAA QUALITY - LOW DITHER PRESETS
|
||||
============================================================================*/
|
||||
#if (FXAA_QUALITY__PRESET == 20)
|
||||
#define FXAA_QUALITY__PS 3
|
||||
#define FXAA_QUALITY__P0 1.5
|
||||
#define FXAA_QUALITY__P1 2.0
|
||||
#define FXAA_QUALITY__P2 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 20)
|
||||
#define FXAA_QUALITY_M_PS 3
|
||||
#define FXAA_QUALITY_M_P0 1.5
|
||||
#define FXAA_QUALITY_M_P1 2.0
|
||||
#define FXAA_QUALITY_M_P2 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 21)
|
||||
#define FXAA_QUALITY__PS 4
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 21)
|
||||
#define FXAA_QUALITY_M_PS 4
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 22)
|
||||
#define FXAA_QUALITY__PS 5
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 22)
|
||||
#define FXAA_QUALITY_M_PS 5
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 23)
|
||||
#define FXAA_QUALITY__PS 6
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 23)
|
||||
#define FXAA_QUALITY_M_PS 6
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 24)
|
||||
#define FXAA_QUALITY__PS 7
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 3.0
|
||||
#define FXAA_QUALITY__P6 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 24)
|
||||
#define FXAA_QUALITY_M_PS 7
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 3.0
|
||||
#define FXAA_QUALITY_M_P6 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 25)
|
||||
#define FXAA_QUALITY__PS 8
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 4.0
|
||||
#define FXAA_QUALITY__P7 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 25)
|
||||
#define FXAA_QUALITY_M_PS 8
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 2.0
|
||||
#define FXAA_QUALITY_M_P6 4.0
|
||||
#define FXAA_QUALITY_M_P7 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 26)
|
||||
#define FXAA_QUALITY__PS 9
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 4.0
|
||||
#define FXAA_QUALITY__P8 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 26)
|
||||
#define FXAA_QUALITY_M_PS 9
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 2.0
|
||||
#define FXAA_QUALITY_M_P6 2.0
|
||||
#define FXAA_QUALITY_M_P7 4.0
|
||||
#define FXAA_QUALITY_M_P8 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 27)
|
||||
#define FXAA_QUALITY__PS 10
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 4.0
|
||||
#define FXAA_QUALITY__P9 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 27)
|
||||
#define FXAA_QUALITY_M_PS 10
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 2.0
|
||||
#define FXAA_QUALITY_M_P6 2.0
|
||||
#define FXAA_QUALITY_M_P7 2.0
|
||||
#define FXAA_QUALITY_M_P8 4.0
|
||||
#define FXAA_QUALITY_M_P9 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 28)
|
||||
#define FXAA_QUALITY__PS 11
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 2.0
|
||||
#define FXAA_QUALITY__P9 4.0
|
||||
#define FXAA_QUALITY__P10 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 28)
|
||||
#define FXAA_QUALITY_M_PS 11
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 2.0
|
||||
#define FXAA_QUALITY_M_P6 2.0
|
||||
#define FXAA_QUALITY_M_P7 2.0
|
||||
#define FXAA_QUALITY_M_P8 2.0
|
||||
#define FXAA_QUALITY_M_P9 4.0
|
||||
#define FXAA_QUALITY_M_P10 8.0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PRESET == 29)
|
||||
#define FXAA_QUALITY__PS 12
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 2.0
|
||||
#define FXAA_QUALITY__P9 2.0
|
||||
#define FXAA_QUALITY__P10 4.0
|
||||
#define FXAA_QUALITY__P11 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 29)
|
||||
#define FXAA_QUALITY_M_PS 12
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.5
|
||||
#define FXAA_QUALITY_M_P2 2.0
|
||||
#define FXAA_QUALITY_M_P3 2.0
|
||||
#define FXAA_QUALITY_M_P4 2.0
|
||||
#define FXAA_QUALITY_M_P5 2.0
|
||||
#define FXAA_QUALITY_M_P6 2.0
|
||||
#define FXAA_QUALITY_M_P7 2.0
|
||||
#define FXAA_QUALITY_M_P8 2.0
|
||||
#define FXAA_QUALITY_M_P9 2.0
|
||||
#define FXAA_QUALITY_M_P10 4.0
|
||||
#define FXAA_QUALITY_M_P11 8.0
|
||||
#endif
|
||||
|
||||
/*============================================================================
|
||||
FXAA QUALITY - EXTREME QUALITY
|
||||
============================================================================*/
|
||||
#if (FXAA_QUALITY__PRESET == 39)
|
||||
#define FXAA_QUALITY__PS 12
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.0
|
||||
#define FXAA_QUALITY__P2 1.0
|
||||
#define FXAA_QUALITY__P3 1.0
|
||||
#define FXAA_QUALITY__P4 1.0
|
||||
#define FXAA_QUALITY__P5 1.5
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 2.0
|
||||
#define FXAA_QUALITY__P9 2.0
|
||||
#define FXAA_QUALITY__P10 4.0
|
||||
#define FXAA_QUALITY__P11 8.0
|
||||
#if (FXAA_QUALITY_M_PRESET == 39)
|
||||
#define FXAA_QUALITY_M_PS 12
|
||||
#define FXAA_QUALITY_M_P0 1.0
|
||||
#define FXAA_QUALITY_M_P1 1.0
|
||||
#define FXAA_QUALITY_M_P2 1.0
|
||||
#define FXAA_QUALITY_M_P3 1.0
|
||||
#define FXAA_QUALITY_M_P4 1.0
|
||||
#define FXAA_QUALITY_M_P5 1.5
|
||||
#define FXAA_QUALITY_M_P6 2.0
|
||||
#define FXAA_QUALITY_M_P7 2.0
|
||||
#define FXAA_QUALITY_M_P8 2.0
|
||||
#define FXAA_QUALITY_M_P9 2.0
|
||||
#define FXAA_QUALITY_M_P10 4.0
|
||||
#define FXAA_QUALITY_M_P11 8.0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -869,7 +869,7 @@ FxaaFloat4 FxaaPixelShader(
|
||||
// This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
|
||||
// It is here now to allow easier tuning.
|
||||
// This does not effect PS3, as this needs to be compiled in.
|
||||
// Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
|
||||
// Use FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS for PS3.
|
||||
// Due to the PS3 being ALU bound,
|
||||
// there are only three safe values here: 2 and 4 and 8.
|
||||
// These options use the shaders ability to a free *|/ by 2|4|8.
|
||||
@@ -883,7 +883,7 @@ FxaaFloat4 FxaaPixelShader(
|
||||
// This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
|
||||
// It is here now to allow easier tuning.
|
||||
// This does not effect PS3, as this needs to be compiled in.
|
||||
// Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
|
||||
// Use FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD for PS3.
|
||||
// Due to the PS3 being ALU bound,
|
||||
// there are only two safe values here: 1/4 and 1/8.
|
||||
// These options use the shaders ability to a free *|/ by 2|4|8.
|
||||
@@ -1041,11 +1041,11 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if( horzSpan) posB.y += lengthSign * 0.5;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
FxaaFloat2 posN;
|
||||
posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
|
||||
posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
|
||||
posN.x = posB.x - offNP.x * FXAA_QUALITY_M_P0;
|
||||
posN.y = posB.y - offNP.y * FXAA_QUALITY_M_P0;
|
||||
FxaaFloat2 posP;
|
||||
posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
|
||||
posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
|
||||
posP.x = posB.x + offNP.x * FXAA_QUALITY_M_P0;
|
||||
posP.y = posB.y + offNP.y * FXAA_QUALITY_M_P0;
|
||||
FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
|
||||
FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
|
||||
FxaaFloat subpixE = subpixC * subpixC;
|
||||
@@ -1061,11 +1061,11 @@ FxaaFloat4 FxaaPixelShader(
|
||||
lumaEndP -= lumaNN * 0.5;
|
||||
FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
|
||||
FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P1;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P1;
|
||||
FxaaBool doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P1;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P1;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
@@ -1074,13 +1074,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P2;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P2;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P2;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P2;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 3)
|
||||
#if (FXAA_QUALITY_M_PS > 3)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1088,13 +1088,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P3;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P3;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P3;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P3;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 4)
|
||||
#if (FXAA_QUALITY_M_PS > 4)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1102,13 +1102,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P4;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P4;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P4;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P4;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 5)
|
||||
#if (FXAA_QUALITY_M_PS > 5)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1116,13 +1116,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P5;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P5;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P5;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P5;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 6)
|
||||
#if (FXAA_QUALITY_M_PS > 6)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1130,13 +1130,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P6;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P6;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P6;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P6;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 7)
|
||||
#if (FXAA_QUALITY_M_PS > 7)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1144,13 +1144,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P7;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P7;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P7;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P7;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 8)
|
||||
#if (FXAA_QUALITY_M_PS > 8)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1158,13 +1158,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P8;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P8;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P8;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P8;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 9)
|
||||
#if (FXAA_QUALITY_M_PS > 9)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1172,13 +1172,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P9;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P9;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P9;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P9;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 10)
|
||||
#if (FXAA_QUALITY_M_PS > 10)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1186,13 +1186,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P10;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P10;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P10;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P10;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 11)
|
||||
#if (FXAA_QUALITY_M_PS > 11)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1200,13 +1200,13 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P11;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P11;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P11;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P11;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_QUALITY__PS > 12)
|
||||
#if (FXAA_QUALITY_M_PS > 12)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -1214,11 +1214,11 @@ FxaaFloat4 FxaaPixelShader(
|
||||
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
|
||||
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P12;
|
||||
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P12;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P12;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P12;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
}
|
||||
#endif
|
||||
@@ -1291,9 +1291,9 @@ FxaaFloat4 FxaaPixelShader(
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Instead of using this on PC, I'd suggest just using FXAA Quality with
|
||||
#define FXAA_QUALITY__PRESET 10
|
||||
#define FXAA_QUALITY_M_PRESET 10
|
||||
Or
|
||||
#define FXAA_QUALITY__PRESET 20
|
||||
#define FXAA_QUALITY_M_PRESET 20
|
||||
Either are higher qualilty and almost as fast as this on modern PC GPUs.
|
||||
============================================================================*/
|
||||
#if (FXAA_PC_CONSOLE == 1)
|
||||
@@ -1704,7 +1704,7 @@ half4 FxaaPixelShader(
|
||||
// (5)
|
||||
half4 dir1_pos;
|
||||
dir1_pos.xy = normalize(dir.xyz).xz;
|
||||
half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
|
||||
half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS);
|
||||
/*--------------------------------------------------------------------------*/
|
||||
// (6)
|
||||
half4 dir2_pos;
|
||||
@@ -2019,7 +2019,7 @@ half4 FxaaPixelShader(
|
||||
// (6)
|
||||
half4 dir1_pos;
|
||||
dir1_pos.xy = normalize(dir).xz;
|
||||
half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
|
||||
half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS);
|
||||
/*--------------------------------------------------------------------------*/
|
||||
// (7)
|
||||
half4 dir2_pos;
|
||||
@@ -2061,7 +2061,7 @@ half4 FxaaPixelShader(
|
||||
temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
|
||||
half4 rgby2;
|
||||
rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
|
||||
half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
|
||||
half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD;
|
||||
/*--------------------------------------------------------------------------*/
|
||||
// (12)
|
||||
rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -31,8 +31,8 @@ out vec4 frag_color;
|
||||
|
||||
//class 1 -- no shadows
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
uniform sampler2DRect diffuseRect;
|
||||
uniform sampler2DRect specularRect;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
//class 1, no shadow, no SSAO, should never be called
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -151,7 +151,7 @@ void main()
|
||||
|
||||
vec4 fb = texture2D(screenTex, distort);
|
||||
|
||||
frag_data[0] = vec4(linear_to_srgb(fb.rgb), 1.0); // diffuse
|
||||
frag_data[0] = vec4(/*linear_to_srgb*/(fb.rgb), 1.0); // diffuse
|
||||
frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
|
||||
frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_data[3];
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -29,7 +29,7 @@ out vec4 frag_color;
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
uniform sampler2D glowMap;
|
||||
uniform sampler2DRect screenMap;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
//#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version 27
|
||||
version 28
|
||||
|
||||
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
|
||||
// Should be combined into one table
|
||||
@@ -301,7 +301,7 @@ RenderObjectBump 0 0
|
||||
list OpenGLPre15
|
||||
RenderVBOEnable 1 0
|
||||
|
||||
list Intel
|
||||
list IntelPre30
|
||||
RenderAnisotropic 1 0
|
||||
// Avoid some Intel crashes on Linux
|
||||
RenderCubeMap 0 0
|
||||
|
||||
@@ -301,7 +301,11 @@ Intel Eaglelake .*Intel.*Eaglelake.* 0 1
|
||||
Intel Graphics Media HD .*Intel.*Graphics Media.*HD.* 0 1
|
||||
Intel HD Graphics 2000 .*Intel.*HD Graphics 2000.* 1 1
|
||||
Intel HD Graphics 3000 .*Intel.*HD Graphics 3000.* 2 1
|
||||
Intel HD Graphics 3000 .*Intel.*Sandybridge.* 2 1
|
||||
Intel HD Graphics 4000 .*Intel.*HD Graphics 4000.* 2 1
|
||||
Intel HD Graphics 4000 .*Intel.*Ivybridge.* 2 1
|
||||
Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 2 1
|
||||
Intel HD Graphics 5000 .*Intel.*Haswell.* 2 1
|
||||
Intel HD Graphics .*Intel.*HD Graphics.* 2 1
|
||||
Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1
|
||||
Intel Media Graphics HD .*Intel.*Media Graphics HD.* 0 1
|
||||
@@ -312,6 +316,7 @@ Intel HD Graphics 2000 .*Intel.*HD2000.* 1 1
|
||||
Intel HD Graphics 3000 .*Intel.*HD3000.* 2 1
|
||||
Matrox .*Matrox.* 0 0
|
||||
Mesa .*Mesa.* 0 0
|
||||
Gallium .*Gallium.* 1 1
|
||||
NVIDIA 205 .*NVIDIA .*GeForce 205.* 2 1
|
||||
NVIDIA 210 .*NVIDIA .*GeForce 210.* 2 1
|
||||
NVIDIA 310M .*NVIDIA .*GeForce 310M.* 1 1
|
||||
@@ -407,6 +412,12 @@ NVIDIA GTX 670 .*NVIDIA .*GTX *67.* 3 1
|
||||
NVIDIA GTX 680M .*NVIDIA .*GTX *680M.* 3 1
|
||||
NVIDIA GTX 680 .*NVIDIA .*GTX *68.* 3 1
|
||||
NVIDIA GTX 690 .*NVIDIA .*GTX *69.* 3 1
|
||||
NVIDIA GTX 750 .*NVIDIA .*GTX *75.* 3 1
|
||||
NVIDIA GTX 760 .*NVIDIA .*GTX *76.* 3 1
|
||||
NVIDIA GTX 770 .*NVIDIA .*GTX *77.* 3 1
|
||||
NVIDIA GTX 780 .*NVIDIA .*GTX *78.* 3 1
|
||||
NVIDIA GTX TITAN .*NVIDIA .*GTX *TITAN.* 3 1
|
||||
NVIDIA GT 7xxM .*NVIDIA .*GT *7.* 3 1
|
||||
NVIDIA C51 .*NVIDIA .*C51.* 0 1
|
||||
NVIDIA G72 .*NVIDIA .*G72.* 1 1
|
||||
NVIDIA G73 .*NVIDIA .*G73.* 1 1
|
||||
|
||||
@@ -77,7 +77,9 @@ fi
|
||||
export SDL_VIDEO_X11_DGAMOUSE=0
|
||||
|
||||
## - Works around a problem with misconfigured 64-bit systems not finding GL
|
||||
export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}":/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri
|
||||
# This is less needed nowadays; don't uncomment this unless LibGL can't find your
|
||||
# drivers automatically.
|
||||
#export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}":/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri
|
||||
|
||||
## - The 'scim' GTK IM module widely crashes the viewer. Avoid it.
|
||||
if [ "$GTK_IM_MODULE" = "scim" ]; then
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#include "llworld.h"
|
||||
#include "llworldmap.h"
|
||||
#include "llworldmapmessage.h"
|
||||
#include "../lscript/lscript_byteformat.h"
|
||||
|
||||
//Misc non-standard includes
|
||||
#include "llurldispatcher.h"
|
||||
@@ -3061,7 +3062,7 @@ LLQuaternion LLAgent::getHeadRotation()
|
||||
return rot;
|
||||
}
|
||||
|
||||
void LLAgent::sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request)
|
||||
void LLAgent::sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRequest request)
|
||||
{
|
||||
if (gAgentID.isNull())
|
||||
{
|
||||
@@ -3076,7 +3077,7 @@ void LLAgent::sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimReque
|
||||
msg->addUUIDFast(_PREHASH_AgentID, getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
|
||||
|
||||
for (S32 i = 0; i < anim_ids.count(); i++)
|
||||
for (U32 i = 0; i < anim_ids.size(); i++)
|
||||
{
|
||||
if (anim_ids[i].isNull())
|
||||
{
|
||||
@@ -3118,6 +3119,55 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
|
||||
sendReliableMessage();
|
||||
}
|
||||
|
||||
// Send a message to the region to stop the NULL animation state
|
||||
// This will reset animation state overrides for the agent.
|
||||
void LLAgent::sendAnimationStateReset()
|
||||
{
|
||||
if (gAgentID.isNull() || !mRegionp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_AgentAnimation);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
|
||||
|
||||
msg->nextBlockFast(_PREHASH_AnimationList);
|
||||
msg->addUUIDFast(_PREHASH_AnimID, LLUUID::null );
|
||||
msg->addBOOLFast(_PREHASH_StartAnim, FALSE);
|
||||
|
||||
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
|
||||
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
|
||||
sendReliableMessage();
|
||||
}
|
||||
|
||||
|
||||
// Send a message to the region to revoke sepecified permissions on ALL scripts in the region
|
||||
// If the target is an object in the region, permissions in scripts on that object are cleared.
|
||||
// If it is the region ID, all scripts clear the permissions for this agent
|
||||
void LLAgent::sendRevokePermissions(const LLUUID & target, U32 permissions)
|
||||
{
|
||||
// Currently only the bits for SCRIPT_PERMISSION_TRIGGER_ANIMATION and SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS
|
||||
// are supported by the server. Sending any other bits will cause the message to be dropped without changing permissions
|
||||
|
||||
if (gAgentID.notNull() && gMessageSystem)
|
||||
{
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_RevokePermissions);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, getID()); // Must be our ID
|
||||
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
|
||||
|
||||
msg->nextBlockFast(_PREHASH_Data);
|
||||
msg->addUUIDFast(_PREHASH_ObjectID, target); // Must be in the region
|
||||
msg->addU32Fast(_PREHASH_ObjectPermissions, permissions);
|
||||
|
||||
sendReliableMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i
|
||||
void LLAgent::setAlwaysRun()
|
||||
{
|
||||
@@ -4338,6 +4388,8 @@ void LLAgent::stopCurrentAnimations()
|
||||
// avatar, propagating this change back to the server.
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
std::vector<LLUUID> anim_ids;
|
||||
|
||||
for ( LLVOAvatar::AnimIterator anim_it =
|
||||
gAgentAvatarp->mPlayingAnimations.begin();
|
||||
anim_it != gAgentAvatarp->mPlayingAnimations.end();
|
||||
@@ -4355,7 +4407,24 @@ void LLAgent::stopCurrentAnimations()
|
||||
// stop this animation locally
|
||||
gAgentAvatarp->stopMotion(anim_it->first, TRUE);
|
||||
// ...and tell the server to tell everyone.
|
||||
sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
|
||||
anim_ids.push_back(anim_it->first);
|
||||
}
|
||||
}
|
||||
|
||||
sendAnimationRequests(anim_ids, ANIM_REQUEST_STOP);
|
||||
|
||||
// Tell the region to clear any animation state overrides
|
||||
sendAnimationStateReset();
|
||||
|
||||
// Revoke all animation permissions
|
||||
if (mRegionp &&
|
||||
gSavedSettings.getBOOL("RevokePermsOnStopAnimation"))
|
||||
{
|
||||
U32 permissions = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS];
|
||||
sendRevokePermissions(mRegionp->getRegionID(), permissions);
|
||||
if (gAgentAvatarp->isSitting())
|
||||
{ // Also stand up, since auto-granted sit animation permission has been revoked
|
||||
gAgent.standUp();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -464,8 +464,11 @@ public:
|
||||
void stopCurrentAnimations();
|
||||
void requestStopMotion(LLMotion* motion);
|
||||
void onAnimStop(const LLUUID& id);
|
||||
void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request);
|
||||
void sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRequest request);
|
||||
void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request);
|
||||
void sendAnimationStateReset();
|
||||
void sendRevokePermissions(const LLUUID & target, U32 permissions);
|
||||
|
||||
void endAnimationUpdateUI();
|
||||
void unpauseAnimation() { mPauseRequest = NULL; }
|
||||
BOOL getCustomAnim() const { return mCustomAnim; }
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
|
||||
#include "llappviewerwin32.h"
|
||||
|
||||
#include "llwindowwin32.cpp" // *FIX: for setting gIconResource.
|
||||
#include "llwindowwin32.h" // *FIX: for setting gIconResource.
|
||||
#include "llgl.h"
|
||||
#include "res/resource.h" // *FIX: for setting gIconResource.
|
||||
|
||||
#include <fcntl.h> //_O_APPEND
|
||||
@@ -52,6 +53,11 @@
|
||||
#include "llviewercontrol.h"
|
||||
#include "lldxhardware.h"
|
||||
|
||||
#include "nvapi/nvapi.h"
|
||||
#include "nvapi/NvApiDriverSettings.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "llweb.h"
|
||||
#include "llsecondlifeurls.h"
|
||||
|
||||
@@ -79,6 +85,19 @@ extern "C" {
|
||||
|
||||
const std::string LLAppViewerWin32::sWindowClass = "Second Life";
|
||||
|
||||
/*
|
||||
This function is used to print to the command line a text message
|
||||
describing the nvapi error and quits
|
||||
*/
|
||||
void nvapi_error(NvAPI_Status status)
|
||||
{
|
||||
NvAPI_ShortString szDesc = {0};
|
||||
NvAPI_GetErrorMessage(status, szDesc);
|
||||
llwarns << szDesc << llendl;
|
||||
|
||||
//should always trigger when asserts are enabled
|
||||
//llassert(status == NVAPI_OK);
|
||||
}
|
||||
|
||||
// Create app mutex creates a unique global windows object.
|
||||
// If the object can be created it returns true, otherwise
|
||||
@@ -101,6 +120,79 @@ bool create_app_mutex()
|
||||
return result;
|
||||
}
|
||||
|
||||
void ll_nvapi_init(NvDRSSessionHandle hSession)
|
||||
{
|
||||
// (2) load all the system settings into the session
|
||||
NvAPI_Status status = NvAPI_DRS_LoadSettings(hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
NvAPI_UnicodeString profile_name;
|
||||
//std::string app_name = LLTrans::getString("APP_NAME");
|
||||
std::string app_name("Second Life"); // <alchemy/>
|
||||
llutf16string w_app_name = utf8str_to_utf16str(app_name);
|
||||
wsprintf(profile_name, L"%s", w_app_name.c_str());
|
||||
status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
// (3) Obtain the current profile.
|
||||
NvDRSProfileHandle hProfile = 0;
|
||||
status = NvAPI_DRS_GetCurrentGlobalProfile(hSession, &hProfile);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
// load settings for querying
|
||||
status = NvAPI_DRS_LoadSettings(hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
//get the preferred power management mode for Second Life
|
||||
NVDRS_SETTING drsSetting = {0};
|
||||
drsSetting.version = NVDRS_SETTING_VER;
|
||||
status = NvAPI_DRS_GetSetting(hSession, hProfile, PREFERRED_PSTATE_ID, &drsSetting);
|
||||
if (status == NVAPI_SETTING_NOT_FOUND)
|
||||
{ //only override if the user hasn't specifically set this setting
|
||||
// (4) Specify that we want the VSYNC disabled setting
|
||||
// first we fill the NVDRS_SETTING struct, then we call the function
|
||||
drsSetting.version = NVDRS_SETTING_VER;
|
||||
drsSetting.settingId = PREFERRED_PSTATE_ID;
|
||||
drsSetting.settingType = NVDRS_DWORD_TYPE;
|
||||
drsSetting.u32CurrentValue = PREFERRED_PSTATE_PREFER_MAX;
|
||||
status = NvAPI_DRS_SetSetting(hSession, hProfile, &drsSetting);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
// (5) Now we apply (or save) our changes to the system
|
||||
status = NvAPI_DRS_SaveSettings(hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//#define DEBUGGING_SEH_FILTER 1
|
||||
#if DEBUGGING_SEH_FILTER
|
||||
# define WINMAIN DebuggingWinMain
|
||||
@@ -157,6 +249,27 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
NvAPI_Status status;
|
||||
|
||||
// Initialize NVAPI
|
||||
status = NvAPI_Initialize();
|
||||
NvDRSSessionHandle hSession = 0;
|
||||
|
||||
if (status == NVAPI_OK)
|
||||
{
|
||||
// Create the session handle to access driver settings
|
||||
status = NvAPI_DRS_CreateSession(&hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
}
|
||||
else
|
||||
{
|
||||
//override driver setting as needed
|
||||
ll_nvapi_init(hSession);
|
||||
}
|
||||
}
|
||||
|
||||
// Have to wait until after logging is initialized to display LFH info
|
||||
if (num_heaps > 0)
|
||||
{
|
||||
@@ -224,6 +337,15 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
|
||||
LLAppViewer::sUpdaterInfo = NULL ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// (NVAPI) (6) We clean up. This is analogous to doing a free()
|
||||
if (hSession)
|
||||
{
|
||||
NvAPI_DRS_DestroySession(hSession);
|
||||
hSession = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -626,6 +626,10 @@ void LLFeatureManager::applyBaseMasks()
|
||||
{
|
||||
maskFeatures("GeForceFX");
|
||||
}
|
||||
if (gGLManager.mIsIntel && gGLManager.mGLVersion<3.0f)
|
||||
{
|
||||
maskFeatures("IntelPre30");
|
||||
}
|
||||
if (gGLManager.mIsIntel)
|
||||
{
|
||||
maskFeatures("Intel");
|
||||
|
||||
@@ -725,6 +725,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
|
||||
static LLCullResult result;
|
||||
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
|
||||
LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
|
||||
gPipeline.updateCull(*LLViewerCamera::getInstance(), result, water_clip);
|
||||
stop_glerror();
|
||||
|
||||
@@ -949,7 +950,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
{
|
||||
gGL.setColorMask(true, true);
|
||||
|
||||
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
|
||||
if (LLPipeline::sRenderDeferred)
|
||||
{
|
||||
gPipeline.mDeferredScreen.bindTarget();
|
||||
glClearColor(1,0,1,1);
|
||||
@@ -1035,7 +1036,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
}
|
||||
|
||||
gGL.setColorMask(true, false);
|
||||
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
|
||||
if (LLPipeline::sRenderDeferred)
|
||||
{
|
||||
gPipeline.renderGeomDeferred(*LLViewerCamera::getInstance());
|
||||
}
|
||||
@@ -1071,7 +1072,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
|
||||
if (to_texture)
|
||||
{
|
||||
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
|
||||
if (LLPipeline::sRenderDeferred)
|
||||
{
|
||||
gPipeline.mDeferredScreen.flush();
|
||||
if(gPipeline.mDeferredScreen.getFBO())
|
||||
@@ -1098,7 +1099,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
}
|
||||
//gGL.flush();
|
||||
|
||||
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
|
||||
if (LLPipeline::sRenderDeferred)
|
||||
{
|
||||
gPipeline.renderDeferredLighting();
|
||||
}
|
||||
|
||||
@@ -4150,6 +4150,7 @@ void reset_view_final( BOOL proceed )
|
||||
}
|
||||
gAgentCamera.resetView(TRUE, TRUE);
|
||||
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
|
||||
gSavedSettings.setBOOL("SinguMotionResetsCamera", true);
|
||||
|
||||
if(gAgentCamera.cameraCustomizeAvatar() && LLFloaterCustomize::instanceExists())
|
||||
LLFloaterCustomize::getInstance()->close();
|
||||
|
||||
@@ -1219,6 +1219,12 @@ S32 LLViewerTextureList::getMinVideoRamSetting()
|
||||
// Returns max setting for TextureMemory (in MB)
|
||||
S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended)
|
||||
{
|
||||
#if LL_LINUX
|
||||
if (gGLManager.mIsIntel && gGLManager.mGLVersion >= 3.f && !gGLManager.mVRAM)
|
||||
{
|
||||
gGLManager.mVRAM = 512;
|
||||
}
|
||||
#endif
|
||||
S32 max_texmem;
|
||||
if (gGLManager.mVRAM != 0)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "llaudioengine.h" // mute on minimize
|
||||
#include "llassetstorage.h"
|
||||
#include "llfontgl.h"
|
||||
#include "llfontfreetype.h"
|
||||
#include "llmousehandler.h"
|
||||
#include "llrect.h"
|
||||
#include "llsky.h"
|
||||
@@ -2798,7 +2799,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
|
||||
case KEY_RIGHT:
|
||||
case KEY_UP:
|
||||
case KEY_DOWN:
|
||||
if (mask & MASK_CONTROL)
|
||||
if (mask == MASK_CONTROL)
|
||||
break;
|
||||
case KEY_PAGE_UP:
|
||||
case KEY_PAGE_DOWN:
|
||||
@@ -4231,7 +4232,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
|
||||
LLVector3 probe_point_region;
|
||||
|
||||
// walk forwards to find the point
|
||||
for (mouse_dir_scale = FIRST_PASS_STEP; mouse_dir_scale < gAgentCamera.mDrawDistance; mouse_dir_scale += FIRST_PASS_STEP)
|
||||
for (mouse_dir_scale = FIRST_PASS_STEP; mouse_dir_scale < gAgentCamera.mDrawDistance * 4; mouse_dir_scale += FIRST_PASS_STEP)
|
||||
{
|
||||
LLVector3d mouse_direction_global_d;
|
||||
mouse_direction_global_d.setVec(mouse_direction_global * mouse_dir_scale);
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
#include "aifile.h"
|
||||
|
||||
#include "llavatarname.h"
|
||||
#include "../lscript/lscript_byteformat.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
@@ -6606,14 +6607,8 @@ void LLVOAvatar::getOffObject()
|
||||
|
||||
if (sit_object && !sit_object->permYouOwner() && gSavedSettings.getBOOL("RevokePermsOnStandUp"))
|
||||
{
|
||||
gMessageSystem->newMessageFast(_PREHASH_RevokePermissions);
|
||||
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
gMessageSystem->nextBlockFast(_PREHASH_Data);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_ObjectID, sit_object->getID());
|
||||
gMessageSystem->addU32Fast(_PREHASH_ObjectPermissions, 0xFFFFFFFF);
|
||||
gAgent.sendReliableMessage();
|
||||
U32 permissions = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS];
|
||||
gAgent.sendRevokePermissions(sit_object->getID(), permissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,8,4,5433
|
||||
PRODUCTVERSION 1,8,4,5433
|
||||
FILEVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD}
|
||||
PRODUCTVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD}
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -156,12 +156,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Siana Gearz"
|
||||
VALUE "FileDescription", "Singularity Viewer"
|
||||
VALUE "FileVersion", "1.8.4.5433"
|
||||
VALUE "FileVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"
|
||||
VALUE "InternalName", "Second Life"
|
||||
VALUE "LegalCopyright", "Copyright © 2001-2010, Linden Research, Inc., Copyright 2010 Siana Gearz"
|
||||
VALUE "OriginalFilename", "SingularityViewer.exe"
|
||||
VALUE "ProductName", "Singularity Viewer"
|
||||
VALUE "ProductVersion", "1.8.4.5433"
|
||||
VALUE "ProductVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
@@ -138,8 +138,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,8,4,5433
|
||||
PRODUCTVERSION 1,8,4,5433
|
||||
FILEVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD}
|
||||
PRODUCTVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD}
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -156,12 +156,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Siana Gearz"
|
||||
VALUE "FileDescription", "Singularity Viewer"
|
||||
VALUE "FileVersion", "1.8.4.5433"
|
||||
VALUE "FileVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"
|
||||
VALUE "InternalName", "Second Life"
|
||||
VALUE "LegalCopyright", "Copyright © 2001-2010, Linden Research, Inc., Copyright 2010 Siana Gearz"
|
||||
VALUE "OriginalFilename", "SingularityViewer.exe"
|
||||
VALUE "ProductName", "Singularity Viewer"
|
||||
VALUE "ProductVersion", "1.8.4.5433"
|
||||
VALUE "ProductVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
@@ -139,10 +139,7 @@ class ViewerManifest(LLManifest):
|
||||
def viewer_branding_id(self):
|
||||
return self.args['branding_id']
|
||||
def installer_prefix(self):
|
||||
mapping={"secondlife":'SecondLife_',
|
||||
"snowglobe":'Snowglobe_',
|
||||
"singularity":'Singularity_'}
|
||||
return mapping[self.viewer_branding_id()]
|
||||
return self.channel_oneword() + "_"
|
||||
|
||||
def flags_list(self):
|
||||
""" Convenience function that returns the command-line flags
|
||||
@@ -496,8 +493,6 @@ class DarwinManifest(ViewerManifest):
|
||||
self.path(self.args['configuration'] + "/" + self.app_name() + ".app", dst="")
|
||||
|
||||
if self.prefix(src="", dst="Contents"): # everything goes in Contents
|
||||
self.path(self.info_plist_name(), dst="Info.plist")
|
||||
|
||||
# copy additional libs in <bundle>/Contents/MacOS/
|
||||
self.path("../../libraries/universal-darwin/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib")
|
||||
self.path("../../libraries/universal-darwin/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib")
|
||||
@@ -618,10 +613,7 @@ class DarwinManifest(ViewerManifest):
|
||||
{ 'viewer_binary' : self.dst_path_of('Contents/MacOS/'+self.app_name())})
|
||||
|
||||
def app_name(self):
|
||||
return "Singularity"
|
||||
|
||||
def info_plist_name(self):
|
||||
return "Info-Singularity.plist"
|
||||
return self.channel_oneword()
|
||||
|
||||
def package_finish(self):
|
||||
channel_standin = self.app_name()
|
||||
@@ -715,7 +707,11 @@ class DarwinManifest(ViewerManifest):
|
||||
|
||||
class LinuxManifest(ViewerManifest):
|
||||
def construct(self):
|
||||
import shutil
|
||||
shutil.rmtree("./packaged/app_settings/shaders", ignore_errors=True);
|
||||
|
||||
super(LinuxManifest, self).construct()
|
||||
|
||||
self.path("licenses-linux.txt","licenses.txt")
|
||||
|
||||
self.path("res/"+self.icon_name(),self.icon_name())
|
||||
@@ -802,12 +798,11 @@ class LinuxManifest(ViewerManifest):
|
||||
try:
|
||||
# --numeric-owner hides the username of the builder for
|
||||
# security etc.
|
||||
# I'm leaving this disabled for speed
|
||||
#self.run_command("tar -C '%(dir)s' --numeric-owner -cjf "
|
||||
# "'%(inst_path)s.tar.bz2' %(inst_name)s" % {
|
||||
# 'dir': self.get_build_prefix(),
|
||||
# 'inst_name': installer_name,
|
||||
# 'inst_path':self.build_path_of(installer_name)})
|
||||
self.run_command("tar -C '%(dir)s' --numeric-owner -cjf "
|
||||
"'%(inst_path)s.tar.bz2' %(inst_name)s" % {
|
||||
'dir': self.get_build_prefix(),
|
||||
'inst_name': installer_name,
|
||||
'inst_path':self.build_path_of(installer_name)})
|
||||
print ''
|
||||
finally:
|
||||
self.run_command("mv '%(inst)s' '%(dst)s'" % {
|
||||
|
||||
31
install.xml
31
install.xml
@@ -1061,6 +1061,32 @@
|
||||
</map>
|
||||
</map>
|
||||
</map>
|
||||
<key>nvapi</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
<string>Copyright (C) NVIDIA</string>
|
||||
<key>description</key>
|
||||
<string>NVAPI is the library suite to access nvidia profiles and performance options on windows</string>
|
||||
<key>license</key>
|
||||
<string>NVAPI</string>
|
||||
<key>packages</key>
|
||||
<map>
|
||||
<key>windows</key>
|
||||
<map>
|
||||
<key>md5sum</key>
|
||||
<string>99d1b70c1305257d521edfbd34587187</string>
|
||||
<key>url</key>
|
||||
<uri>https://bitbucket.org/SingularityViewer/libraries/downloads/nvapi-304-windows-20121116-singu.tar.bz2</uri>
|
||||
</map>
|
||||
<key>windows64</key>
|
||||
<map>
|
||||
<key>md5sum</key>
|
||||
<string>5578017f13783fb7279dd39537d1e0fd</string>
|
||||
<key>url</key>
|
||||
<uri>https://bitbucket.org/SingularityViewer/libraries/downloads/nvapi-304-windows64-20131116-singu.tar.bz2</uri>
|
||||
</map>
|
||||
</map>
|
||||
</map>
|
||||
<key>ndofdev</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
@@ -1873,6 +1899,11 @@ Cass Everitt - cass@r3.nu
|
||||
<key>text</key>
|
||||
<string>http://www.jclark.com/xml/copying.txt</string>
|
||||
</map>
|
||||
<key>NVAPI</key>
|
||||
<map>
|
||||
<key>url</key>
|
||||
<string>Licenes dir</string>
|
||||
</map>
|
||||
<key>ogg-vorbis</key>
|
||||
<map>
|
||||
<key>url</key>
|
||||
|
||||
@@ -835,10 +835,10 @@ def _default_installable_cache():
|
||||
"""In general, the installable files do not change much, so find a
|
||||
host/user specific location to cache files."""
|
||||
user = _getuser()
|
||||
cache_dir = "/var/tmp/%s/install.cache" % user
|
||||
cache_dir = "/var/tmp/%s/sg.install.cache" % user
|
||||
if _get_platform() == 'windows':
|
||||
cache_dir = os.path.join(tempfile.gettempdir(), \
|
||||
'install.cache.%s' % user)
|
||||
'sg.install.cache.%s' % user)
|
||||
return cache_dir
|
||||
|
||||
def parse_args():
|
||||
|
||||
@@ -173,10 +173,10 @@ def _default_installable_cache():
|
||||
"""In general, the installable files do not change much, so find a
|
||||
host/user specific location to cache files."""
|
||||
user = _getuser()
|
||||
cache_dir = "/var/tmp/%s/install.cache" % user
|
||||
cache_dir = "/var/tmp/%s/sg.install.cache" % user
|
||||
if _get_platform() == 'windows':
|
||||
cache_dir = os.path.join(tempfile.gettempdir(), \
|
||||
'install.cache.%s' % user)
|
||||
'sg.install.cache.%s' % user)
|
||||
return cache_dir
|
||||
|
||||
# For status messages (e.g. "Loading..."). May come in handy if
|
||||
|
||||
Reference in New Issue
Block a user