Commits

Marcus von Appen committed 4aab605

- fixed issue #52: pass the correct arguments to the internals of sdl2.ext.Renderer.fill(), sdl2.ext.Renderer.draw_rects() and sdl2.ext.Renderer.draw_points()

  • Participants
  • Parent commits 3a191ff

Comments (0)

Files changed (2)

sdl2/ext/sprite.py

                 tmp = self.color
                 self.color = color
             ptr = cast(ptlist, POINTER(SDL_Point))
-            ret = render.SDL_RenderDrawPoints(self.renderer, ptr)
+            ret = render.SDL_RenderDrawPoints(self.renderer, ptr, pcount / 2)
             if color is not None:
                 self.color = tmp
             if ret == -1:
             if color is not None:
                 tmp = self.color
                 self.color = color
-            ptr = cast(rlist, SDL_Rect)
-            ret = render.SDL_RenderDrawRects(self.renderer, ptr)
+            ptr = cast(rlist, POINTER(SDL_Rect))
+            ret = render.SDL_RenderDrawRects(self.renderer, ptr, len(rects))
             if color is not None:
                 self.color = tmp
             if ret == -1:
             if color is not None:
                 tmp = self.color
                 self.color = color
-            ptr = cast(rlist, SDL_Rect)
-            ret = render.SDL_RenderFillRects(self.renderer, ptr)
+            ptr = cast(rlist, POINTER(SDL_Rect))
+            ret = render.SDL_RenderFillRects(self.renderer, ptr, len(rects))
             if color is not None:
                 self.color = tmp
             if ret == -1:

sdl2/test/sdl2ext_sprite_test.py

         view = sdl2ext.PixelView(surface)
         self.check_pixels(view, 128, 128, sp, 0x0000FF, (0x0,))
         del view
+        sdl2ext.fill(surface, 0x0)
+        renderer.fill([(5, 5, 10, 10), (20, 15, 8, 10)], 0x0000FF)
+        # TODO: add fill check
 
 
 if __name__ == '__main__':