diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 876a43341..4c01f5b06 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -1194,14 +1194,16 @@ void SystemView::renderElements(const glm::mat4& parentTrans, bool abovePrimary) mCarousel->getType() == CarouselComponent::CarouselType::HORIZONTAL_WHEEL) elementTrans = glm::translate( - elementTrans, glm::vec3 {(i - mCamOffset) * mSize.x, 0.0f, 0.0f}); + elementTrans, + glm::round(glm::vec3 {(i - mCamOffset) * mSize.x, 0.0f, 0.0f})); else elementTrans = glm::translate( - elementTrans, glm::vec3 {0.0f, (i - mCamOffset) * mSize.y, 0.0f}); + elementTrans, + glm::round(glm::vec3 {0.0f, (i - mCamOffset) * mSize.y, 0.0f})); } else if (mTextList != nullptr) { - elementTrans = glm::translate(elementTrans, - glm::vec3 {0.0f, (i - mCamOffset) * mSize.y, 0.0f}); + elementTrans = glm::translate( + elementTrans, glm::round(glm::vec3 {0.0f, (i - mCamOffset) * mSize.y, 0.0f})); } mRenderer->pushClipRect( diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 79d446853..e29c5fd7e 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -354,7 +354,7 @@ void ViewController::goToSystemView(SystemData* system, bool playTransition) // Application startup animation. if (applicationStartup) { - mCamera = glm::translate(mCamera, -mCurrentView->getPosition()); + mCamera = glm::translate(mCamera, glm::round(-mCurrentView->getPosition())); if (Settings::getInstance()->getString("TransitionStyle") == "slide") { if (getSystemListView()->getPrimaryType() == SystemView::PrimaryType::CAROUSEL) { if (getSystemListView()->getCarouselType() == @@ -540,7 +540,7 @@ void ViewController::goToGamelist(SystemData* system) // Application startup animation, if starting in a gamelist rather than in the system view. if (mState.viewing == NOTHING) { - mCamera = glm::translate(mCamera, -mCurrentView->getPosition()); + mCamera = glm::translate(mCamera, glm::round(-mCurrentView->getPosition())); if (Settings::getInstance()->getString("TransitionStyle") == "slide") { mCamera[3].y -= Renderer::getScreenHeight(); updateHelpPrompts(); diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index bb2333c0c..67afb21b3 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -229,9 +229,9 @@ const glm::mat4& GuiComponent::getTransform() mTransform = glm::translate(mTransform, glm::vec3 {xOff, yOff, 0.0f}); } - mTransform = - glm::translate(mTransform, glm::vec3 {std::round(mOrigin.x * mSize.x * -1.0f), - std::round(mOrigin.y * mSize.y * -1.0f), 0.0f}); + mTransform = glm::translate( + mTransform, + glm::round(glm::vec3 {mOrigin.x * mSize.x * -1.0f, mOrigin.y * mSize.y * -1.0f, 0.0f})); return mTransform; } diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 843c2eb47..81e54aafb 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -613,7 +613,7 @@ void Window::renderLoadingScreen(std::string text) float x {std::round((Renderer::getScreenWidth() - cache->metrics.size.x) / 2.0f)}; float y {std::round(Renderer::getScreenHeight() * 0.835f)}; - trans = glm::translate(trans, glm::vec3 {x, y, 0.0f}); + trans = glm::translate(trans, glm::round(glm::vec3 {x, y, 0.0f})); mRenderer->setMatrix(trans); font->renderTextCache(cache); delete cache; diff --git a/es-core/src/animations/MoveCameraAnimation.h b/es-core/src/animations/MoveCameraAnimation.h index ca3e47e3d..58ddfebe8 100644 --- a/es-core/src/animations/MoveCameraAnimation.h +++ b/es-core/src/animations/MoveCameraAnimation.h @@ -27,9 +27,9 @@ public: void apply(float t) override { t -= 1; - cameraPosition[3].x = -glm::mix(-mCameraStart[3].x, mTarget.x, t * t * t + 1); - cameraPosition[3].y = -glm::mix(-mCameraStart[3].y, mTarget.y, t * t * t + 1); - cameraPosition[3].z = -glm::mix(-mCameraStart[3].z, mTarget.z, t * t * t + 1); + cameraPosition[3].x = std::round(-glm::mix(-mCameraStart[3].x, mTarget.x, t * t * t + 1)); + cameraPosition[3].y = std::round(-glm::mix(-mCameraStart[3].y, mTarget.y, t * t * t + 1)); + cameraPosition[3].z = std::round(-glm::mix(-mCameraStart[3].z, mTarget.z, t * t * t + 1)); } private: diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index f5fb3afb7..0fcc5f782 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -180,7 +180,7 @@ void DateTimeEditComponent::render(const glm::mat4& parentTrans) if (mAlignRight) off.x += referenceSize - mTextCache->metrics.size.x; - trans = glm::translate(trans, off); + trans = glm::translate(trans, glm::round(off)); mRenderer->setMatrix(trans); diff --git a/es-core/src/components/TextEditComponent.cpp b/es-core/src/components/TextEditComponent.cpp index df9653c77..29f6c7eb8 100644 --- a/es-core/src/components/TextEditComponent.cpp +++ b/es-core/src/components/TextEditComponent.cpp @@ -295,7 +295,8 @@ void TextEditComponent::render(const glm::mat4& parentTrans) // Text + cursor rendering. // Offset into our "text area" (padding). - trans = glm::translate(trans, glm::vec3 {getTextAreaPos().x, getTextAreaPos().y, 0.0f}); + trans = + glm::translate(trans, glm::round(glm::vec3 {getTextAreaPos().x, getTextAreaPos().y, 0.0f})); glm::ivec2 clipPos {static_cast(trans[3].x), static_cast(trans[3].y)}; // Use "text area" size for clipping. @@ -307,7 +308,7 @@ void TextEditComponent::render(const glm::mat4& parentTrans) static_cast(dimScaled.y - trans[3].y)}; mRenderer->pushClipRect(clipPos, clipDim); - trans = glm::translate(trans, glm::vec3 {-mScrollOffset.x, -mScrollOffset.y, 0.0f}); + trans = glm::translate(trans, glm::round(glm::vec3 {-mScrollOffset.x, -mScrollOffset.y, 0.0f})); mRenderer->setMatrix(trans); if (mTextCache)