On Wed, Sep 16, 2009 at 3:15 PM, Peter Chant
<pete@xxxxxxxxxxxxxxx> wrote:
On Wednesday 16 September 2009, René Dudfield wrote:
> I guess the next step is to try and put print debugging in.
>
> You start by putting a few print statements in, and see where it gets
> up to. Then you refine until you get really close to it... doing a
> binary search of your source until you find the place/places that make
> it crash.
>
D'oh so obvious. What I regularly do whilst developing things, but not when
bugs suddenly appear.
FOUND IT!
self.screen.blit(clear,(0,0))
- look for the exclamation marks
def clearScreen(self):
print "In clearScreen"
print "About to call pygame.display_get_surface()"
clear = pygame.display.get_surface()
print "About to fill surface to clear it"
clear.fill((0,0,0))
print "About to self.screen.blit - !!!! this crashes"
self.screen.blit(clear,(0,0))
print "just blitted - !!!!! does not get to here"
self.screen is initialised by the output of another class.
self.screen = h.screen
in class h
self.screen=pygame.display.get_surface()
Only fails on 32 bit Slack 13.0.
--
Peter Chant
so functionally
surf = pygame.dispay.get_surface()
surf.fill((0,0,0))
surf.blit(surf,(0,0))
fails.
From your app point of view, the blit line is superfluous.
your code will be
def clearScreen(self):
self.screen.fill((0,0,0))
From the pygame point of view, there is a possible bug, there is a bug: it should work or it should raise some meaningful error.
--
claxo