pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2777 - branches/pingus_sdl/src


From: jsalmon3
Subject: [Pingus-CVS] r2777 - branches/pingus_sdl/src
Date: Thu, 2 Aug 2007 08:03:23 +0200

Author: jsalmon3
Date: 2007-08-02 08:03:18 +0200 (Thu, 02 Aug 2007)
New Revision: 2777

Modified:
   branches/pingus_sdl/src/blitter_impl.hpp
   branches/pingus_sdl/src/pixel_buffer.cpp
   branches/pingus_sdl/src/pixel_buffer.hpp
Log:
Set up the colorkey so transparency works

Modified: branches/pingus_sdl/src/blitter_impl.hpp
===================================================================
--- branches/pingus_sdl/src/blitter_impl.hpp    2007-08-02 05:53:37 UTC (rev 
2776)
+++ branches/pingus_sdl/src/blitter_impl.hpp    2007-08-02 06:03:18 UTC (rev 
2777)
@@ -186,7 +186,7 @@
     {
       PixelBuffer target_buffer(TransF::get_width (source_buffer.get_width(), 
source_buffer.get_height()), 
                                 TransF::get_height(source_buffer.get_width(), 
source_buffer.get_height()),
-                                source->format->palette);
+                                source->format->palette, 
source->format->colorkey);
       SDL_Surface* target = target_buffer.get_surface();
       SDL_LockSurface(target);
 

Modified: branches/pingus_sdl/src/pixel_buffer.cpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.cpp    2007-08-02 05:53:37 UTC (rev 
2776)
+++ branches/pingus_sdl/src/pixel_buffer.cpp    2007-08-02 06:03:18 UTC (rev 
2777)
@@ -43,12 +43,13 @@
 
 }
 
-PixelBuffer::PixelBuffer(int width, int height, SDL_Palette* palette)
+PixelBuffer::PixelBuffer(int width, int height, SDL_Palette* palette, int 
colorkey)
   : impl(new PixelBufferImpl())
 {
-  impl->surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 8,
+  impl->surface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCCOLORKEY, width, 
height, 8,
                                        0, 0, 0 ,0);
   SDL_SetColors(impl->surface, palette->colors, 0, palette->ncolors);
+  SDL_SetColorKey(impl->surface, SDL_SRCCOLORKEY, colorkey);
 }
 
 PixelBuffer::PixelBuffer(int width, int height)

Modified: branches/pingus_sdl/src/pixel_buffer.hpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.hpp    2007-08-02 05:53:37 UTC (rev 
2776)
+++ branches/pingus_sdl/src/pixel_buffer.hpp    2007-08-02 06:03:18 UTC (rev 
2777)
@@ -51,7 +51,7 @@
   PixelBuffer(int width, int height);
 
   /** Create an empty Indexed PixelBuffer (8bit) */
-  PixelBuffer(int width, int height, SDL_Palette* palette);
+  PixelBuffer(int width, int height, SDL_Palette* palette, int colorkey);
   ~PixelBuffer();
 
   uint8_t* get_data() const;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]