Remove Kitty's worldmap tiles code for the minimap

master
Ansariel 2024-12-20 13:37:38 +01:00
parent 5df5f5144e
commit 8431e6c4ed
3 changed files with 16 additions and 110 deletions

View File

@ -8511,17 +8511,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>MiniMapWorldMapTextures</key>
<map>
<key>Comment</key>
<string>Use the world map texture tile on the mini-map rather than the terrain texture</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>1</boolean>
</map>
<key>MiniMapRotate</key>
<map>
<key>Comment</key>

View File

@ -213,7 +213,6 @@ bool LLNetMap::postBuild()
commitRegistrar.add("Minimap.StartTracking", boost::bind(&LLNetMap::handleStartTracking, this));
// [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3)
commitRegistrar.add("Minimap.ShowProfile", boost::bind(&LLNetMap::handleShowProfile, this, _2));
commitRegistrar.add("Minimap.TextureType", boost::bind(&LLNetMap::handleTextureType, this, _2));
commitRegistrar.add("Minimap.ToggleOverlay", boost::bind(&LLNetMap::handleOverlayToggle, this, _2));
commitRegistrar.add("Minimap.AddFriend", boost::bind(&LLNetMap::handleAddFriend, this));
@ -238,9 +237,6 @@ bool LLNetMap::postBuild()
commitRegistrar.add("Minimap.EstateBan", boost::bind(&LLNetMap::handleEstateBan, this));
commitRegistrar.add("Minimap.Derender", boost::bind(&LLNetMap::handleDerender, this, false));
commitRegistrar.add("Minimap.DerenderPermanent", boost::bind(&LLNetMap::handleDerender, this, true));
enableRegistrar.add("Minimap.CheckTextureType", boost::bind(&LLNetMap::checkTextureType, this, _2));
enableRegistrar.add("Minimap.CanAddFriend", boost::bind(&LLNetMap::canAddFriend, this));
enableRegistrar.add("Minimap.CanRemoveFriend", boost::bind(&LLNetMap::canRemoveFriend, this));
enableRegistrar.add("Minimap.CanCall", boost::bind(&LLNetMap::canCall, this));
@ -458,86 +454,26 @@ void LLNetMap::draw()
gGL.color4f(1.f, 0.5f, 0.5f, 1.f);
}
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
static LLCachedControl<bool> s_fUseWorldMapTextures(gSavedSettings, "MiniMapWorldMapTextures") ;
bool fRenderTerrain = true;
if (s_fUseWorldMapTextures)
// Draw using texture.
gGL.getTexUnit(0)->bind(regionp->getLand().getSTexture());
gGL.begin(LLRender::TRIANGLES);
{
const LLViewerRegion::tex_matrix_t& tiles(regionp->getWorldMapTiles());
for (S32 i(0), scaled_width((S32)(real_width / region_width)), square_width(scaled_width * scaled_width);
i < square_width; ++i)
{
const F32 y = (F32)(i / scaled_width);
const F32 x = (F32)(i - y * scaled_width);
const F32 local_left(left + x * mScale);
const F32 local_right(local_left + mScale);
const F32 local_bottom(bottom + y * mScale);
const F32 local_top(local_bottom + mScale);
LLViewerTexture* pRegionImage = tiles[(U64)(x * scaled_width + y)];
if (pRegionImage)
{
// Ansariel: Map texture ends up without GLTexture after a teleport.
// Simply calling createGLTexture() should be fine here
// because the same method is called in getSTexture() in
// the render terrain path if for some reason no
// GLTexture exists.
if (!pRegionImage->hasGLTexture() && !pRegionImage->createGLTexture())
{
continue;
}
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(left, top);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(left, bottom);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(right, bottom);
gGL.getTexUnit(0)->bind(pRegionImage);
gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(local_left, local_top);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(local_left, local_bottom);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(local_right, local_bottom);
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(local_left, local_top);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(local_right, local_bottom);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(local_right, local_top);
}
gGL.end();
pRegionImage->setBoostLevel(LLViewerTexture::BOOST_MAP_VISIBLE);
fRenderTerrain = false;
}
}
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(left, top);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(right, bottom);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(right, top);
}
// [/SL:KB]
gGL.end();
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
if (fRenderTerrain)
{
// [/SL:KB]
// Draw using texture.
gGL.getTexUnit(0)->bind(regionp->getLand().getSTexture());
gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(left, top);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(left, bottom);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(right, bottom);
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(left, top);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(right, bottom);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(right, top);
}
gGL.end();
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
}
gGL.flush();
}
@ -1741,23 +1677,6 @@ void LLNetMap::handleShowProfile(const LLSD& sdParam) const
FSFloaterPlaceDetails::showPlaceDetails(sdParams);
}
}
bool LLNetMap::checkTextureType(const LLSD& sdParam) const
{
const std::string strParam = sdParam.asString();
bool fWorldMapTextures = gSavedSettings.getBOOL("MiniMapWorldMapTextures");
if ("maptile" == strParam)
return fWorldMapTextures;
else if ("terrain" == strParam)
return !fWorldMapTextures;
return false;
}
void LLNetMap::handleTextureType(const LLSD& sdParam) const
{
gSavedSettings.setBOOL("MiniMapWorldMapTextures", ("maptile" == sdParam.asString()));
}
// [/SL:KB]
bool LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask)

View File

@ -224,8 +224,6 @@ private:
void handleCam();
// [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3)
void handleOverlayToggle(const LLSD& sdParam);
bool checkTextureType(const LLSD& sdParam) const;
void handleTextureType(const LLSD& sdParam) const;
void setAvatarProfileLabel(const LLUUID& av_id, const LLAvatarName& avName, const std::string& item_name);
typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t;
avatar_name_cache_connection_map_t mAvatarNameCacheConnections;