mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-19 13:25:38 +00:00
Fixed an issue where multiple carousel logos were rendered when there was only a single system.
This commit is contained in:
parent
86ad917bc8
commit
56d1b8f83d
|
@ -242,10 +242,18 @@ void CarouselComponent::render(const glm::mat4& parentTrans)
|
||||||
|
|
||||||
int center {static_cast<int>(mCamOffset)};
|
int center {static_cast<int>(mCamOffset)};
|
||||||
int logoInclusion {static_cast<int>(std::ceil(mMaxLogoCount / 2.0f))};
|
int logoInclusion {static_cast<int>(std::ceil(mMaxLogoCount / 2.0f))};
|
||||||
|
bool singleEntry {mEntries.size() == 1};
|
||||||
|
|
||||||
for (int i = center - logoInclusion; i < center + logoInclusion + 2; ++i) {
|
for (int i = center - logoInclusion; i < center + logoInclusion + 2; ++i) {
|
||||||
int index {i};
|
int index {i};
|
||||||
|
|
||||||
|
// If there is only a single system, then only render the logo once (in the center).
|
||||||
|
if (singleEntry) {
|
||||||
|
mEntries.at(0).data.logo->render(
|
||||||
|
glm::translate(carouselTrans, glm::vec3 {0 + xOff, 0 + yOff, 0.0f}));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
while (index < 0)
|
while (index < 0)
|
||||||
index += static_cast<int>(mEntries.size());
|
index += static_cast<int>(mEntries.size());
|
||||||
while (index >= static_cast<int>(mEntries.size()))
|
while (index >= static_cast<int>(mEntries.size()))
|
||||||
|
|
Loading…
Reference in a new issue