Merge branch 'master' of git://github.com/siana/SingularityViewer

This commit is contained in:
Lirusaito
2012-02-24 18:39:25 -05:00
9 changed files with 136 additions and 17 deletions

View File

@@ -76,6 +76,7 @@ include_directories(
) )
set(viewer_SOURCE_FILES set(viewer_SOURCE_FILES
sgmemstat.cpp
sgversion.cpp sgversion.cpp
llviewerobjectbackup.cpp llviewerobjectbackup.cpp
slfloatermediafilter.cpp slfloatermediafilter.cpp
@@ -564,6 +565,7 @@ set(viewer_HEADER_FILES
CMakeLists.txt CMakeLists.txt
ViewerInstall.cmake ViewerInstall.cmake
sgmemstat.h
sgversion.h sgversion.h
llviewerobjectbackup.h llviewerobjectbackup.h
slfloatermediafilter.h slfloatermediafilter.h

View File

@@ -4205,6 +4205,17 @@
<key>Value</key> <key>Value</key>
<integer>-1</integer> <integer>-1</integer>
</map> </map>
<key>DebugStatModeMalloc</key>
<map>
<key>Comment</key>
<string>Mode of stat in Statistics floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>-1</integer>
</map>
<key>DebugStatModeFormattedMem</key> <key>DebugStatModeFormattedMem</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -161,22 +161,38 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
LLCategoryCreate* cat_data = new LLCategoryCreate(object_id, wear); LLCategoryCreate* cat_data = new LLCategoryCreate(object_id, wear);
LLUUID category_id = gInventory.createNewCategory(parent_category_id, LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLFolderType::FT_NONE, LLFolderType::FT_NONE,
name, name,
callbackCreateInventoryCategory, callbackCreateInventoryCategory,
(void*)cat_data); (void*)cat_data);
//If we get a null category ID, we are using a capability in createNewCategory and we will //If we get a null category ID, we are using a capability in createNewCategory and we will
//handle the following in the callbackCreateInventoryCategory routine. //handle the following in the callbackCreateInventoryCategory routine.
if ( category_id.notNull() ) if ( category_id.notNull() )
{ {
LLSD result; delete cat_data;
result["folder_id"] = category_id;
//Reduce redundant code by just calling the callback. Dur. LLCatAndWear* data = new LLCatAndWear;
callbackCreateInventoryCategory(result,cat_data); data->mCatID = category_id;
data->mWear = wear;
data->mFolderResponded = false;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
BOOL success = move_inv_category_world_to_agent(object_id, category_id, TRUE,
callbackMoveInventory,
(void*)data);
if (!success)
{
delete data;
data = NULL;
LLNotificationsUtil::add("OpenObjectCannotCopy");
}
} }
} }
// static // static
void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, void* data) void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, void* data)
{ {

View File

@@ -45,6 +45,7 @@
#include "pipeline.h" #include "pipeline.h"
#include "llviewerobjectlist.h" #include "llviewerobjectlist.h"
#include "llviewertexturelist.h" #include "llviewertexturelist.h"
#include "sgmemstat.h"
const S32 LL_SCROLL_BORDER = 1; const S32 LL_SCROLL_BORDER = 1;
@@ -100,6 +101,16 @@ void LLFloaterStats::buildStats()
stat_barp->mPerSec = FALSE; stat_barp->mPerSec = FALSE;
stat_barp->mDisplayMean = FALSE; stat_barp->mDisplayMean = FALSE;
if(SGMemStat::haveStat()) {
stat_barp = stat_viewp->addStat("Allocated memory", &(LLViewerStats::getInstance()->mMallocStat), "DebugStatModeMalloc");
stat_barp->setUnitLabel(" MB");
stat_barp->mMinBar = 0.f;
stat_barp->mMaxBar = 4000.f;
stat_barp->mTickSpacing = 100.f;
stat_barp->mLabelSpacing = 200.f;
stat_barp->mPerSec = FALSE;
stat_barp->mDisplayMean = FALSE;
}
stat_viewp = new LLStatView("advanced stat view", "Advanced", "OpenDebugStatAdvanced", rect); stat_viewp = new LLStatView("advanced stat view", "Advanced", "OpenDebugStatAdvanced", rect);
addStatView(stat_viewp); addStatView(stat_viewp);

View File

@@ -4544,7 +4544,10 @@ void LLOutfitObserver::done()
class LLOutfitFetch : public LLInventoryFetchDescendentsObserver class LLOutfitFetch : public LLInventoryFetchDescendentsObserver
{ {
public: public:
LLOutfitFetch(const LLUUID& id, bool copy_items, bool append) : mCopyItems(copy_items), mAppend(append) {} LLOutfitFetch(const LLUUID& id, bool copy_items, bool append) :
LLInventoryFetchDescendentsObserver(id),
mCopyItems(copy_items),
mAppend(append) {}
~LLOutfitFetch() {} ~LLOutfitFetch() {}
virtual void done(); virtual void done();
protected: protected:
@@ -4559,6 +4562,18 @@ void LLOutfitFetch::done()
// happen. // happen.
LLInventoryModel::cat_array_t cat_array; LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array; LLInventoryModel::item_array_t item_array;
// Avoid passing a NULL-ref as mCompleteFolders.front() down to
// gInventory.collectDescendents()
if( mComplete.empty() )
{
llwarns << "LLOutfitFetch::done with empty mCompleteFolders" << llendl;
dec_busy_count();
gInventory.removeObserver(this);
delete this;
return;
}
gInventory.collectDescendents(mComplete.front(), gInventory.collectDescendents(mComplete.front(),
cat_array, cat_array,
item_array, item_array,

View File

@@ -213,6 +213,7 @@ LLViewerStats::LLViewerStats() :
mObjectKBitStat("objectkbitstat"), mObjectKBitStat("objectkbitstat"),
mAssetKBitStat("assetkbitstat"), mAssetKBitStat("assetkbitstat"),
mTextureKBitStat("texturekbitstat"), mTextureKBitStat("texturekbitstat"),
mMallocStat("mallocstat"),
mVFSPendingOperations("vfspendingoperations"), mVFSPendingOperations("vfspendingoperations"),
mObjectsDrawnStat("objectsdrawnstat"), mObjectsDrawnStat("objectsdrawnstat"),
mObjectsCulledStat("objectsculledstat"), mObjectsCulledStat("objectsculledstat"),

View File

@@ -59,6 +59,7 @@ public:
LLStat mActualInKBitStat; // From the packet ring (when faking a bad connection) LLStat mActualInKBitStat; // From the packet ring (when faking a bad connection)
LLStat mActualOutKBitStat; // From the packet ring (when faking a bad connection) LLStat mActualOutKBitStat; // From the packet ring (when faking a bad connection)
LLStat mTrianglesDrawnStat; LLStat mTrianglesDrawnStat;
LLStat mMallocStat;
// Simulator stats // Simulator stats
LLStat mSimTimeDilation; LLStat mSimTimeDilation;

View File

@@ -0,0 +1,31 @@
/* Copyright (C) 2012 Siana Gearz
*
* 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; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA */
#include "llviewerprecompiledheaders.h"
#include "sgmemstat.h"
bool SGMemStat::haveStat() {
return false;
}
F32 SGMemStat::getMalloc() {
return 0.f;
}
U32 SGMemStat::getNumObjects() {
return 0;
}

31
indra/newview/sgmemstat.h Normal file
View File

@@ -0,0 +1,31 @@
/* Copyright (C) 2012 Siana Gearz
*
* 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; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA */
#ifndef SGMEMSTAT_H
#define SGMEMSTAT_H
namespace SGMemStat{
bool haveStat();
F32 getMalloc();
U32 getNumObjects();
}
#endif