From ac3ce74511a9953ae22fd6a1f77f8e969bb99922 Mon Sep 17 00:00:00 2001 From: enselic Date: Fri, 12 Sep 2008 23:12:41 +0000 Subject: include/rmdfunc.h src/rectinsert.c: Remove BlocksFromList() to get rid of dependencies. We now only depend on rmdtypes.h in rectinsert.c. src/get_frame.c: BlocksFromList() makes more sense to keep as a static function here. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@517 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/include/rmdfunc.h | 19 -------------- recordmydesktop/src/get_frame.c | 54 ++++++++++++++++++++++++++++++++++++++- recordmydesktop/src/rectinsert.c | 41 +---------------------------- 3 files changed, 54 insertions(+), 60 deletions(-) (limited to 'recordmydesktop') diff --git a/recordmydesktop/include/rmdfunc.h b/recordmydesktop/include/rmdfunc.h index a920150..a3eb811 100644 --- a/recordmydesktop/include/rmdfunc.h +++ b/recordmydesktop/include/rmdfunc.h @@ -519,25 +519,6 @@ int StopJackClient(JackData *jdata); #endif -/** -* Extract cache blocks from damage list -* -* \param root Root entry of the list with damaged areas -* -* \param x_offset left x of the recording area -* -* \param x_offset upper y of the recording area -* -* \param blocknum_x Width of image in blocks -* -* \param blocknum_y Height of image in blocks -*/ -void BlocksFromList(RectArea **root, - unsigned int x_offset, - unsigned int y_offset, - unsigned int blocknum_x, - unsigned int blocknum_y); - /** * Currently only frees some memory diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c index 8de95aa..ab8ff9a 100644 --- a/recordmydesktop/src/get_frame.c +++ b/recordmydesktop/src/get_frame.c @@ -250,7 +250,59 @@ void MoveCaptureArea( BRWindow *brwin, height-brwin->rgeom.height:t_y); } - +/** +* Extract cache blocks from damage list +* +* \param root Root entry of the list with damaged areas +* +* \param x_offset left x of the recording area +* +* \param x_offset upper y of the recording area +* +* \param blocknum_x Width of image in blocks +* +* \param blocknum_y Height of image in blocks +*/ +void BlocksFromList (RectArea **root, + unsigned int x_offset, + unsigned int y_offset, + 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 - x_offset) / Y_UNIT_WIDTH; + column_end = (temp->geom.x + (temp->geom.width - 1) - x_offset) / Y_UNIT_WIDTH; + row_start = (temp->geom.y - y_offset) / Y_UNIT_WIDTH; + row_end = (temp->geom.y + (temp->geom.height - 1) - y_offset) / 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; + } +} void *GetFrame(ProgData *pdata){ int i=0, diff --git a/recordmydesktop/src/rectinsert.c b/recordmydesktop/src/rectinsert.c index 61e931e..5e31a32 100644 --- a/recordmydesktop/src/rectinsert.c +++ b/recordmydesktop/src/rectinsert.c @@ -25,7 +25,7 @@ ******************************************************************************/ -#include "recordmydesktop.h" +#include "rmdtypes.h" #include "rectinsert.h" @@ -532,42 +532,3 @@ void ClearList(RectArea **root){ *root=NULL; } } - -void BlocksFromList(RectArea **root, - unsigned int x_offset, - unsigned int y_offset, - 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;igeom.x-x_offset)/Y_UNIT_WIDTH; - column_end=(temp->geom.x+(temp->geom.width-1)-x_offset)/Y_UNIT_WIDTH; - row_start=(temp->geom.y-y_offset)/Y_UNIT_WIDTH; - row_end=(temp->geom.y+(temp->geom.height-1)-y_offset)/Y_UNIT_WIDTH; - for(i=row_start;inext; - } - -} - - -- cgit v1.2.3