diff --git a/es-app/assets/emulationstation.6.gz b/es-app/assets/emulationstation.6.gz index 2cda87e80..1d20e7570 100644 Binary files a/es-app/assets/emulationstation.6.gz and b/es-app/assets/emulationstation.6.gz differ diff --git a/es-app/src/views/GamelistLegacy.h b/es-app/src/views/GamelistLegacy.h index f6b319648..19c59a520 100644 --- a/es-app/src/views/GamelistLegacy.h +++ b/es-app/src/views/GamelistLegacy.h @@ -174,7 +174,7 @@ void GamelistView::legacyPopulateFields() mTextComponents.push_back(std::make_unique()); mTextComponents.back()->setThemeMetadata("text_md_name"); mTextComponents.back()->setPosition(mSize.x, mSize.y); - mTextComponents.back()->setFont(Font::get(FONT_SIZE_MEDIUM)); + mTextComponents.back()->setFont(Font::get(FONT_SIZE_MEDIUM_FIXED)); mTextComponents.back()->setHorizontalAlignment(ALIGN_CENTER); mTextComponents.back()->setColor(0xAAAAAAFF); mTextComponents.back()->setDefaultZIndex(40.0f); diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index cf4177428..9d8d89944 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -120,7 +120,9 @@ bool Window::init() if (mDefaultFonts.empty()) { mDefaultFonts.push_back(Font::get(FONT_SIZE_SMALL)); mDefaultFonts.push_back(Font::get(FONT_SIZE_MEDIUM)); + mDefaultFonts.push_back(Font::get(FONT_SIZE_MEDIUM_FIXED)); mDefaultFonts.push_back(Font::get(FONT_SIZE_LARGE)); + mDefaultFonts.push_back(Font::get(FONT_SIZE_LARGE_FIXED)); } if (mRenderer->getIsVerticalOrientation()) diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index d361ffe7d..91b657476 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -30,7 +30,7 @@ ComponentList::ComponentList() { // Adjust the padding relative to the aspect ratio and screen resolution to make it look // coherent regardless of screen type. The 1.778 aspect ratio value is the 16:9 reference. - float aspectValue {1.778f / mRenderer->getScreenAspectRatio()}; + const float aspectValue {1.778f / mRenderer->getScreenAspectRatio()}; mHorizontalPadding = TOTAL_HORIZONTAL_PADDING_PX * aspectValue * mRenderer->getScreenWidthModifier(); @@ -140,7 +140,7 @@ void ComponentList::update(int deltaTime) const float totalHeight {getTotalRowHeight()}; // Scroll indicator logic, used by ScrollIndicatorComponent. - bool scrollIndicatorChanged = false; + bool scrollIndicatorChanged {false}; if (totalHeight > mSize.y) { if (mCameraOffset == 0) { @@ -218,7 +218,7 @@ void ComponentList::onCursorChanged(const CursorState& state) // Update the selector bar position. // In the future this might be animated. mSelectorBarOffset = 0; - for (int i = 0; i < mCursor; ++i) + for (int i {0}; i < mCursor; ++i) mSelectorBarOffset += getRowHeight(mEntries.at(i).data); updateCameraOffset(); @@ -244,8 +244,8 @@ void ComponentList::updateCameraOffset() // Move the camera to scroll. const float totalHeight {getTotalRowHeight()}; if (totalHeight > mSize.y) { - float target {mSelectorBarOffset + getRowHeight(mEntries.at(mCursor).data) / 2.0f - - (mSize.y / 2.0f)}; + const float target {mSelectorBarOffset + getRowHeight(mEntries.at(mCursor).data) / 2.0f - + (mSize.y / 2.0f)}; // Clamp the camera to prevent a fraction of a row from being displayed. mCameraOffset = 0.0f; @@ -288,7 +288,14 @@ void ComponentList::render(const glm::mat4& parentTrans) glm::mat4 trans {parentTrans * getTransform()}; + // TODO: Fix the rounding error properly instead of working around it. + const float roundErrorComp { + static_cast(static_cast(mSize.y) % + static_cast(getRowHeight(mEntries.at(0).data))) - + 2.0f}; + // Clip everything to be inside our bounds. + glm::vec3 dim {mSize.x, mSize.y - roundErrorComp, 0.0f}; glm::vec3 dim {mSize.x, mSize.y, 0.0f}; dim.x = (trans[0].x * dim.x + trans[3].x) - trans[3].x; dim.y = (trans[1].y * dim.y + trans[3].y) - trans[3].y; @@ -309,7 +316,7 @@ void ComponentList::render(const glm::mat4& parentTrans) // Draw our entries. std::vector drawAfterCursor; bool drawAll {false}; - for (size_t i = 0; i < mEntries.size(); ++i) { + for (size_t i {0}; i < mEntries.size(); ++i) { if (mLoopRows && mFocused && mLoopOffset > 0) { loopTrans = @@ -405,7 +412,7 @@ void ComponentList::render(const glm::mat4& parentTrans) // Draw separators. float y {0.0f}; - for (unsigned int i = 0; i < mEntries.size(); ++i) { + for (unsigned int i {0}; i < mEntries.size(); ++i) { mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenHeightModifier(), 0xC6C7C6FF, 0xC6C7C6FF, false, mOpacity, mDimming); y += getRowHeight(mEntries.at(i).data); @@ -420,7 +427,7 @@ float ComponentList::getRowHeight(const ComponentListRow& row) const { // Returns the highest component height found in the row. float height {0.0f}; - for (unsigned int i = 0; i < row.elements.size(); ++i) { + for (unsigned int i {0}; i < row.elements.size(); ++i) { if (row.elements.at(i).component->getSize().y > height) height = row.elements.at(i).component->getSize().y; } @@ -448,7 +455,7 @@ void ComponentList::updateElementPosition(const ComponentListRow& row) float rowHeight {getRowHeight(row)}; float x {mHorizontalPadding / 2.0f}; - for (unsigned int i = 0; i < row.elements.size(); ++i) { + for (unsigned int i {0}; i < row.elements.size(); ++i) { const auto comp = row.elements.at(i).component; // Center vertically.