r4019 - packages/trunk/cultivation/debian/patches

Miriam Ruiz baby-guest at alioth.debian.org
Fri Aug 31 20:33:57 UTC 2007


Author: baby-guest
Date: 2007-08-31 20:33:57 +0000 (Fri, 31 Aug 2007)
New Revision: 4019

Modified:
   packages/trunk/cultivation/debian/patches/mouse_pos.patch
Log:
Improved patch



Modified: packages/trunk/cultivation/debian/patches/mouse_pos.patch
===================================================================
--- packages/trunk/cultivation/debian/patches/mouse_pos.patch	2007-08-31 20:09:39 UTC (rev 4018)
+++ packages/trunk/cultivation/debian/patches/mouse_pos.patch	2007-08-31 20:33:57 UTC (rev 4019)
@@ -4,9 +4,9 @@
 
 Index: cultivation-8.20070809.dfsg1/game2/gameSource/game.cpp
 ===================================================================
---- cultivation-8.20070809.dfsg1.orig/game2/gameSource/game.cpp	2007-08-31 19:57:32.000000000 +0000
-+++ cultivation-8.20070809.dfsg1/game2/gameSource/game.cpp	2007-08-31 20:00:42.000000000 +0000
-@@ -2627,69 +2627,10 @@
+--- cultivation-8.20070809.dfsg1.orig/game2/gameSource/game.cpp	2007-08-31 20:12:42.000000000 +0000
++++ cultivation-8.20070809.dfsg1/game2/gameSource/game.cpp	2007-08-31 20:30:46.000000000 +0000
+@@ -2627,69 +2627,20 @@
  void GameSceneHandler::projectScreenPointIntoScene( int inX, int inY,
                                                      double *outSceneX,
                                                      double *outSceneY ) {
@@ -63,20 +63,27 @@
 -    
 -    // need to invert the resulting y and translate it for some reson
 -
--    Vector3D *viewPosition = screen->getViewPosition();
--
+     Vector3D *viewPosition = screen->getViewPosition();
++    double xsize,ysize,w=screen->getWidth(),h=screen->getHeight(), f=46, r;
++    r=w/h;
++    if (r>1.0 && r<1.5) f=46*(1.5-r)*2+48*(r-1)*2;
++    r=h/w;
++    if (r>1.0 && r<1.5) f=46*(1.5-r)*2+48*(r-1)*2;
++    xsize=ysize=f;
+ 
 -    yWorld = -yWorld + 2 * viewPosition->mY;
 -
 -    delete viewPosition;
 -
 -
--    
++    if (w>h) xsize=f*w/h;
++    if (w<h) ysize=f*h/w;
+     
 -    *outSceneX = xWorld;
 -    *outSceneY = yWorld;
-+		Vector3D *viewPosition = screen->getViewPosition();
-+		*outSceneX = viewPosition->mX-(inX-screen->getWidth()/2.0)*46.0/screen->getWidth();
-+		*outSceneY = viewPosition->mY-(inY-screen->getHeight()/2.0)*46.0/screen->getHeight();
-+		delete viewPosition;
++    *outSceneX = viewPosition->mX-(inX-w/2.0)*xsize/screen->getWidth();
++    *outSceneY = viewPosition->mY-(inY-h/2.0)*ysize/screen->getHeight();
++    delete viewPosition;
      }
  
  void GameSceneHandler::keyPressed(




More information about the Pkg-games-commits mailing list