Fixed a few GCC compiler warnings.

This commit is contained in:
Leon Styhre 2022-02-27 15:23:33 +01:00
parent 81291dcbbf
commit c96ab29e95
3 changed files with 5 additions and 10 deletions

View file

@ -531,7 +531,6 @@ void SystemView::updateGameCount()
std::stringstream ssGames;
std::stringstream ssFavorites;
bool games {false};
bool favorites {false};
if (!mCarousel->getSelected()->isGameSystem()) {
ss << "Configuration";
@ -553,7 +552,6 @@ void SystemView::updateGameCount()
ssGames << gameCount.first << " Game" << (gameCount.first == 1 ? " " : "s ");
ssFavorites << gameCount.second << " Favorite" << (gameCount.second == 1 ? "" : "s");
games = true;
favorites = true;
}
if (mLegacyMode) {

View file

@ -264,12 +264,12 @@ void CarouselComponent::render(const glm::mat4& parentTrans)
float distance = i - mCamOffset;
float scale {1.0f + ((mLogoScale - 1.0f) * (1.0f - fabs(distance)))};
float scale {1.0f + ((mLogoScale - 1.0f) * (1.0f - fabsf(distance)))};
scale = std::min(mLogoScale, std::max(1.0f, scale));
scale /= mLogoScale;
int opacity {
static_cast<int>(std::round(0x80 + ((0xFF - 0x80) * (1.0f - fabs(distance)))))};
static_cast<int>(std::round(0x80 + ((0xFF - 0x80) * (1.0f - fabsf(distance)))))};
opacity = std::max(static_cast<int>(0x80), opacity);
const std::shared_ptr<GuiComponent>& comp = mEntries.at(index).data.logo;
@ -504,11 +504,11 @@ void CarouselComponent::onCursorChanged(const CursorState& state)
// Find the shortest path to the target.
float endPos {target}; // Directly.
float dist {fabs(endPos - startPos)};
float dist {fabsf(endPos - startPos)};
if (fabs(target + posMax - startPos - mScrollVelocity) < dist)
if (fabsf(target + posMax - startPos - mScrollVelocity) < dist)
endPos = target + posMax; // Loop around the end (0 -> max).
if (fabs(target - posMax - startPos - mScrollVelocity) < dist)
if (fabsf(target - posMax - startPos - mScrollVelocity) < dist)
endPos = target - posMax; // Loop around the start (max - 1 -> -1).
// Make sure there are no reverse jumps between logos.

View file

@ -223,14 +223,11 @@ void VideoComponent::update(int deltaTime)
if (mWindow->getGameLaunchedState())
return;
bool playVideo {false};
if (!mIsPlaying && mConfig.startDelay == 0) {
startVideoStream();
}
else if (mStartTime == 0 || SDL_GetTicks() > mStartTime) {
mStartTime = 0;
playVideo = true;
startVideoStream();
}