pingus-cvs
[Top][All Lists]
Advanced

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

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


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3825 - trunk/pingus/src/display
Date: Tue, 15 Jul 2008 08:55:41 +0200

Author: grumbel
Date: 2008-07-15 08:55:40 +0200 (Tue, 15 Jul 2008)
New Revision: 3825

Modified:
   trunk/pingus/src/display/rect_merger.cpp
Log:
Rewrote/Cleaned up split_rectangles(), this should fix the crash that happened 
every now and then in delta-drawing

Modified: trunk/pingus/src/display/rect_merger.cpp
===================================================================
--- trunk/pingus/src/display/rect_merger.cpp    2008-07-14 18:49:58 UTC (rev 
3824)
+++ trunk/pingus/src/display/rect_merger.cpp    2008-07-15 06:55:40 UTC (rev 
3825)
@@ -144,27 +144,20 @@
   assert(__gnu_cxx::is_sorted(rects.begin(), rects.end(), rect_y_sorter));
 
   std::vector<Rect>::const_iterator rect = rects.begin();
-  for(std::vector<Row>::iterator row = rows.begin(); row != rows.end() && rect 
!= rects.end(); ++row)
-    {
-      // FIXME: Crash Bug here, maybe
-      for(; rect->top == row->top; ++rect)
-        {
+  for(std::vector<Row>::iterator row = rows.begin(); row != rows.end(); ++row)
+    { // go over all rows
+      for(; rect != rects.end() && rect->top == row->top; ++rect)
+        { // go over all rectangles that start on this row
           Mark start(Mark::START_MARK, rect->left);
           Mark end  (Mark::END_MARK,   rect->right);
 
-          // Add the given rectangle to all rows it overlaps
-          std::vector<Row>::iterator this_row = row; 
-          do 
-            {
+          for(std::vector<Row>::iterator this_row = row; 
+              this_row != rows.end() && (this_row->bottom <= (rect->bottom));
+              ++this_row)       
+            { // go over all rows that this rect overlaps with
               this_row->marks.push_back(start);
               this_row->marks.push_back(end);
-
-              if (this_row->bottom < (rect->bottom))
-                ++this_row;
-              else
-                break;
             }
-          while (1);
         }
     }
 





reply via email to

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