started new code path for whole model fee request/upload

meow-7.2.2
Brad Payne (Vir Linden) 2011-05-05 17:40:35 -04:00
parent a81356f841
commit 9b0f5c815f
3 changed files with 80 additions and 0 deletions

11
indra/newview/app_settings/settings.xml Normal file → Executable file
View File

@ -5545,6 +5545,17 @@
<key>Value</key>
<real>0</real>
</map>
<key>MeshUseWholeModelUpload</key>
<map>
<key>Comment</key>
<string>Upload model in its entirety instead of mesh-by-mesh (new caps)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<real>0</real>
</map>
<key>MigrateCacheDirectory</key>
<map>
<key>Comment</key>

65
indra/newview/llmeshrepository.cpp Normal file → Executable file
View File

@ -1239,6 +1239,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset");
mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice");
mWholeModelUploadCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory");
mOrigin += gAgent.getAtAxis() * scale.magVec();
}
@ -1329,6 +1330,70 @@ BOOL LLMeshUploadThread::isDiscarded()
}
void LLMeshUploadThread::run()
{
if (gSavedSettings.getBOOL("MeshUseWholeModelUpload"))
{
doWholeModelUpload();
}
else
{
doIterativeUpload();
}
}
void LLMeshUploadThread::doWholeModelUpload()
{
// Queue up models for hull generation (viewer-side)
for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
{
LLMeshUploadData data;
data.mBaseModel = iter->first;
LLModelInstance& instance = *(iter->second.begin());
for (S32 i = 0; i < 5; i++)
{
data.mModel[i] = instance.mLOD[i];
}
//queue up models for hull generation
LLModel* physics = NULL;
if (data.mModel[LLModel::LOD_PHYSICS].notNull())
{
physics = data.mModel[LLModel::LOD_PHYSICS];
}
else if (data.mModel[LLModel::LOD_MEDIUM].notNull())
{
physics = data.mModel[LLModel::LOD_MEDIUM];
}
else
{
physics = data.mModel[LLModel::LOD_HIGH];
}
if (!physics)
{
llerrs << "WTF?" << llendl;
}
DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
gMeshRepo.mDecompThread->submitRequest(request);
}
while (!mPhysicsComplete)
{
apr_sleep(100);
}
bool do_include_textures = false; // not needed for initial cost/validation check.
LLSD model_data = wholeModelToLLSD(do_include_textures);
// Currently a no-op.
mFinished = true;
}
void LLMeshUploadThread::doIterativeUpload()
{
if(isDiscarded())
{

4
indra/newview/llmeshrepository.h Normal file → Executable file
View File

@ -387,6 +387,7 @@ public:
LLHost mHost;
std::string mUploadObjectAssetCapability;
std::string mNewInventoryCapability;
std::string mWholeModelUploadCapability;
std::queue<LLMeshUploadData> mUploadQ;
std::queue<LLMeshUploadData> mConfirmedQ;
@ -420,6 +421,9 @@ public:
void preStart();
void discard() ;
BOOL isDiscarded();
void doWholeModelUpload();
void doIterativeUpload();
};
class LLMeshRepository