diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 136: SceneDesktop: Use new features in LibMatrix to simplify some vector expressions.

Message ID 20110919153712.30280.640.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org Sept. 19, 2011, 3:37 p.m. UTC
------------------------------------------------------------
revno: 136
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Mon 2011-09-19 18:34:58 +0300
message:
  SceneDesktop: Use new features in LibMatrix to simplify some vector expressions.
modified:
  src/scene-desktop.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/scene-desktop.cpp'
--- src/scene-desktop.cpp	2011-09-13 16:31:11 +0000
+++ src/scene-desktop.cpp	2011-09-19 15:34:58 +0000
@@ -252,8 +252,7 @@ 
      */
     LibMatrix::vec2 normalize_position(LibMatrix::vec2& pos)
     {
-        return LibMatrix::vec2(2.0 * pos.x() / size_.x() - 1.0,
-                               2.0 * pos.y() / size_.y() - 1.0);
+        return pos * 2.0 / size_ - 1.0;
     }
 
     /** 
@@ -261,8 +260,7 @@ 
      */
     LibMatrix::vec2 normalize_texcoord(LibMatrix::vec2& pos)
     {
-        return LibMatrix::vec2(pos.x() / size_.x(),
-                               pos.y() / size_.y());
+        return pos / size_;
     }