Skip to content

Commit

Permalink
Remove deprecated functions and enums (#1020)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Jul 26, 2024
1 parent 97ada56 commit a493a15
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 101 deletions.
11 changes: 0 additions & 11 deletions ogre2/include/gz/rendering/ogre2/Ogre2GzOgreRenderingMode.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ namespace gz
{
/// \brief Normal rendering
GORM_NORMAL = 0,
IORM_NORMAL = 0, // TODO(CH3): Deprecated. Remove on tock.

/// \brief Render a solid color explicit per object.
/// Used by e.g. Segmentation camera mode
GORM_SOLID_COLOR = 1,
IORM_SOLID_COLOR = 1, // TODO(CH3): Deprecated. Remove on tock.

/// \brief Like GORM_SOLID_COLOR, but if CustomParameter 2u
/// is present, raw diffuse texture will be multiplied against
Expand All @@ -48,19 +46,10 @@ namespace gz
///
/// Used by thermal camera
GORM_SOLID_THERMAL_COLOR_TEXTURED = 2,
// TODO(CH3): Deprecated. Remove on tock.
IORM_SOLID_THERMAL_COLOR_TEXTURED = 2,

/// \brief Total number of rendering modes
GORM_COUNT = 3,
IORM_COUNT = 3, // TODO(CH3): Deprecated. Remove on tock.
};
// TODO(CH3): Deprecated. Remove on tock.
#ifdef _WIN32
using IgnOgreRenderingMode = GzOgreRenderingMode;
#else
using IgnOgreRenderingMode GZ_DEPRECATED(7) = GzOgreRenderingMode;
#endif
} // namespace GZ_RENDERING_VERSION_NAMESPACE
} // namespace rendering
} // namespace gz
Expand Down
11 changes: 0 additions & 11 deletions ogre2/include/gz/rendering/ogre2/Ogre2RenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ namespace gz
/// \return a list of FSAA levels
public: std::vector<unsigned int> FSAALevels() const;

/// \brief Deprecated. Use SphericalClipMinDistance instead
public: Ogre2GzHlmsSphericalClipMinDistance GZ_DEPRECATED(7) &
HlmsCustomizations();

/// \brief Retrieves Hlms customizations for tweaking them
/// \return Ogre HLMS customizations
public: Ogre2GzHlmsSphericalClipMinDistance &SphericalClipMinDistance();
Expand All @@ -201,13 +197,6 @@ namespace gz
/// and see Ogre::GzHlmsPbs
/// \param[in] renderingMode
public: void SetGzOgreRenderingMode(GzOgreRenderingMode renderingMode);
// TODO(CH3): Deprecated. Remove on tock.
public:
inline void GZ_DEPRECATED(7) SetIgnOgreRenderingMode(
GzOgreRenderingMode renderingMode)
{
return SetGzOgreRenderingMode(renderingMode);
}

/// \internal
/// \brief Get a pointer to the Pbs listener that adds terra shadows.
Expand Down
2 changes: 1 addition & 1 deletion ogre2/src/Ogre2GpuRays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void Ogre2LaserRetroMaterialSwitcher::passPreExecute(
//
// material may be a nullptr if we called setMaterial directly
// (i.e. it's not using Ogre2Material interface).
// In those cases we fallback to PBS in the current IORM mode.
// In those cases we fallback to PBS in the current GORM mode.
auto material = Ogre::MaterialManager::getSingleton().getByName(
subItem->getMaterial()->getName() + "_solid",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Expand Down
2 changes: 1 addition & 1 deletion ogre2/src/Ogre2MaterialSwitcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void Ogre2MaterialSwitcher::cameraPreRenderScene(
//
// material may be a nullptr if we called setMaterial directly
// (i.e. it's not using Ogre2Material interface).
// In those cases we fallback to PBS in the current IORM mode.
// In those cases we fallback to PBS in the current GORM mode.
auto material = Ogre::MaterialManager::getSingleton().getByName(
subItem->getMaterial()->getName() + "_solid",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Expand Down
32 changes: 0 additions & 32 deletions ogre2/src/Ogre2RenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -873,19 +873,6 @@ void Ogre2RenderEngine::RegisterHlms()
{
const char *env = std::getenv("GZ_RENDERING_RESOURCE_PATH");

// TODO(CH3): Deprecated. Remove on tock.
if (!env)
{
env = std::getenv("IGN_RENDERING_RESOURCE_PATH");

if (env)
{
gzwarn << "Using deprecated environment variable "
<< "[IGN_RENDERING_RESOURCE_PATH]. Please use "
<< "[GZ_RENDERING_RESOURCE_PATH] instead." << std::endl;
}
}

std::string resourcePath = (env) ? std::string(env) :
gz::rendering::getResourcePath();

Expand Down Expand Up @@ -1077,19 +1064,6 @@ void Ogre2RenderEngine::CreateResources()
{
const char *env = std::getenv("GZ_RENDERING_RESOURCE_PATH");

// TODO(CH3): Deprecated. Remove on tock.
if (!env)
{
env = std::getenv("IGN_RENDERING_RESOURCE_PATH");

if (env)
{
gzwarn << "Using deprecated environment variable "
<< "[IGN_RENDERING_RESOURCE_PATH]. Please use "
<< "[GZ_RENDERING_RESOURCE_PATH] instead." << std::endl;
}
}

std::string resourcePath = (env) ? std::string(env) :
gz::rendering::getResourcePath();
// install path
Expand Down Expand Up @@ -1431,12 +1405,6 @@ std::vector<unsigned int> Ogre2RenderEngine::FSAALevels() const
return this->dataPtr->fsaaLevels;
}

/////////////////////////////////////////////////
Ogre2GzHlmsSphericalClipMinDistance& Ogre2RenderEngine::HlmsCustomizations()
{
return this->dataPtr->sphericalClipMinDistance;
}

/////////////////////////////////////////////////
Ogre2GzHlmsSphericalClipMinDistance& Ogre2RenderEngine::
SphericalClipMinDistance()
Expand Down
7 changes: 0 additions & 7 deletions ogre2/src/Ogre2RenderTarget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -945,16 +945,9 @@ void Ogre2RenderTarget::RebuildMaterial()
//////////////////////////////////////////////////
// Ogre2RenderTexture
//////////////////////////////////////////////////
#ifndef _WIN32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
Ogre2RenderTexture::Ogre2RenderTexture()
{
}
#ifndef _WIN32
#pragma GCC diagnostic pop
#endif

//////////////////////////////////////////////////
Ogre2RenderTexture::~Ogre2RenderTexture()
Expand Down
2 changes: 1 addition & 1 deletion ogre2/src/Ogre2SegmentationMaterialSwitcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void Ogre2SegmentationMaterialSwitcher::cameraPreRenderScene(
//
// material may be a nullptr if we called setMaterial directly
// (i.e. it's not using Ogre2Material interface).
// In those cases we fallback to PBS in the current IORM mode.
// In those cases we fallback to PBS in the current GORM mode.
auto material = Ogre::MaterialManager::getSingleton().getByName(
subItem->getMaterial()->getName() + "_solid",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Expand Down
4 changes: 2 additions & 2 deletions ogre2/src/Ogre2ThermalCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void Ogre2ThermalCameraMaterialSwitcher::cameraPreRenderScene(
//
// material may be a nullptr if we called setMaterial directly
// (i.e. it's not using Ogre2Material interface).
// In those cases we fallback to PBS in the current IORM mode.
// In those cases we fallback to PBS in the current GORM mode.
auto material = Ogre::MaterialManager::getSingleton().getByName(
subItem->getMaterial()->getName() + "_solid",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Expand Down Expand Up @@ -504,7 +504,7 @@ void Ogre2ThermalCameraMaterialSwitcher::cameraPreRenderScene(
//
// material may be a nullptr if we called setMaterial directly
// (i.e. it's not using Ogre2Material interface).
// In those cases we fallback to PBS in the current IORM mode.
// In those cases we fallback to PBS in the current GORM mode.
auto material = Ogre::MaterialManager::getSingleton().getByName(
subItem->getMaterial()->getName() + "_solid",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Expand Down
24 changes: 3 additions & 21 deletions src/RenderEngineManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ class gz::rendering::RenderEngineManagerPrivate
/// \brief Plugin loader for managing render engine plugin libraries.
public: gz::plugin::Loader pluginLoader;

/// \brief Deprecated environment variable which holds paths to look for
/// plugins
public: std::string pluginPathEnvDeprecated = "IGN_RENDERING_PLUGIN_PATH";

/// \brief Environment variable which holds paths to look for plugins
public: std::string pluginPathEnv = "GZ_RENDERING_PLUGIN_PATH";

Expand Down Expand Up @@ -475,23 +471,9 @@ bool RenderEngineManagerPrivate::LoadEnginePlugin(
auto pathToLib = systemPaths.FindSharedLibrary(_filename);
if (pathToLib.empty())
{
// Try deprecated environment variable
common::SystemPaths systemPathsDep;
systemPathsDep.SetPluginPathEnv(this->pluginPathEnvDeprecated);
pathToLib = systemPathsDep.FindSharedLibrary(_filename);
if (pathToLib.empty())
{
gzerr << "Failed to load plugin [" << _filename <<
"] : couldn't find shared library." << std::endl;
return false;
}
else
{
gzwarn << "Found plugin [" << _filename
<< "] using deprecated environment variable ["
<< this->pluginPathEnvDeprecated << "]. Please use ["
<< this->pluginPathEnv << "] instead." << std::endl;
}
gzerr << "Failed to load plugin [" << _filename <<
"] : couldn't find shared library." << std::endl;
return false;
}

// Load plugin
Expand Down
14 changes: 0 additions & 14 deletions src/base/BaseScene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1655,20 +1655,6 @@ void BaseScene::CreateMaterials()
material->SetLightingEnabled(true);

const char *env = std::getenv("GZ_RENDERING_RESOURCE_PATH");

// TODO(CH3): Deprecated. Remove on tock.
if (!env)
{
env = std::getenv("IGN_RENDERING_RESOURCE_PATH");

if (env)
{
gzwarn << "Using deprecated environment variable "
<< "[IGN_RENDERING_RESOURCE_PATH]. Please use "
<< "[GZ_RENDERING_RESOURCE_PATH] instead." << std::endl;
}
}

std::string resourcePath = (env) ? std::string(env) :
gz::rendering::getResourcePath();

Expand Down

0 comments on commit a493a15

Please sign in to comment.