Merge branch 'master' of github.com:Beeks/Ascent

This commit is contained in:
CharleyLevenque
2010-09-16 19:27:54 -04:00
20 changed files with 494 additions and 38 deletions

View File

@@ -873,6 +873,7 @@ void LLStringUtilBase<T>::addCRLF(std::basic_string<T>& string)
}
string.assign(t, size);
delete[] t;
}
}

View File

@@ -36,7 +36,7 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 4;
const S32 LL_VERSION_PATCH = 2;
const S32 LL_VERSION_BUILD = 5;
const S32 LL_VERSION_BUILD = 6;
const char * const LL_CHANNEL = "Ascent Viewer Release";

View File

@@ -135,6 +135,7 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer))
{
setLastError(pngWrapper.getErrorMessage());
delete[] mTmpWriteBuffer;
return FALSE;
}

View File

@@ -161,10 +161,9 @@ namespace
fstream.seekg(0, std::ios::end);
U32 fileSize = fstream.tellg();
fstream.seekg(0, std::ios::beg);
char* fileBuffer;
fileBuffer = new char [fileSize];
fstream.read(fileBuffer, fileSize);
ostream.write(fileBuffer, fileSize);
std::vector<char> fileBuffer(fileSize); //Mem leak fix'd
fstream.read(&fileBuffer[0], fileSize);
ostream.write(&fileBuffer[0], fileSize);
fstream.close();
eos = true;
return STATUS_DONE;
@@ -191,10 +190,9 @@ namespace
LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ);
S32 fileSize = vfile.getSize();
U8* fileBuffer;
fileBuffer = new U8 [fileSize];
vfile.read(fileBuffer, fileSize);
ostream.write((char*)fileBuffer, fileSize);
std::vector<U8> fileBuffer(fileSize);
vfile.read(&fileBuffer[0], fileSize);
ostream.write((char*)&fileBuffer[0], fileSize);
eos = true;
return STATUS_DONE;
}
@@ -341,6 +339,20 @@ void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr r
get(uri.asString(), responder, headers, timeout);
}
class LLHTTPFileBuffer
{
public:
llofstream * stream;
LLHTTPFileBuffer(llofstream * fstream):stream(fstream){}
static size_t curl_write( void *ptr, size_t size, size_t nmemb, void *user_data)
{
LLHTTPFileBuffer* self = (LLHTTPFileBuffer*)user_data;
size_t bytes = (size * nmemb);
self->stream->write((char*)ptr,bytes);
return nmemb;
}
};
// A simple class for managing data returned from a curl http request.
class LLHTTPBuffer
{

View File

@@ -255,7 +255,7 @@ PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB = NULL;
PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = NULL;
#if LL_WINDOWS
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
#endif
#if LL_LINUX_NV_GL_HEADERS
@@ -748,11 +748,13 @@ void LLGLManager::initExtensions()
LL_INFOS("RenderInit") << "Disabling mip-map generation for Intel GPUs" << LL_ENDL;
mHasMipMapGeneration = FALSE;
}
//Don't do this! This has since been fixed. I've benchmarked it. Hardware generation considerably faster. -Shyotl
/*
if (mIsATI && mHasMipMapGeneration)
{
LL_INFOS("RenderInit") << "Disabling mip-map generation for ATI GPUs (performance opt)" << LL_ENDL;
mHasMipMapGeneration = FALSE;
}
}*/
// Misc
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange);

View File

@@ -62,6 +62,7 @@ BOOL LLVertexBuffer::sVBOActive = FALSE;
BOOL LLVertexBuffer::sIBOActive = FALSE;
U32 LLVertexBuffer::sAllocatedBytes = 0;
BOOL LLVertexBuffer::sMapped = FALSE;
BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
std::vector<U32> LLVertexBuffer::sDeleteList;
@@ -348,6 +349,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
mUsage = 0 ;
}
if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
{
mUsage = 0;
}
S32 stride = calcStride(typemask, mOffsets);
mTypeMask = typemask;
@@ -771,7 +777,7 @@ BOOL LLVertexBuffer::useVBOs() const
return FALSE;
}
#endif
return sEnableVBOs;
return TRUE;
}
//----------------------------------------------------------------------------
@@ -1078,7 +1084,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
{
if (mGLBuffer)
{
if (sEnableVBOs && sVBOActive)
if (sVBOActive)
{
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
sBindCount++;
@@ -1090,7 +1096,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
setup = TRUE; // ... or a client memory pointer changed
}
}
if (sEnableVBOs && mGLIndices && sIBOActive)
if (mGLIndices && sIBOActive)
{
/*if (sMapped)
{

View File

@@ -85,6 +85,8 @@ public:
static LLVBOPool sStreamIBOPool;
static LLVBOPool sDynamicIBOPool;
static BOOL sUseStreamDraw;
static void initClass(bool use_vbo);
static void cleanupClass();
static void setupClientArrays(U32 data_mask);

View File

@@ -2,10 +2,21 @@
<llsd>
<map>
<!--Expanded settings from Vanilla SL -->
<key>ShyotlRenderUseStreamVBO</key>
<map>
<key>Comment</key>
<string>Use VBO's for stream buffers</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>AscentShowLookAt</key>
<map>
<key>Comment</key>
<string>Avatar position modifier (X)</string>
<string>Show Others' Lookat points</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@@ -476,6 +476,63 @@ void LLFloaterAO::onClickAnimAdd(void* user_data)
}
onCommitAnim(NULL,user_data);
}
BOOL LLFloaterAO::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
BOOL handled = TRUE;
switch(cargo_type)
{
case DAD_ANIMATION:
{
LLInventoryItem* item = (LLInventoryItem*)cargo_data;
if (item
&& gInventory.getItem(item->getUUID()))
{
if (drop)
{
if (cargo_type == DAD_ANIMATION)
{
std::string anim_name = item->getName();
if (anim_name == "")
return true;
LLUUID id(LLAO::getAssetIDByName(anim_name));
#ifdef AO_DEBUG
llinfos << "Actually adding animation, this should be refreshed. Count:" << LLAO::mAnimationOverrides[mCurrentAnimType].size() << llendl;
#endif
LLAO::mAnimationOverrides[mCurrentAnimType].append(anim_name);
#ifdef AO_DEBUG
llinfos << "Added animation. Count:" << LLAO::mAnimationOverrides[mCurrentAnimType].size() << llendl;
#endif
LLAO::mTimer->reset();
onCommitAnim(NULL,this);
}
refresh();
}
*accept = ACCEPT_YES_COPY_MULTI;
}
else
{
// Not in user's inventory means it was in object inventory
*accept = ACCEPT_NO;
}
break;
}
default:
*accept = ACCEPT_NO;
if (tooltip_msg.empty())
{
tooltip_msg.assign("Only animations can be added to the AO.");
}
break;
}
return handled;
}
//static
void LLFloaterAO::onClickSave(void* user_data)
{

View File

@@ -70,7 +70,11 @@ public:
static void onClickAnimAdd(void* user_data);
static void onClickSave(void* user_data);
static void onClickLoad(void* user_data);
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
private:
LLComboBox* mAnimListCombo;
LLComboBox* mAnimTypeCombo;

View File

@@ -801,6 +801,72 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, LLVector3 position,
return tc;
}
// Returns scale compared to default texgen, and face orientation as calculated
// by planarProjection(). This is needed to match planar texgen parameters.
void LLFace::getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_pos, F32* scale) const
{
const LLVolumeFace& vf = getViewerObject()->getVolume()->getVolumeFace(mTEOffset);
LLVector3 normal = vf.mVertices[0].mNormal;
LLVector3 binormal = vf.mVertices[0].mBinormal;
LLVector2 projected_binormal;
planarProjection(projected_binormal, normal, vf.mCenter, binormal);
projected_binormal -= LLVector2(0.5f, 0.5f); // this normally happens in xform()
*scale = projected_binormal.length();
// rotate binormal to match what planarProjection() thinks it is,
// then find face's rotation from normal and rotated binormal:
projected_binormal.normalize();
F32 ang = acos(projected_binormal.mV[VY]);
ang = (projected_binormal.mV[VX] < 0.f) ? -ang : ang;
binormal.rotVec(ang, normal);
LLQuaternion local_rot( binormal % normal, binormal, normal );
*face_rot = local_rot * mXform->getWorldRotation();
*face_pos = mXform->getWorldPosition();
}
// Returns the necessary texture transform to align this face's TE to align_to's TE
bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offset,
LLVector2* res_st_scale, F32* res_st_rot) const
{
if (!align_to)
{
return false;
}
const LLTextureEntry *orig_tep = align_to->getTextureEntry();
if ((orig_tep->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR) ||
(getTextureEntry()->getTexGen() != LLTextureEntry::TEX_GEN_PLANAR))
{
return false;
}
LLVector3 orig_pos, this_pos;
LLQuaternion orig_face_rot, this_face_rot;
F32 orig_proj_scale, this_proj_scale;
align_to->getPlanarProjectedParams(&orig_face_rot, &orig_pos, &orig_proj_scale);
getPlanarProjectedParams(&this_face_rot, &this_pos, &this_proj_scale);
// The rotation of "this face's" texture:
LLQuaternion orig_st_rot = LLQuaternion(orig_tep->getRotation(), LLVector3::z_axis) * orig_face_rot;
LLQuaternion this_st_rot = orig_st_rot * ~this_face_rot;
F32 x_ang, y_ang, z_ang;
this_st_rot.getEulerAngles(&x_ang, &y_ang, &z_ang);
*res_st_rot = z_ang;
// Offset and scale of "this face's" texture:
LLVector3 centers_dist = (this_pos - orig_pos) * ~orig_st_rot;
LLVector3 st_scale(orig_tep->mScaleS, orig_tep->mScaleT, 1.f);
st_scale *= orig_proj_scale;
centers_dist.scaleVec(st_scale);
LLVector2 orig_st_offset(orig_tep->mOffsetS, orig_tep->mOffsetT);
*res_st_offset = orig_st_offset + (LLVector2)centers_dist;
res_st_offset->mV[VX] -= (S32)res_st_offset->mV[VX];
res_st_offset->mV[VY] -= (S32)res_st_offset->mV[VY];
st_scale /= this_proj_scale;
*res_st_scale = (LLVector2)st_scale;
return true;
}
void LLFace::updateRebuildFlags()
{
if (!mDrawablep->isState(LLDrawable::REBUILD_VOLUME))
@@ -1212,7 +1278,9 @@ F32 LLFace::getTextureVirtualSize()
{
//apply texel area to face area to get accurate ratio
//face_area /= llclamp(texel_area, 1.f/64.f, 16.f);
face_area = mPixelArea / llclamp(texel_area, 0.015625f, 1024.f);
//face_area = mPixelArea / llclamp(texel_area, 0.015625f, 1024.f);
face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f); // see SNOW-207
}
if(face_area > LLViewerImage::sMaxSmallImageSize)

View File

@@ -93,6 +93,9 @@ public:
BOOL hasGeometry() const { return mGeomCount > 0; }
LLVector3 getPositionAgent() const;
LLVector2 surfaceToTexture(LLVector2 surface_coord, LLVector3 position, LLVector3 normal);
void getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_pos, F32* scale) const;
bool calcAlignedPlanarTE(const LLFace* align_to, LLVector2* st_offset,
LLVector2* st_scale, F32* st_rot) const;
U32 getState() const { return mState; }
void setState(U32 state) { mState |= state; }

View File

@@ -99,7 +99,17 @@ void LLFloaterHardwareSettings::refreshEnabledState()
!gGLManager.mHasVertexBufferObject)
{
childSetEnabled("vbo", FALSE);
//Streaming VBOs -Shyotl
childSetEnabled("vbo_stream", FALSE);
}
else
#if LL_DARWIN
childSetEnabled("vbo_stream", FALSE); //Hardcoded disable on mac
childSetValue("vbo_stream", (LLSD::Boolean) FALSE); //Hardcoded disable on mac
#else
childSetEnabled("vbo_stream", LLVertexBuffer::sEnableVBOs);
#endif
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
childSetEnabled("gamma", !gPipeline.canUseWindLightShaders());

View File

@@ -36,6 +36,7 @@
#include "llpanelface.h"
// library includes
#include "llcalc.h"
#include "llerror.h"
#include "llfocusmgr.h"
#include "llrect.h"
@@ -43,11 +44,13 @@
#include "llfontgl.h"
// project includes
#include "llagent.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llcolorswatch.h"
#include "llcombobox.h"
#include "lldrawpoolbump.h"
#include "llface.h"
#include "lllineeditor.h"
#include "llresmgr.h"
#include "llselectmgr.h"
@@ -60,6 +63,7 @@
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "llviewerobject.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "lluictrlfactory.h"
#include "llpluginclassmedia.h"
@@ -169,6 +173,7 @@ BOOL LLPanelFace::postBuild()
childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
childSetCommitCallback("combobox bumpiness",&LLPanelFace::onCommitBump,this);
childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this);
childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("checkbox flip s",&LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureInfo, this);
@@ -178,6 +183,8 @@ BOOL LLPanelFace::postBuild()
childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureInfo, this);
childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureInfo, this);
childSetAction("button align",onClickAutoFix,this);
childSetAction("copytextures",onClickCopy,this);
childSetAction("pastetextures",onClickPaste,this);
clearCtrls();
@@ -359,6 +366,93 @@ private:
LLPanelFace* mPanel;
};
// Functor that aligns a face to mCenterFace
struct LLPanelFaceSetAlignedTEFunctor : public LLSelectedTEFunctor
{
LLPanelFaceSetAlignedTEFunctor(LLPanelFace* panel, LLFace* center_face) :
mPanel(panel),
mCenterFace(center_face) {}
virtual bool apply(LLViewerObject* object, S32 te)
{
LLFace* facep = object->mDrawable->getFace(te);
if (!facep)
{
return true;
}
bool set_aligned = true;
if (facep == mCenterFace)
{
set_aligned = false;
}
if (set_aligned)
{
LLVector2 uv_offset, uv_scale;
F32 uv_rot;
set_aligned = facep->calcAlignedPlanarTE(mCenterFace, &uv_offset, &uv_scale, &uv_rot);
if (set_aligned)
{
object->setTEOffset(te, uv_offset.mV[VX], uv_offset.mV[VY]);
object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]);
object->setTERotation(te, uv_rot);
}
}
if (!set_aligned)
{
LLPanelFaceSetTEFunctor setfunc(mPanel);
setfunc.apply(object, te);
}
return true;
}
private:
LLPanelFace* mPanel;
LLFace* mCenterFace;
};
// Functor that tests if a face is aligned to mCenterFace
struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor
{
LLPanelFaceGetIsAlignedTEFunctor(LLFace* center_face) :
mCenterFace(center_face) {}
virtual bool apply(LLViewerObject* object, S32 te)
{
LLFace* facep = object->mDrawable->getFace(te);
if (!facep)
{
return false;
}
if (facep == mCenterFace)
{
return true;
}
LLVector2 aligned_st_offset, aligned_st_scale;
F32 aligned_st_rot;
if ( facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot) )
{
const LLTextureEntry* tep = facep->getTextureEntry();
LLVector2 st_offset, st_scale;
tep->getOffset(&st_offset.mV[VX], &st_offset.mV[VY]);
tep->getScale(&st_scale.mV[VX], &st_scale.mV[VY]);
F32 st_rot = tep->getRotation();
// needs a fuzzy comparison, because of fp errors
if (is_approx_equal_fraction(st_offset.mV[VX], aligned_st_offset.mV[VX], 16) &&
is_approx_equal_fraction(st_offset.mV[VY], aligned_st_offset.mV[VY], 16) &&
is_approx_equal_fraction(st_scale.mV[VX], aligned_st_scale.mV[VX], 16) &&
is_approx_equal_fraction(st_scale.mV[VY], aligned_st_scale.mV[VY], 16) &&
is_approx_equal_fraction(st_rot, aligned_st_rot, 14))
{
return true;
}
}
return false;
}
private:
LLFace* mCenterFace;
};
struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor
{
virtual bool apply(LLViewerObject* object)
@@ -370,8 +464,26 @@ struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor
void LLPanelFace::sendTextureInfo()
{
LLPanelFaceSetTEFunctor setfunc(this);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
if ((bool)childGetValue("checkbox planar align").asBoolean())
{
struct f1 : public LLSelectedTEGetFunctor<LLFace *>
{
LLFace* get(LLViewerObject* object, S32 te)
{
return (object->mDrawable) ? object->mDrawable->getFace(te): NULL;
}
} get_last_face_func;
LLFace* last_face;
LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_last_face_func, last_face);
LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
else
{
LLPanelFaceSetTEFunctor setfunc(this);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
LLPanelFaceSendFunctor sendfunc;
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
@@ -380,7 +492,7 @@ void LLPanelFace::sendTextureInfo()
void LLPanelFace::getState()
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
LLCalc* calcp = LLCalc::getInstance();
if( objectp
&& objectp->getPCode() == LL_PCODE_VOLUME
&& objectp->permModify())
@@ -402,6 +514,13 @@ void LLPanelFace::getState()
//
// //mBtnAutoFix->setEnabled ( editable );
// }
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
&& (selected_count == 1);
childSetEnabled("copytextures", single_volume && editable);
childSetEnabled("pastetextures", single_volume && editable);
childSetEnabled("textbox params", single_volume && editable);
childSetEnabled("button apply",editable);
bool identical;
@@ -481,6 +600,43 @@ void LLPanelFace::getState()
}
}
// planar align
bool align_planar = false;
bool identical_planar_aligned = false;
{
LLCheckBoxCtrl* cb_planar_align = getChild<LLCheckBoxCtrl>("checkbox planar align");
align_planar = (cb_planar_align && cb_planar_align->get());
struct f1 : public LLSelectedTEGetFunctor<bool>
{
bool get(LLViewerObject* object, S32 face)
{
return (object->getTE(face)->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR);
}
} func;
bool is_planar;
bool texgens_identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, is_planar );
bool enabled = (editable && texgens_identical && is_planar);
childSetValue("checkbox planar align", align_planar && enabled);
childSetEnabled("checkbox planar align", enabled);
if (align_planar && enabled)
{
struct f2 : public LLSelectedTEGetFunctor<LLFace *>
{
LLFace* get(LLViewerObject* object, S32 te)
{
return (object->mDrawable) ? object->mDrawable->getFace(te): NULL;
}
} get_te_face_func;
LLFace* last_face;
LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, last_face);
LLPanelFaceGetIsAlignedTEFunctor get_is_aligend_func(last_face);
// this will determine if the texture param controls are tentative:
identical_planar_aligned = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&get_is_aligend_func);
}
}
// Texture scale
{
childSetEnabled("tex scale",editable);
@@ -494,6 +650,7 @@ void LLPanelFace::getState()
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_s );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexScaleU",editable ? llabs(scale_s) : 0);
childSetTentative("TexScaleU",LLSD((BOOL)(!identical)));
childSetEnabled("TexScaleU",editable);
@@ -512,6 +669,7 @@ void LLPanelFace::getState()
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_t );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexScaleV",llabs(editable ? llabs(scale_t) : 0));
childSetTentative("TexScaleV",LLSD((BOOL)(!identical)));
@@ -533,6 +691,7 @@ void LLPanelFace::getState()
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_s );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexOffsetU", editable ? offset_s : 0);
childSetTentative("TexOffsetU",!identical);
childSetEnabled("TexOffsetU",editable);
@@ -548,6 +707,7 @@ void LLPanelFace::getState()
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_t );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexOffsetV", editable ? offset_t : 0);
childSetTentative("TexOffsetV",!identical);
childSetEnabled("TexOffsetV",editable);
@@ -565,6 +725,7 @@ void LLPanelFace::getState()
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, rotation );
identical = align_planar ? identical_planar_aligned : identical;
childSetValue("TexRot", editable ? rotation * RAD_TO_DEG : 0);
childSetTentative("TexRot",!identical);
childSetEnabled("TexRot",editable);
@@ -757,6 +918,15 @@ void LLPanelFace::getState()
childSetEnabled("button apply",enabled);
}
}
// Set variable values for numeric expressions
calcp->setVar(LLCalc::TEX_U_SCALE, childGetValue("TexScaleU").asReal());
calcp->setVar(LLCalc::TEX_V_SCALE, childGetValue("TexScaleV").asReal());
calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal());
calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal());
calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal());
calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal());
calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal());
}
else
{
@@ -792,6 +962,16 @@ void LLPanelFace::getState()
childSetEnabled("button align",FALSE);
childSetEnabled("button apply",FALSE);
// Set variable values for numeric expressions
calcp->clearVar(LLCalc::TEX_U_SCALE);
calcp->clearVar(LLCalc::TEX_V_SCALE);
calcp->clearVar(LLCalc::TEX_U_OFFSET);
calcp->clearVar(LLCalc::TEX_V_OFFSET);
calcp->clearVar(LLCalc::TEX_ROTATION);
calcp->clearVar(LLCalc::TEX_TRANSPARENCY);
calcp->clearVar(LLCalc::TEX_GLOW);
}
}
@@ -978,3 +1158,69 @@ void LLPanelFace::onClickAutoFix(void* userdata)
LLPanelFaceSendFunctor sendfunc;
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
}
// static
void LLPanelFace::onCommitPlanarAlign(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace* self = (LLPanelFace*) userdata;
self->getState();
self->sendTextureInfo();
}
static LLSD textures;
void LLPanelFace::onClickCopy(void* userdata)
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
if(!objectp)
{
objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if (!objectp)
{
return;
}
}
S32 te_count = objectp->getNumFaces();
textures.clear();
for (S32 i = 0; i < te_count; i++)
{
llinfos << "Copying params on face " << i << "." << llendl;
textures.append(objectp->getTE(i)->asLLSD());
}
}
void LLPanelFace::onClickPaste(void* userdata)
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
if(!objectp)
{
objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if (!objectp)
{
return;
}
}
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectImage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID());
msg->addStringFast(_PREHASH_MediaURL, NULL);
LLPrimitive obj;
obj.setNumTEs(U8(textures.size()));
for (int i = 0; i < textures.size(); i++)
{
llinfos << "Pasting params on face " << i << "." << llendl;
LLTextureEntry tex;
tex.fromLLSD(textures[i]);
obj.setTE(U8(i), tex);
}
obj.packTEMessage(gMessageSystem);
msg->sendReliable(gAgent.getRegion()->getHost());
}

View File

@@ -86,9 +86,12 @@ protected:
static void onCommitShiny( LLUICtrl* ctrl, void* userdata);
static void onCommitFullbright( LLUICtrl* ctrl, void* userdata);
static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
static void onClickApply(void*);
static void onClickAutoFix(void*);
static void onClickCopy(void*);
static void onClickPaste(void*);
static F32 valueGlow(LLViewerObject* object, S32 face);
};

View File

@@ -526,6 +526,8 @@ void settings_setup_listeners()
gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
//See LL jira VWR-3258 comment section. Implemented by LL in 2.1 -Shyotl
gSavedSettings.getControl("ShyotlRenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _1));
gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _1));

View File

@@ -747,20 +747,13 @@ void init_menus()
LLMenuGL*menu;
menu = new LLMenuGL("Ascent");
menu->append(new LLMenuItemCallGL( "Object Area Search", &handle_area_search, NULL));
menu->append(new LLMenuItemCallGL( "Close All Dialogs",
&handle_close_all_notifications, NULL, NULL, 'D', MASK_CONTROL | MASK_ALT | MASK_SHIFT));
menu->appendSeparator();
menu->append(new LLMenuItemCallGL( "Fake Away Status", &handle_fake_away_status, NULL));
menu->append(new LLMenuItemCallGL( "Force Ground Sit", &handle_force_ground_sit, NULL));
menu->append(new LLMenuItemCallGL( "Phantom Avatar", &handle_phantom_avatar, NULL));
menu->append(new LLMenuItemCallGL( "Toggle IM Typing Notification", &handle_hide_typing_notification, NULL));
menu->append(new LLMenuItemCallGL( "Close All Dialogs",
&handle_close_all_notifications, NULL, NULL, 'D', MASK_CONTROL | MASK_ALT | MASK_SHIFT));
menu->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL));
menu->append(new LLMenuItemCallGL( "Sound Explorer",
&handle_sounds_explorer, NULL));
menu->append(new LLMenuItemCallGL( "Asset Blacklist",
&handle_blacklist, NULL));
menu->appendSeparator();
menu->append(new LLMenuItemCheckGL( "Enable AO",
&menu_toggle_control,
NULL,
@@ -778,6 +771,17 @@ void init_menus()
NULL,
&menu_check_control,
(void*)"ReSit"));
menu->appendSeparator();
menu->append(new LLMenuItemCallGL( "Object Area Search", &handle_area_search, NULL));
menu->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL));
menu->append(new LLMenuItemCallGL( "Sound Explorer",
&handle_sounds_explorer, NULL));
menu->append(new LLMenuItemCallGL( "Asset Blacklist",
&handle_blacklist, NULL));
// <dogmode>
// Add in the pose stand -------------------------------------------
LLMenuGL* sub = new LLMenuGL("Pose Stand");

View File

@@ -102,6 +102,10 @@
#include "llspatialpartition.h"
#include "llmutelist.h"
#if !LL_DARWIN
#include "llfloaterhardwaresettings.h"
#endif
#ifdef _DEBUG
// Debug indices is disabled for now for debug performance - djs 4/24/02
//#define DEBUG_INDICES
@@ -321,6 +325,7 @@ void LLPipeline::init()
sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD");
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("ShyotlRenderUseStreamVBO");
sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles");
@@ -4911,6 +4916,10 @@ void LLPipeline::setUseVBO(BOOL use_vbo)
resetVertexBuffers();
LLVertexBuffer::initClass(use_vbo);
#if !LL_DARWIN
if(LLFloaterHardwareSettings::isOpen())
LLFloaterHardwareSettings::instance()->refreshEnabledState();
#endif
}
}

View File

@@ -63,7 +63,12 @@
mouse_opaque="true" name="vbo" radio_style="false"
tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled."
width="315" />
<check_box bottom_delta="-18" control_name="ShyotlRenderUseStreamVBO" enabled="true" follows="left|top"
font="SansSerifSmall" height="16" initial_value="false"
label="Enable Streamed VBOs" left="157"
mouse_opaque="true" name="vbo_stream" radio_style="false"
tool_tip="Disabling this may improve performance when VBOs are enabled. Disabling produced observable improvement on various AMD GPUs."
width="315" />
<slider bottom_delta="-21" can_edit_text="false" control_name="TextureMemory"
decimal_digits="0" enabled="true"
follows="left|top" height="16" increment="16"

View File

@@ -1227,6 +1227,10 @@
weave
</combo_item>
</combo_box>
<check_box bottom="-148" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" enabled="false" label="Align planar textures"
left="8" mouse_opaque="true" name="checkbox planar align" width="160"
tool_tip="Aligns textures on all selected faces to the last selected face. Requires Planar texture mapping." />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-158" drop_shadow_visible="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
@@ -1295,12 +1299,18 @@
<button bottom="-360" follows="left|top" font="SansSerifSmall" halign="center"
height="20" label="Align" label_selected="Align" left="112"
mouse_opaque="true" name="button align" scale_image="TRUE" width="68" />
<button bottom="-360" follows="top|right" font="SansSerifSmall" halign="center"
height="16" label="Copy" left="80" mouse_opaque="true" name="copytextures" enabled="true"
tool_tip="Copy Testure Params from Clipboard" width="50" />
<button bottom_delta="0" follows="top|right" font="SansSerifSmall" halign="center"
height="16" label="Paste" left_delta="50" mouse_opaque="true" name="pastetextures" enabled="true"
tool_tip="Paste Texture Params from Clipboard" width="50" />
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-322" drop_shadow_visible="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="20" left="185"
mouse_opaque="true" name="textbox params" v_pad="0" width="160">
Texture Params
</text>
<button bottom_delta="-18" follows="top|right" font="SansSerifSmall" halign="center"
height="20" label="Copy" left_delta="5" mouse_opaque="true" name="copytextures" enabled="true"
tool_tip="Copy Testure Params from Clipboard" width="68" />
<button bottom_delta="-20" follows="top|right" font="SansSerifSmall" halign="center"
height="20" label="Paste" left_delta="0" mouse_opaque="true" name="pastetextures" enabled="true"
tool_tip="Paste Texture Params from Clipboard" width="68" />
</panel>
<panel border="true" bottom="-383" follows="left|top|right|bottom" height="367"
label="Content" left="1" mouse_opaque="false" name="Contents" width="270">