Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

This commit is contained in:
Liru Færs
2020-04-08 06:59:48 -04:00
3 changed files with 12 additions and 53 deletions

View File

@@ -4832,11 +4832,14 @@ void LLAppViewer::disconnectViewer()
// floater_sound_preview.xml // floater_sound_preview.xml
// floater_animation_preview.xml // floater_animation_preview.xml
// files. // files.
// A more generic mechanism would be nice..
LLFloater* fl = static_cast<LLFloater*>(*it); LLFloater* fl = static_cast<LLFloater*>(*it);
if (fl if (fl
&& (fl->getName() == "Image Preview" && (fl->getName() == "Image Preview"
|| fl->getName() == "Sound Preview" || fl->getName() == "Sound Preview"
|| fl->getName() == "Animation Preview" || fl->getName() == "Animation Preview"
|| fl->getName() == "perm prefs"
)) ))
{ {
floaters_to_close.push_back(fl); floaters_to_close.push_back(fl);

View File

@@ -493,21 +493,10 @@ void LLSurface::disconnectNeighbor(LLSurface* surfacep, U32 direction)
{ {
if (surfacep && surfacep == mNeighbors[direction]) if (surfacep && surfacep == mNeighbors[direction])
{ {
// Iterate through surface patches, removing any connectivity to removed surface. mNeighbors[direction] = NULL;
// Extra branches for debugging. for (auto& patchp : mPatchList)
if (!gHippoGridManager->getCurrentGrid()->isSecondLife())
{ {
for (auto& patchp : mPatchList) patchp->disconnectNeighbor(surfacep);
{
patchp->disconnectNeighbor(surfacep);
}
}
if (gHippoGridManager->getCurrentGrid()->isSecondLife())
{
for (auto& patchp : mPatchList)
{
patchp->disconnectNeighbor(surfacep);
}
} }
} }
} }
@@ -515,46 +504,13 @@ void LLSurface::disconnectNeighbor(LLSurface* surfacep, U32 direction)
void LLSurface::disconnectAllNeighbors() void LLSurface::disconnectAllNeighbors()
{ {
// Pulled out of loop to debug. for (size_t i = 0; i < mNeighbors.size(); ++i)
if (mNeighbors[EAST])
{ {
mNeighbors[EAST]->disconnectNeighbor(this, gDirOpposite[EAST]); auto& neighbor = mNeighbors[i];
} if (neighbor)
if (mNeighbors[NORTH])
{
mNeighbors[NORTH]->disconnectNeighbor(this, gDirOpposite[NORTH]);
}
if (mNeighbors[WEST])
{
mNeighbors[WEST]->disconnectNeighbor(this, gDirOpposite[WEST]);
}
if (mNeighbors[SOUTH])
{
mNeighbors[SOUTH]->disconnectNeighbor(this, gDirOpposite[SOUTH]);
}
if (mNeighbors[NORTHEAST])
{
mNeighbors[NORTHEAST]->disconnectNeighbor(this, gDirOpposite[NORTHEAST]);
}
if (mNeighbors[NORTHWEST])
{
mNeighbors[NORTHWEST]->disconnectNeighbor(this, gDirOpposite[NORTHWEST]);
}
if (mNeighbors[SOUTHWEST])
{
mNeighbors[SOUTHWEST]->disconnectNeighbor(this, gDirOpposite[SOUTHWEST]);
}
if (mNeighbors[SOUTHEAST])
{
mNeighbors[SOUTHEAST]->disconnectNeighbor(this, gDirOpposite[SOUTHEAST]);
}
S32 i;
for (i = 0; i < 8; i++)
{
if (mNeighbors[i])
{ {
//mNeighbors[i]->disconnectNeighbor(this); neighbor->disconnectNeighbor(this, gDirOpposite[i]);
mNeighbors[i] = NULL; neighbor = NULL;
} }
} }
} }

View File

@@ -167,7 +167,7 @@ public:
// +---+---+---+ // +---+---+---+
// |SW | S | SE| // |SW | S | SE|
// +---+---+---+ // +---+---+---+
LLSurface *mNeighbors[8]; // Adjacent patches std::array<LLSurface*, 8> mNeighbors; // Adjacent patches
U32 mType; // Useful for identifying derived classes U32 mType; // Useful for identifying derived classes