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:
@@ -46,8 +46,7 @@
|
||||
#include "llregionhandle.h"
|
||||
#include "llsurface.h"
|
||||
#include "llviewercamera.h"
|
||||
#include "llviewerimage.h"
|
||||
#include "llviewerimagelist.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewerparceloverlay.h"
|
||||
@@ -114,8 +113,8 @@ LLWorld::LLWorld() :
|
||||
*(default_texture++) = MAX_WATER_COLOR.mV[2];
|
||||
*(default_texture++) = MAX_WATER_COLOR.mV[3];
|
||||
|
||||
mDefaultWaterTexturep = new LLViewerImage(raw, FALSE);
|
||||
gGL.getTexUnit(0)->bind(mDefaultWaterTexturep.get());
|
||||
mDefaultWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
|
||||
gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
|
||||
mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
||||
}
|
||||
@@ -137,10 +136,11 @@ void LLWorld::destroyClass()
|
||||
LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_REGIONS);
|
||||
|
||||
llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl;
|
||||
LLViewerRegion *regionp = getRegionFromHandle(region_handle);
|
||||
if (regionp)
|
||||
{
|
||||
llinfos << "Region exists, removing it " << llendl;
|
||||
LLHost old_host = regionp->getHost();
|
||||
// region already exists!
|
||||
if (host == old_host && regionp->isAlive())
|
||||
@@ -374,9 +374,14 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe
|
||||
clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY];
|
||||
}
|
||||
|
||||
// clamp to < 256 to stay in sim
|
||||
// clamp to within region dimensions
|
||||
LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor);
|
||||
final_region_pos.clamp(0.0, 255.999);
|
||||
final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], 0.0,
|
||||
(F64)(region_width - F_ALMOST_ZERO));
|
||||
final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0,
|
||||
(F64)(region_width - F_ALMOST_ZERO));
|
||||
final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0,
|
||||
(F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO));
|
||||
return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos));
|
||||
}
|
||||
|
||||
@@ -1161,7 +1166,7 @@ void LLWorld::shiftRegions(const LLVector3& offset)
|
||||
LLViewerPartSim::getInstance()->shift(offset);
|
||||
}
|
||||
|
||||
LLViewerImage* LLWorld::getDefaultWaterTexture()
|
||||
LLViewerTexture* LLWorld::getDefaultWaterTexture()
|
||||
{
|
||||
return mDefaultWaterTexturep;
|
||||
}
|
||||
@@ -1435,6 +1440,42 @@ void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d
|
||||
}
|
||||
}
|
||||
}
|
||||
// retrieve the list of close avatars from viewer objects as well
|
||||
// for when we are above 1000m, only do this when we are retrieving
|
||||
// uuid's too as there could be duplicates
|
||||
if(avatar_ids != NULL)
|
||||
{
|
||||
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
|
||||
iter != LLCharacter::sInstances.end(); ++iter)
|
||||
{
|
||||
LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
|
||||
if(pVOAvatar->isDead() || pVOAvatar->isSelf())
|
||||
continue;
|
||||
LLUUID uuid = pVOAvatar->getID();
|
||||
if(uuid.isNull())
|
||||
continue;
|
||||
LLVector3d pos_global = pVOAvatar->getPositionGlobal();
|
||||
if(dist_vec(pos_global, relative_to) <= radius)
|
||||
{
|
||||
bool found = false;
|
||||
uuid_vec_t::iterator sel_iter = avatar_ids->begin();
|
||||
for (; sel_iter != avatar_ids->end(); sel_iter++)
|
||||
{
|
||||
if(*sel_iter == uuid)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
if(positions != NULL)
|
||||
positions->push_back(pos_global);
|
||||
avatar_ids->push_back(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user