summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-07-08 15:35:03 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-07-08 15:35:03 +0000
commita5a27ee85e10885a45b1223a885e4f94bc9ace90 (patch)
tree3c8e2960e558e6581f3871ddd2bd5f5d840c1f62
parent5de377e1c1a21e8b08758b8938cb30ce3aec7c2e (diff)
rectinsert.c: added BlocksFromList function to extract changed areas
for cache from the damage list. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@373 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r--recordmydesktop/src/rectinsert.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/recordmydesktop/src/rectinsert.c b/recordmydesktop/src/rectinsert.c
index fea6a1d..b46ec1f 100644
--- a/recordmydesktop/src/rectinsert.c
+++ b/recordmydesktop/src/rectinsert.c
@@ -511,3 +511,39 @@ void ClearList(RectArea **root){
}
}
+void BlocksFromList(RectArea **root,
+ unsigned int blocknum_x,
+ unsigned int blocknum_y){
+
+ RectArea *temp;
+ unsigned int i,
+ j,
+ blockno,
+ row_start,
+ row_end,
+ column_start,
+ column_end;
+ temp=*root;
+ for(i=0;i<blocknum_x*blocknum_y;i++){
+ yblocks[i]=ublocks[i]=vblocks[i]=0;
+ }
+
+ while(temp!=NULL){
+ column_start=temp->geom.x/Y_UNIT_WIDTH;
+ column_end=(temp->geom.x+temp->geom.width)/Y_UNIT_WIDTH;
+ row_start=temp->geom.y/Y_UNIT_WIDTH;
+ row_end=(temp->geom.y+temp->geom.height)/Y_UNIT_WIDTH;
+ for(i=row_start;i<row_end+1;i++){
+ for(j=column_start;j<column_end+1;j++){
+ blockno=i*blocknum_x+j;
+ yblocks[blockno]=1;
+ ublocks[blockno]=1;
+ vblocks[blockno]=1;
+ }
+ }
+ temp=temp->next;
+ }
+
+}
+
+
© All Rights Reserved