From bbf369b9e52d718ce335c60aa457bee86b40503d Mon Sep 17 00:00:00 2001 From: enselic Date: Tue, 16 Sep 2008 06:25:52 +0000 Subject: src/rmd_types.h: Remove DisplaySpecs::bpixel and wpixel. src/rmd_make_dummy_pointer.[ch]: Take Display as a parameter to MakeDummyPointer() and put bpixel and wpixel locally here instead. src/rmd.c: Remove initialization of DisplaySpecs::bpixel and wpixel. src/rmd_initialize_data.c: Pass Display to MakeDummyPointer(). git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@549 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/rmd.c | 2 -- recordmydesktop/src/rmd_initialize_data.c | 9 ++++++--- recordmydesktop/src/rmd_make_dummy_pointer.c | 28 +++++++++++++++------------- recordmydesktop/src/rmd_make_dummy_pointer.h | 3 ++- recordmydesktop/src/rmd_types.h | 2 -- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/recordmydesktop/src/rmd.c b/recordmydesktop/src/rmd.c index 92e247f..bb513a2 100644 --- a/recordmydesktop/src/rmd.c +++ b/recordmydesktop/src/rmd.c @@ -84,8 +84,6 @@ int main(int argc,char **argv){ pdata.specs.visual = DefaultVisual(pdata.dpy, pdata.specs.screen); pdata.specs.gc = DefaultGC(pdata.dpy, pdata.specs.screen); pdata.specs.depth = DefaultDepth(pdata.dpy, pdata.specs.screen); - pdata.specs.bpixel = XBlackPixel(pdata.dpy, pdata.specs.screen); - pdata.specs.wpixel = XWhitePixel(pdata.dpy, pdata.specs.screen); if((pdata.specs.depth!=32)&& (pdata.specs.depth!=24)&& diff --git a/recordmydesktop/src/rmd_initialize_data.c b/recordmydesktop/src/rmd_initialize_data.c index 32bd529..631e725 100644 --- a/recordmydesktop/src/rmd_initialize_data.c +++ b/recordmydesktop/src/rmd_initialize_data.c @@ -63,9 +63,12 @@ int InitializeData(ProgData *pdata, fprintf(stderr,"Initializing...\n"); MakeMatrices(); if(pdata->args.have_dummy_cursor){ - pdata->dummy_pointer=MakeDummyPointer(&pdata->specs,16, - pdata->args.cursor_color,0, - &pdata->npxl); + pdata->dummy_pointer = MakeDummyPointer(pdata->dpy, + &pdata->specs, + 16, + pdata->args.cursor_color, + 0, + &pdata->npxl); pdata->dummy_p_size=16; } else diff --git a/recordmydesktop/src/rmd_make_dummy_pointer.c b/recordmydesktop/src/rmd_make_dummy_pointer.c index e49178e..7b409cf 100644 --- a/recordmydesktop/src/rmd_make_dummy_pointer.c +++ b/recordmydesktop/src/rmd_make_dummy_pointer.c @@ -26,17 +26,22 @@ #include "config.h" +#include + #include "rmd_types.h" #include "rmd_macro.h" #include "rmd_make_dummy_pointer.h" -unsigned char *MakeDummyPointer(DisplaySpecs *specs, +unsigned char *MakeDummyPointer(Display *display, + DisplaySpecs *specs, int size, int color, int type, unsigned char *npxl){ + unsigned long bpixel = XBlackPixel(display, specs->screen); + unsigned long wpixel = XWhitePixel(display, specs->screen); int i,k,o='.'; unsigned long b=(color)?'w':'b', w=(color)?'b':'w'; @@ -59,18 +64,15 @@ unsigned char *MakeDummyPointer(DisplaySpecs *specs, {o,o,o,o,o,o,w,w,o,o,o,o,o,o,o,o}} }; unsigned char *ret=malloc(size*sizeof(char[size*4])); - unsigned char wp[4]={ - ((specs->wpixel^0xff000000)>>24), - ((specs->wpixel^0x00ff0000)>>16), - ((specs->wpixel^0x0000ff00)>>8), - ((specs->wpixel^0x000000ff)) - }; - unsigned char bp[4]={ - ((specs->bpixel^0xff000000)>>24), - ((specs->bpixel^0x00ff0000)>>16), - ((specs->bpixel^0x0000ff00)>>8), - ((specs->bpixel^0x000000ff)) - }; + unsigned char wp[4]={ (wpixel ^ 0xff000000) >> 24, + (wpixel ^ 0x00ff0000) >> 16, + (wpixel ^ 0x0000ff00) >> 8, + (wpixel ^ 0x000000ff) }; + unsigned char bp[4]={ (bpixel ^ 0xff000000) >> 24, + (bpixel ^ 0x00ff0000) >> 16, + (bpixel ^ 0x0000ff00) >> 8, + (bpixel ^ 0x000000ff) }; + *npxl=((wp[0]-1)!=bp[0])?wp[0]-100:wp[0]-102; for(i=0;i