pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3840 - trunk/pingus/src/display


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3840 - trunk/pingus/src/display
Date: Wed, 16 Jul 2008 17:41:36 +0200

Author: grumbel
Date: 2008-07-16 17:41:36 +0200 (Wed, 16 Jul 2008)
New Revision: 3840

Modified:
   trunk/pingus/src/display/delta_framebuffer.cpp
Log:
Getting rid of unneeded boost::shared_ptr

Modified: trunk/pingus/src/display/delta_framebuffer.cpp
===================================================================
--- trunk/pingus/src/display/delta_framebuffer.cpp      2008-07-16 15:30:09 UTC 
(rev 3839)
+++ trunk/pingus/src/display/delta_framebuffer.cpp      2008-07-16 15:41:36 UTC 
(rev 3840)
@@ -16,7 +16,6 @@
 
 #include <assert.h>
 #include <iostream>
-#include <boost/smart_ptr.hpp>
 #include "../math.hpp"
 #include "rect_merger.hpp"
 #include "sdl_framebuffer.hpp"
@@ -139,15 +138,23 @@
 class DrawOpBuffer
 {
 private:
-  typedef std::vector<boost::shared_ptr<DrawOp> > DrawOps;
+  typedef std::vector<DrawOp*> DrawOps;
   DrawOps draw_ops;
 
 public:
   DrawOpBuffer()
   {
   }
+
+  ~DrawOpBuffer()
+  {
+    for(DrawOps::const_iterator i = draw_ops.begin(); i != draw_ops.end(); ++i)
+      delete *i;
+  }
   
   void clear() {
+    for(DrawOps::const_iterator i = draw_ops.begin(); i != draw_ops.end(); ++i)
+      delete *i;
     draw_ops.clear();
   }
 
@@ -170,11 +177,11 @@
   {
     // FIXME: This is kind of a slow brute force approach
     for(DrawOps::const_iterator i = backbuffer.draw_ops.begin(); i != 
backbuffer.draw_ops.end(); ++i)
-      if (!frontbuffer.has_op(i->get()))
+      if (!frontbuffer.has_op(*i))
         changed_regions.push_back((*i)->get_region());
 
     for(DrawOps::const_iterator i = frontbuffer.draw_ops.begin(); i != 
frontbuffer.draw_ops.end(); ++i)
-      if (!backbuffer.has_op(i->get()))
+      if (!backbuffer.has_op(*i))
         changed_regions.push_back((*i)->get_region());
   }
  
@@ -231,8 +238,7 @@
   }
  
   void add(DrawOp* op) {
-    boost::shared_ptr<DrawOp> ptr(op);
-    draw_ops.push_back(ptr);
+    draw_ops.push_back(op);
   }
 };
 





reply via email to

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