[colobot] 90/145: Don't scale mouse cursor with resolution

Didier Raboud odyx at moszumanska.debian.org
Mon Jul 11 12:56:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit aa159bc9b07d7f0dd776ec5a5a398f5e40a12c71
Author: krzys-h <krzys_h at interia.pl>
Date:   Sat May 28 00:43:14 2016 +0200

    Don't scale mouse cursor with resolution
---
 src/graphics/engine/engine.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 5e773dc..d866673 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -177,7 +177,7 @@ CEngine::CEngine(CApplication *app, CSystemUtils* systemUtils)
     m_mice[ENG_MOUSE_SCROLLU] = EngineMouse(28, 29, 45, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::Point( 9.0f,  2.0f));
     m_mice[ENG_MOUSE_SCROLLD] = EngineMouse(30, 31, 46, ENG_RSTATE_TTEXTURE_BLACK, ENG_RSTATE_TTEXTURE_WHITE, Math::Point( 9.0f, 17.0f));
 
-    m_mouseSize    = Math::Point(0.04f, 0.04f * (800.0f / 600.0f));
+    m_mouseSize    = Math::Point(48.f/m_size.x, 48.f/m_size.x * (800.f/600.f));
     m_mouseType    = ENG_MOUSE_NORM;
 
     m_fpsCounter = 0;
@@ -280,7 +280,7 @@ void CEngine::SetTerrain(CTerrain* terrain)
 bool CEngine::Create()
 {
     m_size = m_app->GetVideoConfig().size;
-    m_mouseSize = Math::Point(0.04f, 0.04f * (static_cast<float>(m_size.x) / static_cast<float>(m_size.y)));
+    m_mouseSize = Math::Point(48.f/m_size.x, 48.f/m_size.x * (static_cast<float>(m_size.x) / static_cast<float>(m_size.y)));
 
     // Use the setters to set defaults, because they automatically disable what is not supported
     SetShadowMapping(m_shadowMapping);
@@ -359,7 +359,7 @@ void CEngine::Destroy()
 void CEngine::ResetAfterVideoConfigChanged()
 {
     m_size = m_app->GetVideoConfig().size;
-    m_mouseSize = Math::Point(0.04f, 0.04f * (static_cast<float>(m_size.x) / static_cast<float>(m_size.y)));
+    m_mouseSize = Math::Point(48.f/m_size.x, 48.f/m_size.x * (static_cast<float>(m_size.x) / static_cast<float>(m_size.y)));
 
     // Update the camera projection matrix for new aspect ratio
     ApplyChange();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list