Commits

Anonymous committed 999340e

Fixed slicing issues as reported by Lenard. Fixed surface lock tests.

Comments (0)

Files changed (3)

 /* BLEND_ADD is an alias for BLEND_RGB_ADD
 */
 
-#define PYGAME_BLEND_ADD  0x1
-#define PYGAME_BLEND_SUB  0x2
-#define PYGAME_BLEND_MULT 0x3
-#define PYGAME_BLEND_MIN  0x4
-#define PYGAME_BLEND_MAX  0x5
-
 #define PYGAME_BLEND_RGB_ADD  0x1
 #define PYGAME_BLEND_RGB_SUB  0x2
 #define PYGAME_BLEND_RGB_MULT 0x3
 #define PYGAME_BLEND_RGB_MIN  0x4
 #define PYGAME_BLEND_RGB_MAX  0x5
 
+#define PYGAME_BLEND_ADD  PYGAME_BLEND_RGB_ADD
+#define PYGAME_BLEND_SUB  PYGAME_BLEND_RGB_SUB
+#define PYGAME_BLEND_MULT PYGAME_BLEND_RGB_MULT
+#define PYGAME_BLEND_MIN  PYGAME_BLEND_RGB_MIN
+#define PYGAME_BLEND_MAX  PYGAME_BLEND_RGB_MAX
+
 #define PYGAME_BLEND_RGBA_ADD  0x6
 #define PYGAME_BLEND_RGBA_SUB  0x7
 #define PYGAME_BLEND_RGBA_MULT 0x8
         ystart = array->ystart + low * array->ystep;
         xlen = array->xlen;
         ylen = ABS (high - low);
-        ystep = 1;
+        ystep = array->ystep;
         xstep = array->xstep;
         padding = array->padding;
     }
         ystart = array->ystart;
         xlen = ABS (high - low);
         ylen = array->ylen;
-        xstep = 1;
+        xstep = array->xstep;
         ystep = array->ystep;
         padding = array->padding;
     }
         ystart = array->ystart + low * array->ystep;
         xlen = array->xlen;
         ylen = ABS (high - low);
-        ystep = 1;
+        ystep = array->ystep;
         xstep = array->xstep;
         padding = array->padding;
     }
         ystart = array->ystart;
         xlen = ABS (high - low);
         ylen = array->ylen;
-        xstep = 1;
+        xstep = array->xstep;
         ystep = array->ystep;
         padding = array->padding;
     }

test/surflock_test.py

         self.assertEquals (sf.get_locks (), ())
 
     def test_surfarray_ref (self):
-        sf = pygame.Surface ((5, 5))
+        sf = pygame.Surface ((5, 5), 32)
         for atype in pygame.surfarray.get_arraytypes ():
             pygame.surfarray.use_arraytype (atype)