pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3283 - trunk/pingus/src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3283 - trunk/pingus/src
Date: Thu, 18 Oct 2007 19:51:24 +0200

Author: grumbel
Date: 2007-10-18 19:51:24 +0200 (Thu, 18 Oct 2007)
New Revision: 3283

Modified:
   trunk/pingus/src/surface.cpp
   trunk/pingus/src/surface.hpp
Log:
- added is_shared()

Modified: trunk/pingus/src/surface.cpp
===================================================================
--- trunk/pingus/src/surface.cpp        2007-10-18 17:50:21 UTC (rev 3282)
+++ trunk/pingus/src/surface.cpp        2007-10-18 17:51:24 UTC (rev 3283)
@@ -332,5 +332,11 @@
 
   SDL_FreeSurface(tmp);
 }
+
+bool
+Surface::is_shared() const
+{
+  return impl.use_count() != 1;
+}
 
 /* EOF */

Modified: trunk/pingus/src/surface.hpp
===================================================================
--- trunk/pingus/src/surface.hpp        2007-10-18 17:50:21 UTC (rev 3282)
+++ trunk/pingus/src/surface.hpp        2007-10-18 17:51:24 UTC (rev 3283)
@@ -57,10 +57,10 @@
   void lock();
   void unlock();
 
-  Size get_size()  const;
-  int get_width()  const;
-  int get_height() const;
-  int get_pitch()  const;
+  Size get_size()   const;
+  int  get_width()  const;
+  int  get_height() const;
+  int  get_pitch()  const;
 
   void blit(const Surface& source, int x, int y);
 
@@ -78,6 +78,8 @@
 
   operator bool() const;
 
+  bool is_shared() const;
+
 protected:
   boost::shared_ptr<SurfaceImpl> impl;
 };





reply via email to

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