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

Re: [pygame] BUG: crash in windows when bliting a surface over itself



A more clean script that demostrates the problem.

Sorry if this message wont thread properly, mail problems...

claxo
__________________________________
Registrate desde http://servicios.arnet.com.ar/registracion/registracion.asp?origenid=9 y participá de todos los beneficios del Portal Arnet.
"""Demostrates a pygame 1.7.1 bug. Programs ends with a 'pygame parachute'.
It happens in windows, in Linux I was tell it runs fine."""

import pygame
from pygame.locals import * 

pygame.init()
#screen = pygame.display.set_mode((800, 600),SWSURFACE)

screen = pygame.display.set_mode((800, 600),HWSURFACE,32)

a=pygame.Surface((64,64))
a.fill( (255,0,255) )
a.fill( (0,255,0), (0,0,8,32))
tmp =pygame.Surface( a.get_size(), a.get_flags(), a)
screen.blit(a,(screen.get_width()/2,screen.get_height()/2))
pygame.display.update()

print """\nDemostrates a pygame 1.7.1 bug. Programs ends with a 'pygame parachute'.
It happens in windows, in Linux I was tell it runs fine."""

print "\n *** press a key to crash with 'pygame parachute' error"  

bRunBug = True # set to False to run with the (slow) workaround, no crash
               # set to True for bug exposure

x,y = 0,0
while 1:
    event = pygame.event.poll()
    if (event.type == QUIT
        or (event.type==pygame.KEYDOWN and event.key==K_ESCAPE)):
        break
    elif event.type == KEYDOWN:
        if bRunBug:
            a.blit(a, (x,y), (0,y,64,1)) # <-- crash here
##            a.blit(a, (x,y), (0,y,64-x,1)) # even with proper src rect crashes
        else:
            tmp.blit(a,(0,0))
            a.blit(tmp,(x,y), (0,y,64,1))
        screen.blit(a,(screen.get_width()/2,screen.get_height()/2))
        if x<64:
            x+=1;y+=1;
    pygame.display.update()