Pass through the code to address clang-tidy linting (#3083)

This commit is contained in:
Alexander Bock
2024-03-17 00:58:50 +01:00
committed by GitHub
parent 75681d1d4c
commit 2759c00e4b
457 changed files with 6639 additions and 6519 deletions

View File

@@ -77,19 +77,18 @@ RenderablePlaneImageOnline::RenderablePlaneImageOnline(
}
// Shape the plane based on the aspect ration of the image
glm::vec2 textureDim = glm::vec2(_texture->dimensions());
const glm::vec2 textureDim = glm::vec2(_texture->dimensions());
if (_textureDimensions != textureDim) {
float aspectRatio = textureDim.x / textureDim.y;
float planeAspectRatio = _size.value().x / _size.value().y;
const float aspectRatio = textureDim.x / textureDim.y;
const float planeAspectRatio = _size.value().x / _size.value().y;
if (std::abs(planeAspectRatio - aspectRatio) >
std::numeric_limits<float>::epsilon())
{
glm::vec2 newSize =
_size =
aspectRatio > 0.f ?
glm::vec2(_size.value().x * aspectRatio, _size.value().y) :
glm::vec2(_size.value().x, _size.value().y * aspectRatio);
_size = newSize;
}
_textureDimensions = textureDim;
@@ -129,7 +128,7 @@ void RenderablePlaneImageOnline::update(const UpdateData& data) {
}
if (_imageFuture.valid() && DownloadManager::futureReady(_imageFuture)) {
DownloadManager::MemoryFile imageFile = _imageFuture.get();
const DownloadManager::MemoryFile imageFile = _imageFuture.get();
if (imageFile.corrupted) {
LERRORC(
@@ -165,19 +164,18 @@ void RenderablePlaneImageOnline::update(const UpdateData& data) {
}
// Shape the plane based on the aspect ration of the image
glm::vec2 textureDim = glm::vec2(_texture->dimensions());
const glm::vec2 textureDim = glm::vec2(_texture->dimensions());
if (_textureDimensions != textureDim) {
float aspectRatio = textureDim.x / textureDim.y;
float planeAspectRatio = _size.value().x / _size.value().y;
const float aspectRatio = textureDim.x / textureDim.y;
const float planeAspectRatio = _size.value().x / _size.value().y;
if (std::abs(planeAspectRatio - aspectRatio) >
std::numeric_limits<float>::epsilon())
{
glm::vec2 newSize =
_size =
aspectRatio > 0.f ?
glm::vec2(_size.value().x * aspectRatio, _size.value().y) :
glm::vec2(_size.value().x, _size.value().y * aspectRatio);
_size = newSize;
}
_textureDimensions = textureDim;