Author: ArcRiley
Date: 2008-07-15 02:47:34 -0400 (Tue, 15 Jul 2008)
New Revision: 1315

Modified:
   trunk/pysoy/src/scenes/Landscape.pym
Log:
Ticket #929:
  * more minor cleanup


Modified: trunk/pysoy/src/scenes/Landscape.pym
===================================================================
--- trunk/pysoy/src/scenes/Landscape.pym        2008-07-15 06:42:45 UTC (rev 
1314)
+++ trunk/pysoy/src/scenes/Landscape.pym        2008-07-15 06:47:34 UTC (rev 
1315)
@@ -86,21 +86,17 @@
 
   cdef void _createArrays(self) :
     cdef int _i, _j, _currentLoop, _offset
-    cdef float _x, _y, _z
     cdef unsigned short _a, _b, _c, _d
     # set up the vert array
     for _i from 0 <= _i < self._heightmapTex._height :
       for _j from 0 <= _j < self._heightmapTex._width :
         _offset = self._heightmapTex._width*_i+_j
-        # Get the y value here
-        _y = self._heightmapTex._texels[_offset] / 255.0 * \
-             self._height + self._position[1]
-        #divide by width to get what percentage it is of width, then multiply 
by width wanted
-        _x =  _j * self._width / self._heightmapTex._width  + self._position[0]
-        _z =  _i * self._depth / self._heightmapTex._height + self._position[2]
-        self._vertArray[_offset].px = _x
-        self._vertArray[_offset].py = _y
-        self._vertArray[_offset].pz = _z
+        self._vertArray[_offset].px = <float> _j / self._heightmapTex._width \
+                                      * self._width + self._position[0]
+        self._vertArray[_offset].py = self._heightmapTex._texels[_offset] \
+                                      /255.0 * self._height + self._position[1]
+        self._vertArray[_offset].pz = <float> _i / self._heightmapTex._height \
+                                      * self._depth + self._position[2]
         #all below need to be calculated CORRECTLY!
         self._vertArray[_offset].nx = 0
         self._vertArray[_offset].ny = 1 # Up
@@ -108,8 +104,8 @@
         self._vertArray[_offset].tx = 0
         self._vertArray[_offset].ty = 1
         self._vertArray[_offset].tz = 0
-        self._vertArray[_offset].ux = 0
-        self._vertArray[_offset].uy = 1
+        self._vertArray[_offset].ux = 1
+        self._vertArray[_offset].uy = 0
         self._vertArray[_offset].uz = 0
     #clear vars for next loops!
     _currentLoop = 0

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to