Innitial commit of experimental v2 texture system port work. Compiles and runs on windows, at least. Fixing bugs as they come.

Need to test:
localassetbrowser
preview related floaters
hgfloatertexteditor
maps
media textures! Currently very hacky
web browser
alpha masks on avatars
bumpmaps
Are all sky components appearing?
LLViewerDynamicTexture (texture baking, browser, animated textures, anim previews, etc)
Snapshot related features
Customize avatar
vfs floater
UI textures in general
Texture priority issues
This commit is contained in:
Shyotl
2011-03-31 03:22:01 -05:00
parent a028c4edba
commit e756140e1d
212 changed files with 8149 additions and 4445 deletions

View File

@@ -57,7 +57,7 @@
#include "llsky.h"
#include "lltexturefetch.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerregion.h"
#include "llviewertextureanim.h"
#include "llworld.h"
@@ -481,7 +481,7 @@ void LLVOVolume::updateTextureVirtualSize()
return;
}
if (LLViewerImage::sDontLoadVolumeTextures || LLAppViewer::getTextureFetch()->mDebugPause)
if (LLViewerTexture::sDontLoadVolumeTextures || LLAppViewer::getTextureFetch()->mDebugPause)
{
return;
}
@@ -498,7 +498,7 @@ void LLVOVolume::updateTextureVirtualSize()
{
LLFace* face = mDrawable->getFace(i);
const LLTextureEntry *te = face->getTextureEntry();
LLViewerImage *imagep = face->getTexture();
LLViewerTexture *imagep = face->getTexture();
if (!imagep || !te ||
face->mExtents[0] == face->mExtents[1])
{
@@ -512,7 +512,7 @@ void LLVOVolume::updateTextureVirtualSize()
{
F32 area = (F32) LLViewerCamera::getInstance()->getScreenPixelArea();
vsize = area;
imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_HUD);
imagep->setBoostLevel(LLViewerTexture::BOOST_HUD);
face->setPixelArea(area); // treat as full screen
face->setVirtualSize(vsize);
}
@@ -527,7 +527,7 @@ void LLVOVolume::updateTextureVirtualSize()
// Our attachments must really rez fast and fully:
// we shouldn't have to zoom on them to get the textures
// fully loaded !
imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_HUD);
imagep->setBoostLevel(LLViewerTexture::BOOST_HUD);
imagep->dontDiscard();
}
}
@@ -571,14 +571,14 @@ void LLVOVolume::updateTextureVirtualSize()
if (mSculptTexture.notNull())
{
mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(),
(S32)LLViewerImageBoostLevel::BOOST_SCULPTED));
(S32)LLViewerTexture::BOOST_SCULPTED));
mSculptTexture->setForSculpt() ;
if(!mSculptTexture->isCachedRawImageReady())
{
S32 lod = llmin(mLOD, 3);
F32 lodf = ((F32)(lod + 1.0f)/4.f);
F32 tex_size = lodf * LLViewerImage::sMaxSculptRez ;
F32 tex_size = lodf * LLViewerTexture::sMaxSculptRez ;
mSculptTexture->addTextureStats(2.f * tex_size * tex_size, FALSE);
//if the sculpty very close to the view point, load first
@@ -671,7 +671,7 @@ void LLVOVolume::setScale(const LLVector3 &scale, BOOL damped)
LLFace* LLVOVolume::addFace(S32 f)
{
const LLTextureEntry* te = getTE(f);
LLViewerImage* imagep = getTEImage(f);
LLViewerTexture* imagep = getTEImage(f);
return mDrawable->addFace(te, imagep);
}
@@ -763,7 +763,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail
void LLVOVolume::updateSculptTexture()
{
LLPointer<LLViewerImage> old_sculpt = mSculptTexture;
LLPointer<LLViewerFetchedTexture> old_sculpt = mSculptTexture;
if (isSculpted())
{
@@ -771,7 +771,7 @@ void LLVOVolume::updateSculptTexture()
LLUUID id = sculpt_params->getSculptTexture();
if (id.notNull())
{
mSculptTexture = gImageList.getImage(id);
mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
}
}
else
@@ -1307,7 +1307,7 @@ BOOL LLVOVolume::isRootEdit() const
return TRUE;
}
void LLVOVolume::setTEImage(const U8 te, LLViewerImage *imagep)
void LLVOVolume::setTEImage(const U8 te, LLViewerTexture *imagep)
{
BOOL changed = (mTEImages[te] != imagep);
LLViewerObject::setTEImage(te, imagep);
@@ -1799,7 +1799,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p
trans_mat.translate(getRegion()->getOriginAgent());
}
volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, trans_mat, mRelativeXformInvTrans);
volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, trans_mat, mRelativeXformInvTrans, nodep->getTESelectMask());
nodep->mSilhouetteExists = TRUE;
}
@@ -2102,7 +2102,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e
{
LLFace* face = mDrawable->getFace(face_hit);
if (pick_transparent || !face->getTexture() || !face->getTexture()->getHasGLTexture() || face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))
if (pick_transparent || !face->getTexture() || !face->getTexture()->hasGLTexture() || face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))
{
v_end = p;
if (face_hitp != NULL)
@@ -2154,7 +2154,7 @@ U32 LLVOVolume::getPartitionType() const
LLVolumePartition::LLVolumePartition()
: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB)
{
mLODPeriod = 16;
mLODPeriod = 32;
mDepthMask = FALSE;
mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
mPartitionType = LLViewerRegion::PARTITION_VOLUME;
@@ -2166,7 +2166,7 @@ LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep)
: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK)
{
mDepthMask = FALSE;
mLODPeriod = 16;
mLODPeriod = 32;
mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
@@ -2224,7 +2224,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0);
LLViewerImage* tex = facep->getTexture();
LLViewerTexture* tex = facep->getTexture();
U8 glow = 0;
@@ -2379,7 +2379,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if (facep->hasGeometry() && facep->mPixelArea > FORCE_CULL_AREA)
{
const LLTextureEntry* te = facep->getTextureEntry();
LLViewerImage* tex = facep->getTexture();
LLViewerTexture* tex = facep->getTexture();
if (facep->isState(LLFace::TEXTURE_ANIM))
{
@@ -2632,7 +2632,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
LLSpatialGroup::buffer_map_t buffer_map;
LLViewerImage* last_tex = NULL;
LLViewerTexture* last_tex = NULL;
S32 buffer_index = 0;
if (distance_sort)
@@ -2644,7 +2644,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
{
//pull off next face
LLFace* facep = *face_iter;
LLViewerImage* tex = facep->getTexture();
LLViewerTexture* tex = facep->getTexture();
if (distance_sort)
{
@@ -2759,7 +2759,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
const LLTextureEntry* te = facep->getTextureEntry();
BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE;
BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;
if (is_alpha)
{