Merge Firestorm LGPL
commit
2441b2b5c5
|
|
@ -1355,9 +1355,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>a9da03b9504bc66b01e280dc333ea028</string>
|
||||
<string>e5a811fa7c9e5641869b58cd58a3e1c6</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/kdu-7.7.1-darwin-201511221818-r45.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/kdu-7.8.0-darwin-201604022336-r52.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin</string>
|
||||
|
|
@ -1367,9 +1367,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>1908353572e3e5440a806f278362beeb</string>
|
||||
<string>06e6ada281c0cf37ced1aad58c3e9bb4</string>
|
||||
<key>url</key>
|
||||
<string>file:///opt/firestorm/kdu-7.7.1-linux-201511221817-r45.tar.bz2</string>
|
||||
<string>file:///opt/firestorm/kdu-7.8.0-linux-201604022334-r52.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -1379,9 +1379,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>1736649d2603a096b2878de22a993216</string>
|
||||
<string>15da99a3c7dbe2b56a19baced0f9bd54</string>
|
||||
<key>url</key>
|
||||
<string>file:///c:/cygwin/opt/firestorm/kdu-7.7.1-windows-201511221729-r45.tar.bz2</string>
|
||||
<string>file:///c:/cygwin/opt/firestorm/kdu-7.8.0-windows-201604022251-r52.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
|
|||
|
|
@ -83,36 +83,36 @@ struct LLCalcParser : grammar<LLCalcParser>
|
|||
;
|
||||
|
||||
unary_func =
|
||||
((str_p("SIN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_sin)(self,arg1)]) |
|
||||
(str_p("COS") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_cos)(self,arg1)]) |
|
||||
(str_p("TAN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_tan)(self,arg1)]) |
|
||||
(str_p("ASIN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_asin)(self,arg1)]) |
|
||||
(str_p("ACOS") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_acos)(self,arg1)]) |
|
||||
(str_p("ATAN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_atan)(self,arg1)]) |
|
||||
((str_p("SIN") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_sin)(self,arg1)]) |
|
||||
(str_p("COS") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_cos)(self,arg1)]) |
|
||||
(str_p("TAN") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_tan)(self,arg1)]) |
|
||||
(str_p("ASIN") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_asin)(self,arg1)]) |
|
||||
(str_p("ACOS") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_acos)(self,arg1)]) |
|
||||
(str_p("ATAN") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_atan)(self,arg1)]) |
|
||||
// <FS:Ansariel> FIRE-14618: Provide radian-based functions
|
||||
(str_p("SINR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_sinr)(self,arg1)]) |
|
||||
(str_p("COSR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_cosr)(self,arg1)]) |
|
||||
(str_p("TANR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_tanr)(self,arg1)]) |
|
||||
(str_p("ASINR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_asinr)(self,arg1)]) |
|
||||
(str_p("ACOSR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_acosr)(self,arg1)]) |
|
||||
(str_p("ATANR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_atanr)(self,arg1)]) |
|
||||
(str_p("SINR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_sinr)(self,arg1)]) |
|
||||
(str_p("COSR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_cosr)(self,arg1)]) |
|
||||
(str_p("TANR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_tanr)(self,arg1)]) |
|
||||
(str_p("ASINR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_asinr)(self,arg1)]) |
|
||||
(str_p("ACOSR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_acosr)(self,arg1)]) |
|
||||
(str_p("ATANR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_atanr)(self,arg1)]) |
|
||||
// </FS:Ansariel>
|
||||
(str_p("SQRT") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_sqrt)(self,arg1)]) |
|
||||
(str_p("LOG") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_log)(self,arg1)]) |
|
||||
(str_p("EXP") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_exp)(self,arg1)]) |
|
||||
(str_p("ABS") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_fabs)(self,arg1)]) |
|
||||
(str_p("FLR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_floor)(self,arg1)]) |
|
||||
(str_p("CEIL") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_ceil)(self,arg1)])
|
||||
(str_p("SQRT") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_sqrt)(self,arg1)]) |
|
||||
(str_p("LOG") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_log)(self,arg1)]) |
|
||||
(str_p("EXP") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_exp)(self,arg1)]) |
|
||||
(str_p("ABS") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_fabs)(self,arg1)]) |
|
||||
(str_p("FLR") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_floor)(self,arg1)]) |
|
||||
(str_p("CEIL") >> '(' >> expression[unary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_ceil)(self,arg1)])
|
||||
) >> assert_syntax(ch_p(')'))
|
||||
;
|
||||
|
||||
binary_func =
|
||||
((str_p("ATAN2") >> '(' >> expression[binary_func.value = arg1] >> ',' >>
|
||||
expression[binary_func.value = bind(&LLCalcParser::_atan2)(self, binary_func.value, arg1)]) |
|
||||
expression[binary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_atan2)(self, binary_func.value, arg1)]) |
|
||||
(str_p("MIN") >> '(' >> expression[binary_func.value = arg1] >> ',' >>
|
||||
expression[binary_func.value = bind(&LLCalcParser::_min)(self, binary_func.value, arg1)]) |
|
||||
expression[binary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_min)(self, binary_func.value, arg1)]) |
|
||||
(str_p("MAX") >> '(' >> expression[binary_func.value = arg1] >> ',' >>
|
||||
expression[binary_func.value = bind(&LLCalcParser::_max)(self, binary_func.value, arg1)])
|
||||
expression[binary_func.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::_max)(self, binary_func.value, arg1)])
|
||||
) >> assert_syntax(ch_p(')'))
|
||||
;
|
||||
|
||||
|
|
@ -128,10 +128,10 @@ struct LLCalcParser : grammar<LLCalcParser>
|
|||
// Lookup throws an Unknown Symbol error if it is unknown, while this works fine,
|
||||
// would be "neater" to handle symbol lookup from here with an assertive parser.
|
||||
// constants_p[factor.value = arg1]|
|
||||
identifier[factor.value = bind(&LLCalcParser::lookup)(self, arg1, arg2)]
|
||||
identifier[factor.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::lookup)(self, arg1, arg2)]
|
||||
) >>
|
||||
// Detect and throw math errors.
|
||||
assert_domain(eps_p(bind(&LLCalcParser::checkNaN)(self, factor.value)))
|
||||
assert_domain(eps_p(/*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&LLCalcParser::checkNaN)(self, factor.value)))
|
||||
;
|
||||
|
||||
unary_expr =
|
||||
|
|
@ -141,14 +141,14 @@ struct LLCalcParser : grammar<LLCalcParser>
|
|||
|
||||
power =
|
||||
unary_expr[power.value = arg1] >>
|
||||
*('^' >> assert_syntax(unary_expr[power.value = bind(&powf)(power.value, arg1)]))
|
||||
*('^' >> assert_syntax(unary_expr[power.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&powf)(power.value, arg1)]))
|
||||
;
|
||||
|
||||
term =
|
||||
power[term.value = arg1] >>
|
||||
*(('*' >> assert_syntax(power[term.value *= arg1])) |
|
||||
('/' >> assert_syntax(power[term.value /= arg1])) |
|
||||
('%' >> assert_syntax(power[term.value = bind(&fmodf)(term.value, arg1)]))
|
||||
('%' >> assert_syntax(power[term.value = /*<FS:ND/> Replace bind with phoenix::bind to make GCC happy*/ phoenix::bind(&fmodf)(term.value, arg1)]))
|
||||
)
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,14 @@ U32 wpo2(U32 i);
|
|||
|
||||
U32 LLImageGL::sUniqueCount = 0;
|
||||
U32 LLImageGL::sBindCount = 0;
|
||||
S32Bytes LLImageGL::sGlobalTextureMemory(0);
|
||||
S32Bytes LLImageGL::sBoundTextureMemory(0);
|
||||
S32Bytes LLImageGL::sCurBoundTextureMemory(0);
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//S32Bytes LLImageGL::sGlobalTextureMemory(0);
|
||||
//S32Bytes LLImageGL::sBoundTextureMemory(0);
|
||||
//S32Bytes LLImageGL::sCurBoundTextureMemory(0);
|
||||
S64Bytes LLImageGL::sGlobalTextureMemory(0);
|
||||
S64Bytes LLImageGL::sBoundTextureMemory(0);
|
||||
S64Bytes LLImageGL::sCurBoundTextureMemory(0);
|
||||
// </FS:Ansariel>
|
||||
S32 LLImageGL::sCount = 0;
|
||||
|
||||
BOOL LLImageGL::sGlobalUseAnisotropic = FALSE;
|
||||
|
|
@ -251,7 +256,10 @@ void LLImageGL::updateStats(F32 current_time)
|
|||
}
|
||||
|
||||
//static
|
||||
S32 LLImageGL::updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category)
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//S32 LLImageGL::updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category)
|
||||
S64 LLImageGL::updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
LLImageGL::sCurBoundTextureMemory += mem ;
|
||||
return LLImageGL::sCurBoundTextureMemory.value();
|
||||
|
|
|
|||
|
|
@ -69,7 +69,10 @@ public:
|
|||
static void dirtyTexOptions();
|
||||
|
||||
// Sometimes called externally for textures not using LLImageGL (should go away...)
|
||||
static S32 updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category) ;
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//static S32 updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category) ;
|
||||
static S64 updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category) ;
|
||||
// </FS:Ansariel>
|
||||
|
||||
static bool checkSize(S32 width, S32 height);
|
||||
|
||||
|
|
@ -242,9 +245,14 @@ public:
|
|||
static F32 sLastFrameTime;
|
||||
|
||||
// Global memory statistics
|
||||
static S32Bytes sGlobalTextureMemory; // Tracks main memory texmem
|
||||
static S32Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame
|
||||
static S32Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//static S32Bytes sGlobalTextureMemory; // Tracks main memory texmem
|
||||
//static S32Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame
|
||||
//static S32Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame
|
||||
static S64Bytes sGlobalTextureMemory; // Tracks main memory texmem
|
||||
static S64Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame
|
||||
static S64Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame
|
||||
// </FS:Ansariel>
|
||||
static U32 sBindCount; // Tracks number of texture binds for current frame
|
||||
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame
|
||||
static BOOL sGlobalUseAnisotropic;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
FSLSLBridge();
|
||||
~FSLSLBridge();
|
||||
|
||||
typedef void (*tCallback)( LLSD const& );
|
||||
typedef boost::function<void(const LLSD &)> tCallback;
|
||||
|
||||
bool lslToViewer(const std::string& message, const LLUUID& fromID, const LLUUID& ownerID);
|
||||
bool viewerToLSL(const std::string& message, tCallback = NULL );
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -32,9 +32,6 @@
|
|||
#include "llcallbacklist.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llsdutil.h"
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
#include "llviewercontrol.h"
|
||||
// [/SL:KB]
|
||||
#include "llviewerregion.h"
|
||||
#include "llinventoryobserver.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
|
@ -49,11 +46,25 @@ const std::string AISAPI::LIBRARY_CAP_NAME("LibraryAPIv3");
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
/*static*/
|
||||
bool AISAPI::isAvailable()
|
||||
//bool AISAPI::isAvailable()
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
bool AISAPI::isAvailable(EAISCommand cmd)
|
||||
// [/SL:KB]
|
||||
{
|
||||
if (gAgent.getRegion())
|
||||
// <FS:Ansariel> Add AIS3 debug setting
|
||||
//if (gAgent.getRegion())
|
||||
if (gAgent.getRegion() && gSavedSettings.getBOOL("FSUseAis3Api"))
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
return gAgent.getRegion()->isCapabilityAvailable(INVENTORY_CAP_NAME);
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
static LLCachedControl<U32> COMMAND_FILTER_MASK(gSavedSettings, "AISCommandFilterMask", U32_MAX);
|
||||
|
||||
bool aisAvailable = gAgent.getRegion()->isCapabilityAvailable(INVENTORY_CAP_NAME);
|
||||
return
|
||||
(aisAvailable) &&
|
||||
( (CMD_UNKNOWN == cmd) || ((U32)cmd & COMMAND_FILTER_MASK) );
|
||||
// [/SL:KB]
|
||||
//return gAgent.getRegion()->isCapabilityAvailable(INVENTORY_CAP_NAME);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -411,7 +422,18 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
|
|||
{
|
||||
id = result["category_id"];
|
||||
}
|
||||
|
||||
// <FS:Ansariel> - Patch: Appearance-SyncAttach
|
||||
else if (type == COPYINVENTORY)
|
||||
{
|
||||
uuid_list_t ids;
|
||||
AISUpdate::parseUUIDArray(result, "_created_items", ids);
|
||||
AISUpdate::parseUUIDArray(result, "_created_categories", ids);
|
||||
if (!ids.empty())
|
||||
{
|
||||
id = *ids.begin();
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
callback(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,23 @@ class AISAPI
|
|||
public:
|
||||
typedef boost::function<void(const LLUUID &invItem)> completion_t;
|
||||
|
||||
static bool isAvailable();
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
// The debug setting is an OR of these values
|
||||
enum EAISCommand
|
||||
{
|
||||
CMD_UNKNOWN = 0x0000, // New or command we're not filtering for
|
||||
CMD_CAT_UPDATE = 0x0001, // update_inventory_category
|
||||
CMD_CAT_REMOVE = 0x0002, // remove_inventory_category
|
||||
CMD_CAT_SLAM = 0x0004, // slam_inventory_folder
|
||||
CMD_CAT_PURGE = 0x0008, // purge_descendents_of
|
||||
CMD_ITEM_REMOVE = 0x0010, // remove_inventory_item
|
||||
CMD_ITEM_UPDATE = 0x0020, // update_inventory_item
|
||||
CMD_OBJ_LINK = 0x0100, // link_inventory_array
|
||||
CMD_OBJ_LINKBATCH = 0x0200, // link_inventory_array
|
||||
};
|
||||
static bool isAvailable(EAISCommand cmd = CMD_UNKNOWN);
|
||||
// [/SL:KB]
|
||||
//static bool isAvailable();
|
||||
static void getCapNames(LLSD& capNames);
|
||||
|
||||
static void CreateInventory(const LLUUID& parentId, const LLSD& newInventory, completion_t callback = completion_t());
|
||||
|
|
|
|||
|
|
@ -1682,34 +1682,6 @@ void LLModelPreview::rebuildUploadData()
|
|||
}
|
||||
}
|
||||
|
||||
for (U32 lod = 0; lod < LLModel::NUM_LODS-1; lod++)
|
||||
{
|
||||
// Search for models that are not included into upload data
|
||||
// If we found any, that means something we loaded is not a sub-model.
|
||||
for (U32 model_ind = 0; model_ind < mModel[lod].size(); ++model_ind)
|
||||
{
|
||||
bool found_model = false;
|
||||
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
|
||||
{
|
||||
LLModelInstance& instance = *iter;
|
||||
if (instance.mLOD[lod] == mModel[lod][model_ind])
|
||||
{
|
||||
found_model = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found_model && mModel[lod][model_ind] && !mModel[lod][model_ind]->mSubmodelID)
|
||||
{
|
||||
if (importerDebug)
|
||||
{
|
||||
LL_INFOS() << "Model " << mModel[lod][model_ind]->mLabel << " was not used - mismatching lod models." << LL_ENDL;
|
||||
}
|
||||
setLoadState( LLModelLoader::ERROR_MATERIALS );
|
||||
mFMP->childDisable( "calculate_btn" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <FS:AW> OpenSim limits
|
||||
//F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE-0.1f)/max_scale;
|
||||
F32 region_max_prim_scale = LLWorld::getInstance()->getRegionMaxPrimScale();
|
||||
|
|
|
|||
|
|
@ -1551,7 +1551,10 @@ void LLFloaterSnapshot::saveTexture()
|
|||
}
|
||||
|
||||
// static
|
||||
BOOL LLFloaterSnapshot::saveLocal()
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//BOOL LLFloaterSnapshot::saveLocal()
|
||||
void LLFloaterSnapshot::saveLocal(boost::function<void(bool)> callback)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
LL_DEBUGS() << "saveLocal" << LL_ENDL;
|
||||
// FIXME: duplicated code
|
||||
|
|
@ -1559,16 +1562,33 @@ BOOL LLFloaterSnapshot::saveLocal()
|
|||
if (!instance)
|
||||
{
|
||||
llassert(instance != NULL);
|
||||
return FALSE;
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//return FALSE;
|
||||
if (callback)
|
||||
{
|
||||
callback(false);
|
||||
}
|
||||
return;
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
LLSnapshotLivePreview* previewp = Impl::getPreviewView(instance);
|
||||
if (!previewp)
|
||||
{
|
||||
llassert(previewp != NULL);
|
||||
return FALSE;
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//return FALSE;
|
||||
if (callback)
|
||||
{
|
||||
callback(false);
|
||||
}
|
||||
return;
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
return previewp->saveLocal();
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//return previewp->saveLocal();
|
||||
previewp->saveLocal(callback);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
|||
|
|
@ -58,7 +58,10 @@ public:
|
|||
static LLFloaterSnapshot* getInstance();
|
||||
static LLFloaterSnapshot* findInstance();
|
||||
static void saveTexture();
|
||||
static BOOL saveLocal();
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//static BOOL saveLocal();
|
||||
static void saveLocal(boost::function<void(bool)> callback);
|
||||
// </FS:Ansariel>
|
||||
static void postSave();
|
||||
static void postPanelSwitch();
|
||||
static LLPointer<LLImageFormatted> getImageData();
|
||||
|
|
|
|||
|
|
@ -879,7 +879,11 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
|
|||
}
|
||||
|
||||
// Don't allow items to be pasted directly into the COF or the inbox
|
||||
if (!isCOFFolder() && !isInboxFolder()
|
||||
// <FS:Ansariel> Enable paste for inbox; doesn't actually makes much sense,
|
||||
// but since we are not prevented from pasting via shortcut,
|
||||
// we enable it in the context menu, too.
|
||||
//if (!isCOFFolder() && !isInboxFolder()
|
||||
if (!isCOFFolder()
|
||||
// <FS:TT> Client LSL Bridge (also for #AO)
|
||||
&& !isProtectedFolder())
|
||||
// </FS:TT>
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ private:
|
|||
/*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const;
|
||||
/*virtual*/ void updateControls(const LLSD& info);
|
||||
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
void saveLocalCallback(bool success);
|
||||
|
||||
S32 mLocalFormat;
|
||||
|
||||
void onFormatComboCommit(LLUICtrl* ctrl);
|
||||
|
|
@ -135,10 +138,7 @@ LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshotLocal::getImageFormat() const
|
|||
void LLPanelSnapshotLocal::updateControls(const LLSD& info)
|
||||
{
|
||||
LLFloaterSnapshot::ESnapshotFormat fmt =
|
||||
// <FS:Ansariel> FIRE-7090: Snapshot format for disk changes when selecting snapshot to inventory or email
|
||||
(LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat");
|
||||
//(LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("FSSnapshotLocalFormat");
|
||||
// </FS:Ansariel>
|
||||
getChild<LLComboBox>("local_format_combo")->selectNthItem((S32) fmt);
|
||||
|
||||
const bool show_quality_ctrls = (fmt == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
|
||||
|
|
@ -183,22 +183,19 @@ void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl)
|
|||
LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance();
|
||||
|
||||
floater->notify(LLSD().with("set-working", true));
|
||||
BOOL saved = LLFloaterSnapshot::saveLocal();
|
||||
if (saved)
|
||||
{
|
||||
LLFloaterSnapshot::postSave();
|
||||
// <FS:Ansariel> Don't return to target selection after taking a snapshot
|
||||
//goBack();
|
||||
floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:Ansariel> Notify user if we could not save file
|
||||
LLNotificationsUtil::add("CannotSaveSnapshot");
|
||||
floater->notify(LLSD().with("set-ready", true));
|
||||
// <FS:Ansariel> Don't return to target selection after taking a snapshot
|
||||
//cancel();
|
||||
}
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//BOOL saved = LLFloaterSnapshot::saveLocal();
|
||||
//if (saved)
|
||||
//{
|
||||
// LLFloaterSnapshot::postSave();
|
||||
// floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// cancel();
|
||||
//}
|
||||
LLFloaterSnapshot::saveLocal(boost::bind(&LLPanelSnapshotLocal::saveLocalCallback, this, _1));
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Store settings at logout
|
||||
|
|
@ -209,3 +206,21 @@ LLPanelSnapshotLocal::~LLPanelSnapshotLocal()
|
|||
gSavedSettings.setS32("LastSnapshotToDiskHeight", getTypedPreviewHeight());
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
void LLPanelSnapshotLocal::saveLocalCallback(bool success)
|
||||
{
|
||||
LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance();
|
||||
|
||||
if (success)
|
||||
{
|
||||
LLFloaterSnapshot::postSave();
|
||||
floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local")));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLNotificationsUtil::add("CannotSaveSnapshot");
|
||||
floater->notify(LLSD().with("set-ready", true));
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -1092,18 +1092,41 @@ void LLSnapshotLivePreview::saveTexture()
|
|||
mDataSize = 0;
|
||||
}
|
||||
|
||||
BOOL LLSnapshotLivePreview::saveLocal()
|
||||
{
|
||||
// Update mFormattedImage if necessary
|
||||
getFormattedImage();
|
||||
|
||||
// Save the formatted image
|
||||
BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//BOOL LLSnapshotLivePreview::saveLocal()
|
||||
//{
|
||||
// // Update mFormattedImage if necessary
|
||||
// getFormattedImage();
|
||||
//
|
||||
// // Save the formatted image
|
||||
// BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
|
||||
//
|
||||
// if(success)
|
||||
// {
|
||||
// gViewerWindow->playSnapshotAnimAndSound();
|
||||
// }
|
||||
// return success;
|
||||
//}
|
||||
|
||||
void LLSnapshotLivePreview::saveLocal(boost::function<void(bool)> callback)
|
||||
{
|
||||
// Update mFormattedImage if necessary
|
||||
getFormattedImage();
|
||||
|
||||
// Save the formatted image
|
||||
gViewerWindow->saveImageNumbered(mFormattedImage, false, boost::bind(&LLSnapshotLivePreview::saveLocalCallback, this, _1, callback));
|
||||
}
|
||||
|
||||
void LLSnapshotLivePreview::saveLocalCallback(bool success, boost::function<void(bool)> callback)
|
||||
{
|
||||
if(success)
|
||||
{
|
||||
gViewerWindow->playSnapshotAnimAndSound();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
if (callback)
|
||||
{
|
||||
callback(success);
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -112,7 +112,11 @@ public:
|
|||
std::string getFilter() const { return mFilterName; }
|
||||
void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f);
|
||||
void saveTexture();
|
||||
BOOL saveLocal();
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//BOOL saveLocal();
|
||||
void saveLocal(boost::function<void(bool)> callback);
|
||||
void saveLocalCallback(bool success, boost::function<void(bool)> callback);
|
||||
// </FS:Ansariel>
|
||||
|
||||
LLPointer<LLImageFormatted> getFormattedImage();
|
||||
LLPointer<LLImageRaw> getEncodedImage();
|
||||
|
|
|
|||
|
|
@ -422,6 +422,16 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile()
|
|||
assetType = LLAssetType::AT_ANIMATION;
|
||||
filename = getFileName();
|
||||
}
|
||||
else if (exten == "ogg")
|
||||
{
|
||||
assetType = LLAssetType::AT_SOUND;
|
||||
filename = getFileName();
|
||||
}
|
||||
else if (exten == "j2k")
|
||||
{
|
||||
assetType = LLAssetType::AT_TEXTURE;
|
||||
filename = getFileName();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unknown extension
|
||||
|
|
|
|||
|
|
@ -1307,7 +1307,10 @@ void link_inventory_array(const LLUUID& category,
|
|||
#endif
|
||||
}
|
||||
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable( (baseobj_array.size() > 1) ? AISAPI::CMD_OBJ_LINKBATCH : AISAPI::CMD_OBJ_LINK ))
|
||||
// [/SL:KB]
|
||||
{
|
||||
LLSD new_inventory = LLSD::emptyMap();
|
||||
new_inventory["links"] = links;
|
||||
|
|
@ -1371,7 +1374,10 @@ void update_inventory_item(
|
|||
LLPointer<LLInventoryCallback> cb)
|
||||
{
|
||||
const LLUUID& item_id = update_item->getUUID();
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_ITEM_UPDATE))
|
||||
// [/SL:KB]
|
||||
{
|
||||
LLSD updates = update_item->asLLSD();
|
||||
// Replace asset_id and/or shadow_id with transaction_id (hash_id)
|
||||
|
|
@ -1440,7 +1446,10 @@ void update_inventory_item(
|
|||
}
|
||||
// [/SL:KB]
|
||||
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_ITEM_UPDATE))
|
||||
// [/SL:KB]
|
||||
{
|
||||
AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t();
|
||||
AISAPI::UpdateItem(item_id, updates, cr);
|
||||
|
|
@ -1499,7 +1508,10 @@ void update_inventory_category(
|
|||
LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj);
|
||||
new_cat->fromLLSD(updates);
|
||||
// FIXME - restore this once the back-end work has been done.
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_CAT_UPDATE))
|
||||
// [/SL:KB]
|
||||
{
|
||||
LLSD new_llsd = new_cat->asLLSD();
|
||||
AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t();
|
||||
|
|
@ -1565,7 +1577,10 @@ void remove_inventory_item(
|
|||
{
|
||||
const LLUUID item_id(obj->getUUID());
|
||||
LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << obj->getName() << LL_ENDL;
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_ITEM_REMOVE))
|
||||
// [/SL:KB]
|
||||
{
|
||||
AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t();
|
||||
AISAPI::RemoveItem(item_id, cr);
|
||||
|
|
@ -1641,7 +1656,10 @@ void remove_inventory_category(
|
|||
LLNotificationsUtil::add("CannotRemoveProtectedCategories");
|
||||
return;
|
||||
}
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_CAT_REMOVE))
|
||||
// [/SL:KB]
|
||||
{
|
||||
AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t();
|
||||
AISAPI::RemoveCategory(cat_id, cr);
|
||||
|
|
@ -1744,7 +1762,10 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_CAT_PURGE))
|
||||
// [/SL:KB]
|
||||
{
|
||||
AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t();
|
||||
AISAPI::PurgeDescendents(id, cr);
|
||||
|
|
@ -1954,7 +1975,10 @@ void slam_inventory_folder(const LLUUID& folder_id,
|
|||
const LLSD& contents,
|
||||
LLPointer<LLInventoryCallback> cb)
|
||||
{
|
||||
if (AISAPI::isAvailable())
|
||||
// if (AISAPI::isAvailable())
|
||||
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
|
||||
if (AISAPI::isAvailable(AISAPI::CMD_CAT_SLAM))
|
||||
// [/SL:KB]
|
||||
{
|
||||
LL_DEBUGS(LOG_INV) << "using AISv3 to slam folder, id " << folder_id
|
||||
<< " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -706,6 +706,18 @@ class LLFileCloseAllWindows : public view_listener_t
|
|||
}
|
||||
};
|
||||
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
LLPointer<LLImageFormatted> sFormattedSnapshotImage = NULL;
|
||||
void take_snapshot_to_disk_callback(bool success)
|
||||
{
|
||||
sFormattedSnapshotImage = NULL;
|
||||
if (success)
|
||||
{
|
||||
gViewerWindow->playSnapshotAnimAndSound();
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
class LLFileTakeSnapshotToDisk : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
|
|
@ -729,27 +741,49 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
|
|||
gSavedSettings.getBOOL("RenderUIInSnapshot"),
|
||||
FALSE))
|
||||
{
|
||||
gViewerWindow->playSnapshotAnimAndSound();
|
||||
LLPointer<LLImageFormatted> formatted;
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//gViewerWindow->playSnapshotAnimAndSound();
|
||||
//LLPointer<LLImageFormatted> formatted;
|
||||
//LLFloaterSnapshot::ESnapshotFormat fmt = (LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat");
|
||||
//switch (fmt)
|
||||
//{
|
||||
//case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
|
||||
// formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
|
||||
// break;
|
||||
//default:
|
||||
// LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL;
|
||||
//case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
|
||||
// formatted = new LLImagePNG;
|
||||
// break;
|
||||
//case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
|
||||
// formatted = new LLImageBMP;
|
||||
// break;
|
||||
//}
|
||||
//formatted->enableOverSize() ;
|
||||
//formatted->encode(raw, 0);
|
||||
//formatted->disableOverSize() ;
|
||||
//gViewerWindow->saveImageNumbered(formatted);
|
||||
|
||||
LLFloaterSnapshot::ESnapshotFormat fmt = (LLFloaterSnapshot::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat");
|
||||
switch (fmt)
|
||||
{
|
||||
case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
|
||||
formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
|
||||
sFormattedSnapshotImage = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
|
||||
break;
|
||||
default:
|
||||
LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL;
|
||||
case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
|
||||
formatted = new LLImagePNG;
|
||||
sFormattedSnapshotImage = new LLImagePNG;
|
||||
break;
|
||||
case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
|
||||
formatted = new LLImageBMP;
|
||||
sFormattedSnapshotImage = new LLImageBMP;
|
||||
break;
|
||||
}
|
||||
formatted->enableOverSize() ;
|
||||
formatted->encode(raw, 0);
|
||||
formatted->disableOverSize() ;
|
||||
gViewerWindow->saveImageNumbered(formatted);
|
||||
sFormattedSnapshotImage->enableOverSize() ;
|
||||
sFormattedSnapshotImage->encode(raw, 0);
|
||||
sFormattedSnapshotImage->disableOverSize() ;
|
||||
gViewerWindow->saveImageNumbered(sFormattedSnapshotImage, false, boost::bind(&take_snapshot_to_disk_callback, _1));
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,11 +95,18 @@ S32 LLViewerTexture::sAuxCount = 0;
|
|||
LLFrameTimer LLViewerTexture::sEvaluationTimer;
|
||||
F32 LLViewerTexture::sDesiredDiscardBias = 0.f;
|
||||
F32 LLViewerTexture::sDesiredDiscardScale = 1.1f;
|
||||
S32Bytes LLViewerTexture::sBoundTextureMemory;
|
||||
S32Bytes LLViewerTexture::sTotalTextureMemory;
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//S32Bytes LLViewerTexture::sBoundTextureMemory;
|
||||
//S32Bytes LLViewerTexture::sTotalTextureMemory;
|
||||
S64Bytes LLViewerTexture::sBoundTextureMemory;
|
||||
S64Bytes LLViewerTexture::sTotalTextureMemory;
|
||||
// </FS:Ansariel>
|
||||
S32Megabytes LLViewerTexture::sMaxBoundTextureMemory;
|
||||
S32Megabytes LLViewerTexture::sMaxTotalTextureMem;
|
||||
S32Bytes LLViewerTexture::sMaxDesiredTextureMem;
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//S32Bytes LLViewerTexture::sMaxDesiredTextureMem;
|
||||
S64Bytes LLViewerTexture::sMaxDesiredTextureMem;
|
||||
// </FS:Ansariel>
|
||||
S8 LLViewerTexture::sCameraMovingDiscardBias = 0;
|
||||
F32 LLViewerTexture::sCameraMovingBias = 0.0f;
|
||||
S32 LLViewerTexture::sMaxSculptRez = 128; //max sculpt image size
|
||||
|
|
@ -577,7 +584,10 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
|
|||
sTotalTextureMemory >= sMaxTotalTextureMem)
|
||||
{
|
||||
//when texture memory overflows, lower down the threshold to release the textures more aggressively.
|
||||
sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, F32Bytes(gMaxVideoRam));
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, F32Bytes(gMaxVideoRam));
|
||||
sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75, F64Bytes(gMaxVideoRam));
|
||||
// </FS:Ansariel>
|
||||
|
||||
// If we are using more texture memory than we should,
|
||||
// scale up the desired discard level
|
||||
|
|
|
|||
|
|
@ -217,11 +217,18 @@ public:
|
|||
static LLFrameTimer sEvaluationTimer;
|
||||
static F32 sDesiredDiscardBias;
|
||||
static F32 sDesiredDiscardScale;
|
||||
static S32Bytes sBoundTextureMemory;
|
||||
static S32Bytes sTotalTextureMemory;
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//static S32Bytes sBoundTextureMemory;
|
||||
//static S32Bytes sTotalTextureMemory;
|
||||
static S64Bytes sBoundTextureMemory;
|
||||
static S64Bytes sTotalTextureMemory;
|
||||
// </FS:Ansariel>
|
||||
static S32Megabytes sMaxBoundTextureMemory;
|
||||
static S32Megabytes sMaxTotalTextureMem;
|
||||
static S32Bytes sMaxDesiredTextureMem ;
|
||||
// <FS:Ansariel> Texture memory management
|
||||
//static S32Bytes sMaxDesiredTextureMem ;
|
||||
static S64Bytes sMaxDesiredTextureMem ;
|
||||
// </FS:Ansariel>
|
||||
static S8 sCameraMovingDiscardBias;
|
||||
static F32 sCameraMovingBias;
|
||||
static S32 sMaxSculptRez ;
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@
|
|||
#include "llviewerwindowlistener.h"
|
||||
#include "llpaneltopinfobar.h"
|
||||
#include "llimview.h"
|
||||
#include "llviewermenufile.h"
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c)
|
||||
#include "rlvhandler.h"
|
||||
|
|
@ -4703,13 +4704,79 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
void do_save_image(LLImageFormatted* image, const std::string& snapshot_dir, const std::string& base_name, const std::string& extension, boost::function<void(bool)> callback)
|
||||
{
|
||||
// Look for an unused file name
|
||||
std::string filepath;
|
||||
S32 i = 1;
|
||||
S32 err = 0;
|
||||
|
||||
do
|
||||
{
|
||||
filepath = snapshot_dir;
|
||||
filepath += gDirUtilp->getDirDelimiter();
|
||||
filepath += base_name;
|
||||
filepath += llformat("_%.3d",i);
|
||||
filepath += extension;
|
||||
|
||||
llstat stat_info;
|
||||
err = LLFile::stat( filepath, &stat_info );
|
||||
i++;
|
||||
}
|
||||
while( -1 != err ); // search until the file is not found (i.e., stat() gives an error).
|
||||
|
||||
LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
|
||||
|
||||
if (gSavedSettings.getBOOL("FSLogSnapshotsToLocal"))
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["FILENAME"] = filepath;
|
||||
report_to_nearby_chat(LLTrans::getString("SnapshotSavedToDisk", args));
|
||||
}
|
||||
|
||||
bool success = image->save(filepath);
|
||||
if (callback)
|
||||
{
|
||||
callback(success);
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerWindow::saveImageCallback(const std::string& filename, LLImageFormatted* image, const std::string& extension, boost::function<void(bool)> callback)
|
||||
{
|
||||
if (!filename.empty())
|
||||
{
|
||||
LLViewerWindow::sSnapshotBaseName = gDirUtilp->getBaseFileName(filename, true);
|
||||
LLViewerWindow::sSnapshotDir = gDirUtilp->getDirName(filename);
|
||||
|
||||
do_save_image(image, LLViewerWindow::sSnapshotDir, LLViewerWindow::sSnapshotBaseName, extension, callback);
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback)
|
||||
{
|
||||
callback(false);
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// Saves an image to the harddrive as "SnapshotX" where X >= 1.
|
||||
BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker)
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker)
|
||||
void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker, boost::function<void(bool)> callback)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
if (!image)
|
||||
{
|
||||
LL_WARNS() << "No image to save" << LL_ENDL;
|
||||
return FALSE;
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//return FALSE;
|
||||
if (callback)
|
||||
{
|
||||
callback(false);
|
||||
return;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
LLFilePicker::ESaveFilter pick_type;
|
||||
|
|
@ -4727,57 +4794,62 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke
|
|||
else
|
||||
pick_type = LLFilePicker::FFSAVE_ALL; // ???
|
||||
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//// Get a base file location if needed.
|
||||
//if (force_picker || !isSnapshotLocSet())
|
||||
//{
|
||||
// std::string proposed_name( sSnapshotBaseName );
|
||||
|
||||
// // getSaveFile will append an appropriate extension to the proposed name, based on the ESaveFilter constant passed in.
|
||||
|
||||
// // pick a directory in which to save
|
||||
// LLFilePicker& picker = LLFilePicker::instance();
|
||||
// if (!picker.getSaveFile(pick_type, proposed_name))
|
||||
// {
|
||||
// // Clicked cancel
|
||||
// return FALSE;
|
||||
// }
|
||||
|
||||
// // Copy the directory + file name
|
||||
// std::string filepath = picker.getFirstFile();
|
||||
|
||||
// LLViewerWindow::sSnapshotBaseName = gDirUtilp->getBaseFileName(filepath, true);
|
||||
// LLViewerWindow::sSnapshotDir = gDirUtilp->getDirName(filepath);
|
||||
//}
|
||||
|
||||
//// Look for an unused file name
|
||||
//std::string filepath;
|
||||
//S32 i = 1;
|
||||
//S32 err = 0;
|
||||
|
||||
//do
|
||||
//{
|
||||
// filepath = sSnapshotDir;
|
||||
// filepath += gDirUtilp->getDirDelimiter();
|
||||
// filepath += sSnapshotBaseName;
|
||||
// filepath += llformat("_%.3d",i);
|
||||
// filepath += extension;
|
||||
|
||||
// llstat stat_info;
|
||||
// err = LLFile::stat( filepath, &stat_info );
|
||||
// i++;
|
||||
//}
|
||||
//while( -1 != err ); // search until the file is not found (i.e., stat() gives an error).
|
||||
|
||||
//LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
|
||||
//return image->save(filepath);
|
||||
|
||||
// Get a base file location if needed.
|
||||
if (force_picker || !isSnapshotLocSet())
|
||||
{
|
||||
std::string proposed_name( sSnapshotBaseName );
|
||||
|
||||
// getSaveFile will append an appropriate extension to the proposed name, based on the ESaveFilter constant passed in.
|
||||
|
||||
// pick a directory in which to save
|
||||
LLFilePicker& picker = LLFilePicker::instance();
|
||||
if (!picker.getSaveFile(pick_type, proposed_name))
|
||||
{
|
||||
// Clicked cancel
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Copy the directory + file name
|
||||
std::string filepath = picker.getFirstFile();
|
||||
|
||||
LLViewerWindow::sSnapshotBaseName = gDirUtilp->getBaseFileName(filepath, true);
|
||||
LLViewerWindow::sSnapshotDir = gDirUtilp->getDirName(filepath);
|
||||
(new LLGenericSaveFilePicker(pick_type, proposed_name, boost::bind(&LLViewerWindow::saveImageCallback, this, _1, image, extension, callback)))->getFile();
|
||||
return;
|
||||
}
|
||||
|
||||
// Look for an unused file name
|
||||
std::string filepath;
|
||||
S32 i = 1;
|
||||
S32 err = 0;
|
||||
|
||||
do
|
||||
{
|
||||
filepath = sSnapshotDir;
|
||||
filepath += gDirUtilp->getDirDelimiter();
|
||||
filepath += sSnapshotBaseName;
|
||||
filepath += llformat("_%.3d",i);
|
||||
filepath += extension;
|
||||
|
||||
llstat stat_info;
|
||||
err = LLFile::stat( filepath, &stat_info );
|
||||
i++;
|
||||
}
|
||||
while( -1 != err ); // search until the file is not found (i.e., stat() gives an error).
|
||||
|
||||
LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
|
||||
//<FS:Kadah> Log snapshot filename to local chat history
|
||||
if (gSavedSettings.getBOOL("FSLogSnapshotsToLocal"))
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["FILENAME"] = filepath;
|
||||
report_to_nearby_chat(LLTrans::getString("SnapshotSavedToDisk", args));
|
||||
}
|
||||
//</FS:Kadah>
|
||||
return image->save(filepath);
|
||||
do_save_image(image, LLViewerWindow::sSnapshotDir, LLViewerWindow::sSnapshotBaseName, extension, callback);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLViewerWindow::resetSnapshotLoc()
|
||||
|
|
|
|||
|
|
@ -355,7 +355,11 @@ public:
|
|||
BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) ;
|
||||
BOOL isSnapshotLocSet() const { return ! sSnapshotDir.empty(); }
|
||||
void resetSnapshotLoc() const { sSnapshotDir.clear(); }
|
||||
BOOL saveImageNumbered(LLImageFormatted *image, bool force_picker = false);
|
||||
// <FS:Ansariel> Threaded filepickers
|
||||
//BOOL saveImageNumbered(LLImageFormatted *image, bool force_picker = false);
|
||||
void saveImageNumbered(LLImageFormatted *image, bool force_picker = false, boost::function<void(bool)> callback = NULL);
|
||||
void saveImageCallback(const std::string& filename, LLImageFormatted* image, const std::string& extension, boost::function<void(bool)> callback);
|
||||
// </FS:Ansariel>
|
||||
|
||||
// Reset the directory where snapshots are saved.
|
||||
// Client will open directory picker on next snapshot save.
|
||||
|
|
|
|||
Loading…
Reference in New Issue