[colobot] 33/62: Fix horizontal scrolling of background images.

Didier Raboud odyx at moszumanska.debian.org
Fri Nov 10 11:53:57 UTC 2017


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

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

commit 8b0ccf6667e0ddaba0fae6ad6f2ddc5a1d6bc680
Author: immibis <immibis at gmail.com>
Date:   Sat Aug 5 19:54:13 2017 +1200

    Fix horizontal scrolling of background images.
---
 src/graphics/engine/engine.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index a6d21cd..74c6179 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -4741,8 +4741,9 @@ void CEngine::DrawBackgroundImage()
         if (a >  Math::PI/4.0f)  a =  Math::PI/4.0f;
         if (a < -Math::PI/4.0f)  a = -Math::PI/4.0f;
 
-        u1 = -m_eyeDirH/Math::PI;
-        u2 = u1+1.0f/Math::PI;
+        // Note the background covers Math::PI radians, i.e. it repeats twice per rotation!
+        u1 = (-m_eyeDirH - GetHFovAngle()/2.0f) / Math::PI;
+        u2 = u1 + (GetHFovAngle() / Math::PI);
 
         v1 = (1.0f-h)*(0.5f+a/(2.0f*Math::PI/4.0f))+0.1f;
         v2 = v1+h;

-- 
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