[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Whoa! Bad slowdown!



On Wed, Apr 13, 2011 at 1:49 AM, Julian Marchant <onpon4@xxxxxxxxx> wrote:
> Is there a better way to do what I'm trying to do in that section of code?

Try something like this:

img = self.images[self.leftarm_image][img_index].copy()
img.fill((255,255,255,255*alpha_percent), special_flags=BLEND_RGBA_MULT)

> ________________________________
> From: Ian Mallett <geometrian@xxxxxxxxx>
> To: pygame-users@xxxxxxxx
> Sent: Tue, April 12, 2011 7:53:24 PM
> Subject: Re: [pygame] Whoa! Bad slowdown!
>
> Well, for one thing, on my machine, it segfaults constantly.
>
> I tracked it down to ~line 1006:
> scaled = pygame.transform.smoothscale(img, size)
> But there doesn't seem to be anything out of the ordinary there.  Maybe
> trying to resize many 1x1 surfaces to 400x400 leads to a memory leak
> somewhere in PyGame?
>
> Ian
>