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

[pygame] [bug] blit_array() fails with a 24 bit surface



I've just filed bug 24 at http://pygame.motherhamster.org/bugzilla/

Pygame-1.9.0a0 (rev. 1668)
numpy 1.0.4
Python 2.5.2

pygame.surfarray.blit_array() raises an exception when a 3d array is copied to a 24 bit surface.

Test Program:

import pygame

pygame.surfarray.use_arraytype('numpy')
s = pygame.Surface((10,10), 0, 24)
a = pygame.surfarray.array3d(s)
pygame.surfarray.blit_array(s, a)


Exception:
Traceback (most recent call last):
 File "array_bug.py", line 6, in <module>
   pygame.surfarray.blit_array(s, a)
File "C:\PRG\PYTHON25\lib\site-packages\pygame\surfarray.py", line 260, in bli
t_array
   return numpysf.blit_array (surface, array)
File "C:\PRG\PYTHON25\lib\site-packages\pygame\_numpysurfarray.py", line 381,
in blit_array
   (array[:,:,1::3] >> losses[1] << shifts[1]) | \
TypeError: unsupported operand type(s) for >>: 'float' and 'int'


I will see what I can do with it.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>