Fixies from viewer-development

This commit is contained in:
Siana Gearz
2012-03-06 09:01:01 +01:00
parent 8b6f462d13
commit 83a3bbb48e
12 changed files with 73 additions and 14 deletions

View File

@@ -1321,6 +1321,7 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32
mSyncSlave(false),
mQueueSounds(false),
mPlayedOnce(false),
mCorrupted(false),
mType(type),
// <edit>
mSourceID(source_id),
@@ -1372,16 +1373,25 @@ void LLAudioSource::setChannel(LLAudioChannel *channelp)
void LLAudioSource::update()
{
if(mCorrupted)
{
return ; //no need to update
}
if (!getCurrentBuffer())
{
if (getCurrentData())
{
// Hack - try and load the sound. Will do this as a callback
// on decode later.
if (getCurrentData()->load())
if (getCurrentData()->load() && getCurrentData()->getBuffer())
{
play(getCurrentData()->getID());
}
}
else
{
mCorrupted = true ;
}
}
}
}
@@ -1502,6 +1512,11 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
bool LLAudioSource::isDone() const
{
if(mCorrupted)
{
return true ;
}
const F32 MAX_AGE = 60.f;
const F32 MAX_UNPLAYED_AGE = 15.f;
const F32 MAX_MUTED_AGE = 11.f;
@@ -1817,7 +1832,7 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
}
}
//return false when the audio file is corrupted.
bool LLAudioData::load()
{
// For now, just assume we're going to use one buffer per audiodata.
@@ -1833,7 +1848,7 @@ bool LLAudioData::load()
{
// No free buffers, abort.
llinfos << "Not able to allocate a new audio buffer, aborting." << llendl;
return false;
return true;
}
std::string uuid_str;

View File

@@ -366,6 +366,7 @@ protected:
bool mSyncSlave;
bool mQueueSounds;
bool mPlayedOnce;
bool mCorrupted;
S32 mType;
LLVector3d mPositionGlobal;
LLVector3 mVelocity;

View File

@@ -833,11 +833,21 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */
if (! src) goto err;
do
while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0)
{
bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE,src);
gzwrite(dst, buffer, bytes);
} while(feof(src) == 0);
if (gzwrite(dst, buffer, bytes) <= 0)
{
llwarns << "gzwrite failed: " << gzerror(dst, NULL) << llendl;
goto err;
}
}
if (ferror(src))
{
llwarns << "Error reading " << srcfile << llendl;
goto err;
}
gzclose(dst);
dst = NULL;
#if LL_WINDOWS

View File

@@ -3235,7 +3235,7 @@ void LLViewerLODTexture::processTextureStats()
scaleDown() ;
}
// Limit the amount of GL memory bound each frame
if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale &&
else if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale &&
(!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel))
{
scaleDown() ;

View File

@@ -558,6 +558,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
S32 count = mImageList.erase(image) ;
if(count != 1)
{
llinfos << image->getID() << llendl ;
llerrs << "Error happens when remove image from mImageList: " << count << llendl ;
}
@@ -956,6 +957,8 @@ void LLViewerTextureList::decodeAllImages(F32 max_time)
image_list.push_back(imagep);
imagep->setInImageList(FALSE) ;
}
llassert_always(image_list.size() == mImageList.size()) ;
mImageList.clear();
for (std::vector<LLPointer<LLViewerFetchedTexture> >::iterator iter = image_list.begin();
iter != image_list.end(); ++iter)

View File

@@ -634,7 +634,9 @@ public:
addText(xpos, ypos, llformat("%d/%d Mesh HTTP Requests/Retries", LLMeshRepository::sHTTPRequestCount,
LLMeshRepository::sHTTPRetryCount));
ypos += y_inc;
addText(xpos, ypos, llformat("%d/%d Mesh LOD Pending/Processing", LLMeshRepository::sLODPending, LLMeshRepository::sLODProcessing));
ypos += y_inc;
addText(xpos, ypos, llformat("%.3f/%.3f MB Mesh Cache Read/Write ", LLMeshRepository::sCacheBytesRead/(1024.f*1024.f), LLMeshRepository::sCacheBytesWritten/(1024.f*1024.f)));
@@ -1070,7 +1072,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
mWindow->showCursorFromMouseMove();
if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME)
if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME
&& !gDisconnected)
{
gAgent.clearAFK();
}

View File

@@ -84,6 +84,8 @@ class LLVOAvatar :
public LLViewerObject,
public LLCharacter
{
LOG_CLASS(LLVOAvatar);
public:
friend class LLVOAvatarSelf;
protected:

View File

@@ -39,6 +39,7 @@
class LLVOAvatarSelf :
public LLVOAvatar
{
LOG_CLASS(LLVOAvatarSelf);
/********************************************************************************
** **

View File

@@ -4244,6 +4244,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
}
}
else if (gPipeline.canUseVertexShaders()
&& group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD
&& LLPipeline::sRenderBump
&& te->getShiny())
{ //shiny

View File

@@ -71,7 +71,7 @@ struct LLWearableArrivedData
LLWearableList::~LLWearableList()
{
llassert_always(mList.empty()) ;
cleanup();
}
void LLWearableList::cleanup()

View File

@@ -227,6 +227,16 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
mCurlRequest = new LLCurlEasyRequest();
}
if(!mCurlRequest->isValid())
{
llwarns << "mCurlRequest is invalid." << llendl ;
delete mCurlRequest ;
mCurlRequest = NULL ;
return ;
}
LLProxy::getInstance()->applyProxySettings(mCurlRequest);
// mCurlRequest->setopt(CURLOPT_VERBOSE, 1); // usefull for debugging
@@ -277,10 +287,20 @@ LLXMLRPCTransaction::Impl::~Impl()
}
delete mCurlRequest;
mCurlRequest = NULL ;
}
bool LLXMLRPCTransaction::Impl::process()
{
if(!mCurlRequest || !mCurlRequest->isValid())
{
llwarns << "transaction failed." << llendl ;
delete mCurlRequest ;
mCurlRequest = NULL ;
return true ; //failed, quit.
}
switch(mStatus)
{
case LLXMLRPCTransaction::StatusComplete:

View File

@@ -1021,10 +1021,12 @@ void LLPipeline::restoreGL()
BOOL LLPipeline::canUseVertexShaders()
{
static const std::string vertex_shader_enable_feature_string = "VertexShaderEnable";
if (sDisableShaders ||
!gGLManager.mHasVertexShader ||
!gGLManager.mHasFragmentShader ||
!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") ||
!LLFeatureManager::getInstance()->isFeatureAvailable(vertex_shader_enable_feature_string) ||
(assertInitialized() && mVertexShadersLoaded != 1) )
{
return FALSE;
@@ -5085,7 +5087,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
light_state->setSpotCutoff(90.f);
light_state->setSpotExponent(2.f);
light_state->setSpecular(LLColor4::black);
const LLColor4 specular(0.f, 0.f, 0.f, 0.f);
light_state->setSpecular(specular);
}
else // omnidirectional (point) light
{