Update of /cvsroot/freevo/kaa/mevas/src/displays
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12546

Modified Files:
        pygamecanvas.py 
Log Message:
use new sdl display in kaa.display

Index: pygamecanvas.py
===================================================================
RCS file: /cvsroot/freevo/kaa/mevas/src/displays/pygamecanvas.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pygamecanvas.py     26 Jun 2005 17:02:06 -0000      1.1
--- pygamecanvas.py     13 Jul 2005 20:16:47 -0000      1.2
***************
*** 35,40 ****
  from kaa import mevas
  import kaa.mevas.rect as rect
! 
! from kaa.display import image_to_surface
  
  # displays import
--- 35,39 ----
  from kaa import mevas
  import kaa.mevas.rect as rect
! import kaa.display.sdl
  
  # displays import
***************
*** 45,61 ****
      def __init__(self, size):
          super(PygameCanvas, self).__init__(size, preserve_alpha = False)
! 
!         # Initialize the PyGame modules.
!         if not pygame.display.get_init():
!             pygame.display.init()
!             pygame.font.init()
! 
!         self._screen  = pygame.display.set_mode(size, 0, 32)
!         if self._screen.get_bitsize() != 32:
!             # if the bitsize is not 32 as requested, we need
!             # a tmp surface to convert from imlib2 to pygame
!             # because imlib2 uses 32 bit and with a different
!             # value memcpy will do nasty things
!             self._surface = pygame.Surface(size, 0, 32)
          self._rect = []
  
--- 44,48 ----
      def __init__(self, size):
          super(PygameCanvas, self).__init__(size, preserve_alpha = False)
!         self._window = kaa.display.sdl.PygameDisplay(size)
          self._rect = []
  
***************
*** 64,74 ****
          if not self._rect:
              return
!         if hasattr(self, '_surface'):
!             image_to_surface(self._backing_store._image._image, self._surface)
!             for pos, size in self._rect:
!                 self._screen.blit(self._surface, pos, pos + size)
!         else:
!             image_to_surface(self._backing_store._image._image, self._screen)
!         pygame.display.update(self._rect)
          self._rect = []
  
--- 51,55 ----
          if not self._rect:
              return
!         self._window.render_imlib2_image(self._backing_store._image._image, 
self._rect)
          self._rect = []
  



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to