pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] rev 2304 - in trunk: data data/GUIStyleSilver data/GUIStyle


From: Ingo Ruhnke
Subject: [Pingus-CVS] rev 2304 - in trunk: data data/GUIStyleSilver data/GUIStyleSilver/checkbox data/GUIStyleSilver/fonts data/GUIStyleSilver/fonts/.xvpics data/GUIStyleSilver/menu data/GUIStyleSilver/radiobutton src src/worldobjs
Date: Thu, 06 May 2004 19:30:17 +0200

Author: grumbel
Date: 2004-05-06 19:30:17 +0200 (Thu, 06 May 2004)
New Revision: 2304

Added:
   trunk/data/GUIStyleSilver/
   trunk/data/GUIStyleSilver/checkbox/
   trunk/data/GUIStyleSilver/checkbox/checked.tga
   trunk/data/GUIStyleSilver/checkbox/checked_disabled.tga
   trunk/data/GUIStyleSilver/checkbox/unchecked.tga
   trunk/data/GUIStyleSilver/checkbox/unchecked_disabled.tga
   trunk/data/GUIStyleSilver/fonts/
   trunk/data/GUIStyleSilver/fonts/.xvpics/
   trunk/data/GUIStyleSilver/fonts/.xvpics/font_black.tga
   trunk/data/GUIStyleSilver/fonts/.xvpics/font_gray.tga
   trunk/data/GUIStyleSilver/fonts/font_black.tga
   trunk/data/GUIStyleSilver/fonts/font_gray.tga
   trunk/data/GUIStyleSilver/gui.xml
   trunk/data/GUIStyleSilver/menu/
   trunk/data/GUIStyleSilver/menu/arrow.png
   trunk/data/GUIStyleSilver/menu/checked.png
   trunk/data/GUIStyleSilver/menu/unchecked.png
   trunk/data/GUIStyleSilver/radiobutton/
   trunk/data/GUIStyleSilver/radiobutton/checked.tga
   trunk/data/GUIStyleSilver/radiobutton/checked_disabled.tga
   trunk/data/GUIStyleSilver/radiobutton/unchecked.tga
   trunk/data/GUIStyleSilver/radiobutton/unchecked_disabled.tga
Modified:
   trunk/src/blitter.cxx
   trunk/src/blitter.hxx
   trunk/src/blitter_impl.hxx
   trunk/src/col_map.cxx
   trunk/src/col_map.hxx
   trunk/src/color.hxx
   trunk/src/multiline_text.cxx
   trunk/src/pingus_counter.cxx
   trunk/src/pingus_menu_manager.cxx
   trunk/src/pingus_menu_manager.hxx
   trunk/src/worldobjs/surface_background.cxx
   trunk/src/worldobjs/switch_door.cxx
Log:
- editor and game now startup, still not useable

Added: trunk/data/GUIStyleSilver/checkbox/checked.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/checkbox/checked.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/checkbox/checked_disabled.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/checkbox/checked_disabled.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/checkbox/unchecked.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/checkbox/unchecked.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/checkbox/unchecked_disabled.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/checkbox/unchecked_disabled.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/fonts/.xvpics/font_black.tga
===================================================================
--- trunk/data/GUIStyleSilver/fonts/.xvpics/font_black.tga      2004-05-06 
16:15:41 UTC (rev 2303)
+++ trunk/data/GUIStyleSilver/fonts/.xvpics/font_black.tga      2004-05-06 
17:30:17 UTC (rev 2304)
@@ -0,0 +1,5 @@
+P7 332
+#IMGINFO:608x21 RGB (10587 bytes)
+#END_OF_COMMENTS
+80 2 255
+I$II۶��IH%I۶��%HI%۶ڶ%HII�ڶ�%HII۶��I$II۶��$I$I۶ڷ$IH%۶ڷ$IHI�ڶ�H%HI۶��I$II۶��IH%I۶�$I)Iֻ��(EI)ڷֺ$IEI�׶�$IIEڷ��E(II׺��%HI�۶$II$�ֻ�$IIH�ڷ�
\ No newline at end of file

Added: trunk/data/GUIStyleSilver/fonts/.xvpics/font_gray.tga
===================================================================
--- trunk/data/GUIStyleSilver/fonts/.xvpics/font_gray.tga       2004-05-06 
16:15:41 UTC (rev 2303)
+++ trunk/data/GUIStyleSilver/fonts/.xvpics/font_gray.tga       2004-05-06 
17:30:17 UTC (rev 2304)
@@ -0,0 +1,5 @@
+P7 332
+#IMGINFO:608x21 RGB (10587 bytes)
+#END_OF_COMMENTS
+80 2 255
+I$II۶��IH%I۶��%HI%۶ڶ%HII�ڶ�%HII۶��I$II۶��$I$I۶ڷ$IH%۶ڷ$IHI�ڶ�H%HI۶��I$II۶��IH%I۶��D)DI۶��$I(E۶ڷ$IH)�ڶ�$IHI�ֶ�H%HI۶��$I�)����$II$ۺ׶$IIH�ڷ�
\ No newline at end of file

Added: trunk/data/GUIStyleSilver/fonts/font_black.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/fonts/font_black.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/fonts/font_gray.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/fonts/font_gray.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/gui.xml
===================================================================
--- trunk/data/GUIStyleSilver/gui.xml   2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/data/GUIStyleSilver/gui.xml   2004-05-06 17:30:17 UTC (rev 2304)
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="latin-1" ?>
+<resources>
+       <section name="FontGlyphs">
+               <sprite name="font_black">
+                       <image file="fonts/font_black.tga">
+                               <alpha />
+                       </image>
+               </sprite>
+               <sprite name="font_gray">
+                       <image file="fonts/font_gray.tga">
+                               <alpha />
+                       </image>
+               </sprite>
+       </section>
+       <section name="Window">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+               <font name="font_disabled">
+                       <bitmap glyphs="FontGlyphs/font_gray" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="Button">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+               <font name="font_disabled">
+                       <bitmap glyphs="FontGlyphs/font_gray" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="InputBox">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+               <font name="font_disabled">
+                       <bitmap glyphs="FontGlyphs/font_gray" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="Label">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="ListBox">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="CheckBox">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"/>
+               </font>
+               <font name="font_disabled">
+                       <bitmap glyphs="FontGlyphs/font_gray" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"/>
+               </bitmap>
+               <surface name="surface_checked" file="checkbox/checked.tga" />
+               <surface name="surface_unchecked" file="checkbox/unchecked.tga" 
/>
+               <surface name="surface_checked_disabled" 
file="checkbox/checked_disabled.tga" />
+               <surface name="surface_unchecked_disabled" 
file="checkbox/unchecked_disabled.tga" />
+       </section>
+       <section name="RadioButton">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"/>
+               </font>
+               <surface name="surface_checked" file="radiobutton/checked.tga" 
/>
+               <surface name="surface_unchecked" 
file="radiobutton/unchecked.tga" />
+               <surface name="surface_checked_disabled" 
file="radiobutton/checked_disabled.tga" />
+               <surface name="surface_unchecked_disabled" 
file="radiobutton/unchecked_disabled.tga" />
+       </section>
+       <section name="TreeView">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="TreeViewItem">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+       </section>
+       <section name="MessageBox">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+               <integer name="min_width" value="200" />
+               <boolean name="fixed_size_buttons" value="true" />
+               <integer name="min_button_width" value="80" />
+               <integer name="min_button_height" value="20" />
+       </section>
+       <section name="InputDialog">
+               <integer name="min_width" value="50" />
+               <boolean name="fixed_size_buttons" value="true" />
+               <integer name="min_button_width" value="80" />
+               <integer name="min_button_height" value="20" />
+       </section>
+
+       <section name="Menu">
+               <surface name="submenu_arrow" file="menu/arrow.png" />
+       </section>
+
+       <section name="MenuItem">
+               <font name="font">
+                       <bitmap glyphs="FontGlyphs/font_black" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+               <font name="font_disabled">
+                       <bitmap glyphs="FontGlyphs/font_gray" spacelen="4" 
letters="!'#$%&amp;'()*+,-./0123456789:;<=>address@hidden'abcdefghijklmnopqrstuvwxyz{|}~"
 />
+               </font>
+
+               <surface name="checked" file="menu/checked.png" />
+               <surface name="unchecked" file="menu/unchecked.png" />
+       </section>
+</resources>

Added: trunk/data/GUIStyleSilver/menu/arrow.png
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/menu/arrow.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/menu/checked.png
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/menu/checked.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/menu/unchecked.png
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/menu/unchecked.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/radiobutton/checked.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/radiobutton/checked.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/radiobutton/checked_disabled.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/radiobutton/checked_disabled.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/radiobutton/unchecked.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/GUIStyleSilver/radiobutton/unchecked.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/data/GUIStyleSilver/radiobutton/unchecked_disabled.tga
===================================================================
(Binary files differ)


Property changes on: 
trunk/data/GUIStyleSilver/radiobutton/unchecked_disabled.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/blitter.cxx
===================================================================
--- trunk/src/blitter.cxx       2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/blitter.cxx       2004-05-06 17:30:17 UTC (rev 2304)
@@ -212,10 +212,9 @@
 }
 
 void
-Blitter::put_alpha_surface(CL_PixelBuffer& provider, const CL_PixelBuffer& 
sprovider,
+Blitter::put_alpha_surface(CL_PixelBuffer& provider, CL_PixelBuffer& sprovider,
                           int x, int y)
 {
-#ifdef CLANLIB_0_6
   int start_i;
   unsigned char* tbuffer; // Target buffer
   int twidth, theight, tpitch;
@@ -223,7 +222,7 @@
   unsigned char* sbuffer; // Source buffer
   int swidth, sheight, spitch;
 
-  CL_Palette* palette;
+  CL_Palette palette;
   int x_offset, y_offset;
 
   provider.lock();
@@ -232,13 +231,8 @@
   //  assert(sprovider.get_format().get_depth() == 8);
   if (sprovider.get_format().get_depth() != 8)
     {
-      // FIXME: memory hole
-#if COMPILE_WITH_MEMORY_HOLE
-#warning "FIXME: Blitter::put_alpha_surface(CL_PixelBuffer& provider, 
CL_PixelBuffer& sprovider, int x, int y) contains memory hole"
-#else
       sprovider.unlock ();
       provider.unlock ();
-#endif
       PingusError::raise("Image has wrong color depth: " + 
to_string(sprovider.get_format().get_depth()));
     }
   //  assert(provider.get_pixel_format() == RGBA8888);
@@ -247,15 +241,14 @@
   sbuffer = static_cast<unsigned char*>(sprovider.get_data());
 
   palette = sprovider.get_palette();
-  assert(palette);
-
-  twidth = provider.get_width();
+  
+  twidth  = provider.get_width();
   theight = provider.get_height();
-  tpitch = provider.get_pitch();
+  tpitch  = provider.get_pitch();
 
-  swidth = sprovider.get_width();
+  swidth  = sprovider.get_width();
   sheight = sprovider.get_height();
-  spitch = sprovider.get_pitch();
+  spitch  = sprovider.get_pitch();
 
   if (y < 0)
     y_offset = 0-y;
@@ -278,14 +271,8 @@
     }
   }
 
-#if COMPILE_WITH_MEMORY_HOLE
-#warning "FIXME: Blitter::put_alpha_surface(CL_PixelBuffer& provider, 
CL_PixelBuffer& sprovider, int x, int y) contains memory hole"
-#else
   sprovider.unlock();
   provider.unlock();
-#endif
-
-#endif
 }
 
 CL_PixelBuffer
@@ -308,16 +295,14 @@
 }
 
 CL_PixelBuffer
-Blitter::create_canvas(const CL_PixelBuffer& prov)
+Blitter::create_canvas(CL_PixelBuffer prov)
 {
-#ifdef CLANLIB_0_6
-  assert (prov);
-  CL_PixelBuffer& canvas = new CL_PixelBuffer(prov.get_width(), 
prov.get_height());
+  CL_PixelBuffer canvas(prov.get_width(), prov.get_height(), 
prov.get_width()*4, CL_PixelFormat::rgba8888);
 
-  switch (prov.get_bytes_per_pixel())
+  switch (prov.get_format().get_depth())
     {
       // RGB888
-    case 3:
+    case 24:
       {
        canvas.lock();
        prov.lock();
@@ -341,7 +326,7 @@
       break;
 
       // RGBA8888
-    case 4:
+    case 32:
       canvas.lock();
       prov.lock();
       memcpy(canvas.get_data(), prov.get_data(),
@@ -355,24 +340,18 @@
       break;
     }
   return canvas;
-#endif
-  return 0;
 }
 
 CL_Surface
 Blitter::scale_surface (const CL_Surface& sur, int width, int height)
 {
-#ifdef CLANLIB_0_6
-  assert (sur);
-  return CL_Surface(Blitter::scale_surface_to_canvas(sur, width, height), 
true);
-#endif
-  return CL_Surface();
+  CL_PixelBuffer buf = Blitter::scale_surface_to_canvas(sur, width, height);
+  return CL_Surface(&buf, false);
 }
 
 CL_PixelBuffer
 Blitter::scale_surface_to_canvas(const CL_Surface& sur, int width, int height)
 {
-  Color color;
   CL_PixelBuffer provider = sur.get_pixeldata();
   CL_PixelBuffer canvas(width, height, width*4, CL_PixelFormat::rgba8888);
 
@@ -386,6 +365,8 @@
 
   if (provider.get_format().get_type() ==  pixelformat_index)
     {
+      Color color;
+  
       // Slow but generic, using get_data () would be better, but would
       // require quite a bit of work
       for (int y = 0; y < height; ++y)
@@ -406,9 +387,7 @@
                color.alpha = 1.0f;
               
              // FIXME: ignoring the source alpha due to get_pixel brokeness... 
no time to test the patch
-#ifdef CLANLIB_0_6
-             canvas.draw_pixel (x, y, color.red, color.green, color.blue, 
color.alpha);
-#endif
+             canvas.draw_pixel (x, y, color.to_cl_color());
            }
        }
     }
@@ -458,16 +437,13 @@
          for (int y = 0; y < height; ++y)
            for (int x = 0; x < width; ++x)
              {
-#ifdef CLANLIB_0_6
                // std::cout << "X: " << x << " Y: " << y << std::endl;
-               provider.get_pixel (x * provider.get_width () / width,
-                                    y * provider.get_height () / height,
-                                    &color.red, &color.green, &color.blue, 
&color.alpha);
+               CL_Color color = provider.get_pixel(x * provider.get_width () / 
width,
+                                                    y * provider.get_height () 
/ height);
                // FIXME: ignoring the source alpha due to get_pixel
                // brokeness... no time to test the patch
-               canvas.draw_pixel (x, y, color.red, color.green, color.blue, 
color.alpha);
-#endif
-             }
+               canvas.draw_pixel(x, y, color);
+              }
          break;
        }
     }
@@ -569,23 +545,23 @@
 #ifdef CLANLIB_0_6
   CL_PixelBuffer prov = sur.get_pixeldata();
 
-  if (prov.get_type() ==  pixelformat_index)
+  if (prov.get_format().get_type() ==  pixelformat_index)
     {
       //std::cout << "Using indexed blitter" << std::endl;
-      int pwidth  = prov->get_width();
-      int pheight = prov->get_height();
+      int pwidth  = prov.get_width();
+      int pheight = prov.get_height();
 
       IndexedCanvas* canvas = new IndexedCanvas(pheight, pwidth);
       if (prov->uses_src_colorkey())
         canvas->set_src_colorkey(prov->get_src_colorkey());
 
-      prov->lock ();
-      canvas->lock ();
+      prov.lock();
+      canvas.lock();
 
-      canvas->set_palette(prov->get_palette());
+      canvas.set_palette(prov.get_palette());
 
-      unsigned char* source_buf = static_cast<unsigned 
char*>(prov->get_data());
-      unsigned char* target_buf = static_cast<unsigned 
char*>(canvas->get_data());
+      unsigned char* source_buf = static_cast<unsigned char*>(prov.get_data());
+      unsigned char* target_buf = static_cast<unsigned 
char*>(canvas.get_data());
 
       for (int y = 0; y < pheight; ++y)
         for (int x = 0; x < pwidth; ++x)
@@ -593,27 +569,27 @@
             target_buf[x * pheight + (pheight - y - 1)] = source_buf[y * 
pwidth + x];
           }
 
-      canvas->unlock ();
-      prov->unlock ();
+      canvas.unlock();
+      prov.unlock();
       return CL_Surface(canvas, true);
     }
   else
     {
       CL_PixelBuffer* canvas = new CL_PixelBuffer (sur.get_height (), 
sur.get_width ());
 
-      prov->lock ();
-      canvas->lock ();
+      prov.lock ();
+      canvas.lock ();
 
-      float r, b, g, a;
+      CL_Color color;
       for (int y = 0; y < sur.get_height (); ++y)
         for (int x = 0; x < sur.get_width (); ++x)
           {
-            prov->get_pixel (x, y, &r, &g, &b, &a);
-            canvas->draw_pixel (sur.get_height () - 1 - y, x , r, g, b, a);
+            color = prov->get_pixel (x, y);
+            canvas.draw_pixel (sur.get_height () - 1 - y, x , color);
           }
 
-      canvas->unlock ();
-      prov->unlock ();
+      canvas.unlock ();
+      prov.unlock ();
       return CL_Surface(canvas, true);
     }
 #endif

Modified: trunk/src/blitter.hxx
===================================================================
--- trunk/src/blitter.hxx       2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/blitter.hxx       2004-05-06 17:30:17 UTC (rev 2304)
@@ -56,7 +56,7 @@
 
   /** Makes all pixels in canvas tranparent, when their indexed value
       in provider is larger than zero.*/
-  static void put_alpha_surface(CL_PixelBuffer& target, const CL_PixelBuffer& 
source,
+  static void put_alpha_surface(CL_PixelBuffer& target, CL_PixelBuffer& source,
                                int x, int y);
 
   /** Returns a newly allocated canvas. The canvas contains the same
@@ -65,7 +65,7 @@
 
   /** Returns a newly allocated canvas. The canvas contains the same
       image as the given surface provider */
-  static CL_PixelBuffer create_canvas(const CL_PixelBuffer& );
+  static CL_PixelBuffer create_canvas(CL_PixelBuffer );
 
   /** Sets all pixels of a canvas to zero */
   static CL_PixelBuffer clear_canvas(CL_PixelBuffer& );

Modified: trunk/src/blitter_impl.hxx
===================================================================
--- trunk/src/blitter_impl.hxx  2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/blitter_impl.hxx  2004-05-06 17:30:17 UTC (rev 2304)
@@ -209,21 +209,6 @@
       for (int y = 0; y < pheight; ++y)
         for (int x = 0; x < pwidth; ++x)
           {
-#ifdef PINGUS_DO_ROTBLITTER_BOUNDCHECK
-            int i = TransF::get_index(pwidth, pheight, x, y);
-            if (i < 0 || i >= pwidth * pheight)
-              {
-                std::cout << "Target: Out of bounce: " << i << " " << pwidth 
<< "x" << pheight
-                          << " " <<  typeid(TransF()).name() << std::endl;
-              }
-
-            if (y * pwidth + x < 0
-                || y * pwidth + x >= pwidth * pheight)
-              {
-                std::cout << "Source: Out of bounce: " << i << " " << pwidth 
<< "x" << pheight
-                          << " " <<  typeid(TransF()).name() << std::endl;
-              }
-#endif
             target_buf[TransF::get_index(pwidth, pheight, x, y)] = 
source_buf[y * pwidth + x];
           }
 
@@ -240,21 +225,17 @@
       prov.lock();
       canvas.lock();
 
-#if CLANLIB_0_6
-      float r, b, g, a;
       int pwidth  = prov.get_width();
       int pheight = prov.get_height();
       
       for (int y = 0; y < sur.get_height (); ++y)
         for (int x = 0; x < sur.get_width (); ++x)
           {
-
-            prov.get_pixel (x, y, &r, &g, &b, &a);
-            canvas->draw_pixel (TransF::get_x(pwidth, pheight, x, y),
-                                TransF::get_y(pwidth, pheight, x, y),
-                                r, g, b, a);
+            CL_Color color = prov.get_pixel(x, y);
+            canvas.draw_pixel(TransF::get_x(pwidth, pheight, x, y),
+                              TransF::get_y(pwidth, pheight, x, y),
+                              color);
           }
-#endif
 
       canvas.unlock ();
       prov.unlock ();

Modified: trunk/src/col_map.cxx
===================================================================
--- trunk/src/col_map.cxx       2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/col_map.cxx       2004-05-06 17:30:17 UTC (rev 2304)
@@ -174,7 +174,7 @@
 
 // Puts a surface on the colmap
 void
-ColMap::put(CL_PixelBuffer& provider, int sur_x, int sur_y, Groundtype::GPType 
pixel)
+ColMap::put(CL_PixelBuffer provider, int sur_x, int sur_y, Groundtype::GPType 
pixel)
 {
   // transparent groundpieces are only drawn on the gfx map, not on the colmap
   if (pixel == Groundtype::GP_TRANSPARENT)
@@ -194,20 +194,17 @@
 
   if (provider.get_format().get_depth() == 32)
     {
-#if CLANLIB_0_6
-      float r, g, b, a;
       // Rewritting blitter for 32bit depth (using get_pixel())
       for (int y=0; y < provider.get_height(); ++y)
        for (int x=0; x < provider.get_width(); ++x)
          {
-           provider.get_pixel(x, y, &r, &g, &b, &a);
-           if (a > 0.1) // Alpha threshold
+           CL_Color color = provider.get_pixel(x, y);
+           if (color.get_alpha() > 0.1) // Alpha threshold
              {
                if (blit_allowed (x + sur_x, y + sur_y, pixel))
                  put(x + sur_x, y + sur_y, pixel);
              }
          }
-#endif
     }
   else if (provider.get_format().get_depth() == 8)
     {

Modified: trunk/src/col_map.hxx
===================================================================
--- trunk/src/col_map.hxx       2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/col_map.hxx       2004-05-06 17:30:17 UTC (rev 2304)
@@ -79,7 +79,7 @@
   bool blit_allowed (int x, int y,  Groundtype::GPType);
 
   void put(int x, int y, Groundtype::GPType p = Groundtype::GP_GROUND);
-  void put(CL_PixelBuffer&, int x, int y, Groundtype::GPType);
+  void put(CL_PixelBuffer, int x, int y, Groundtype::GPType);
 
   /// void remove(int x, int y);
   void remove(CL_PixelBuffer&, int x, int y);

Modified: trunk/src/color.hxx
===================================================================
--- trunk/src/color.hxx 2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/color.hxx 2004-05-06 17:30:17 UTC (rev 2304)
@@ -21,6 +21,7 @@
 #define HEADER_PINGUS_COLOR_HXX
 
 #include "pingus.hxx"
+#include <ClanLib/Display/color.h>
 #include <iostream>
 
 namespace Pingus {
@@ -65,7 +66,13 @@
   bool operator== (const Color& color) const {
     return red == color.red && green == color.green && blue == color.blue && 
alpha == color.alpha;
   }
-
+  
+  CL_Color to_cl_color() {
+    return CL_Color(static_cast<int>(red * 255), 
+                    static_cast<int>(green * 255), 
+                    static_cast<int>(blue * 255), 
+                    static_cast<int>(alpha * 255));
+  }
 };
 
 } // namespace Pingus

Modified: trunk/src/multiline_text.cxx
===================================================================
--- trunk/src/multiline_text.cxx        2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/multiline_text.cxx        2004-05-06 17:30:17 UTC (rev 2304)
@@ -120,13 +120,14 @@
 {
   int y_inc = 0;
 
+  CL_Font myfont = font;
+  myfont.set_alignment(origin_top_center);
+
   for(std::vector<std::string>::iterator i = text.begin();
       i != text.end();
       ++i)
     {
-#ifdef CLANLIB_0_6
-      font.print_center(x_pos, y_pos + y_inc, i->c_str());
-#endif
+      myfont.draw(x_pos, y_pos + y_inc, i->c_str());
       y_inc += font.get_height();
     }
 }

Modified: trunk/src/pingus_counter.cxx
===================================================================
--- trunk/src/pingus_counter.cxx        2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/pingus_counter.cxx        2004-05-06 17:30:17 UTC (rev 2304)
@@ -56,9 +56,10 @@
           world->get_pingus()->get_number_of_exited(),
           server->get_plf()->get_number_to_save());
 
-#ifdef CLANLIB_0_6
-  font.print_center(CL_Display::get_width ()/2,3, str);
-#endif
+  CL_Font myfont = font;
+  myfont.set_alignment(origin_top_center);
+  myfont.draw(CL_Display::get_width ()/2,3, str);
+
   UNUSED_ARG(gc);
 }
 

Modified: trunk/src/pingus_menu_manager.cxx
===================================================================
--- trunk/src/pingus_menu_manager.cxx   2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/pingus_menu_manager.cxx   2004-05-06 17:30:17 UTC (rev 2304)
@@ -104,28 +104,6 @@
 }
 
 void
-PingusMenuManager::fadeout ()
-{
-  std::cout << "PingusMenuManager::fadeout () Not implemented" << std::endl;
-#if 0
-  DeltaManager delta_manager;
-  EnlargingRectFadeOut fadeout;
-
-  while (!fadeout.finished ())
-    {
-      float time_delta = delta_manager.getset ();
-      fadeout.update (time_delta);
-
-      current_menu ()->draw ();
-      fadeout.draw ();
-      Display::flip_display ();
-
-      CL_System::keep_alive ();
-    }
-#endif
-}
-
-void
 PingusMenuManager::show_exit_menu ()
 {
   push_menu (&exitmenu);

Modified: trunk/src/pingus_menu_manager.hxx
===================================================================
--- trunk/src/pingus_menu_manager.hxx   2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/pingus_menu_manager.hxx   2004-05-06 17:30:17 UTC (rev 2304)
@@ -52,8 +52,6 @@
 
   virtual ~PingusMenuManager ();
 
-  void fadeout ();
-
   bool draw (GraphicContext& gc);
   void update (const GameDelta&);
 

Modified: trunk/src/worldobjs/surface_background.cxx
===================================================================
--- trunk/src/worldobjs/surface_background.cxx  2004-05-06 16:15:41 UTC (rev 
2303)
+++ trunk/src/worldobjs/surface_background.cxx  2004-05-06 17:30:17 UTC (rev 
2304)
@@ -44,8 +44,8 @@
     std::cout << "Background: Warning dim larger than 1.0 are no longer 
supported" << std::endl;
 
   CL_Surface source_surface = PingusResource::load_surface(data->desc);
+
 #ifdef CLANLIB_0_6
-
   CL_PixelBuffer canvas;
 
   // Scaling Code
@@ -195,6 +195,8 @@
                 {
 #ifdef CLANLIB_0_6
                   bg_surface.put_screen(x, y, counter); // FIXME: should use gc
+#else
+                  bg_surface.draw(x, y); // FIXME: should use gc
 #endif
                 }
             }

Modified: trunk/src/worldobjs/switch_door.cxx
===================================================================
--- trunk/src/worldobjs/switch_door.cxx 2004-05-06 16:15:41 UTC (rev 2303)
+++ trunk/src/worldobjs/switch_door.cxx 2004-05-06 17:30:17 UTC (rev 2304)
@@ -48,8 +48,7 @@
 void
 SwitchDoor::on_startup ()
 {
-#ifdef CLANLIB_0_6
-  world->get_colmap()->put(door_box,
+  world->get_colmap()->put(door_box.get_frame_surface(0).get_pixeldata(),
                            static_cast<int>(data->door_pos.x),
                           static_cast<int>(data->door_pos.y),
                           Groundtype::GP_SOLID);
@@ -61,7 +60,6 @@
                             + i * door_tile.get_height()
                             + door_box.get_height(),
                             Groundtype::GP_SOLID);
-#endif
 }
 
 void





reply via email to

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