From 68bdfbc595d36ad2423860423c7018f0e1699d95 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 13 May 2005 01:01:08 +0000 Subject: Removed overuse of DefaultDepth --- Xbit.c | 19 +++++++++++-------- Xbit.h | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Xbit.c b/Xbit.c index b4907fa..ef38c06 100644 --- a/Xbit.c +++ b/Xbit.c @@ -333,6 +333,12 @@ void SetCurrentWin(Window w) } +int GetVisualDepth(void) +{ + return vinfo.depth; +} + + Window OpenWin (int argc, char **argv, char *title, @@ -583,7 +589,7 @@ Pixmap GetBitmap(const char *fn, int *w, int *h, int *hx, int *hy) return(0); } - ret=XCreatePixmap(display,current->w,*w,*h,DefaultDepth(display,0)); + ret=XCreatePixmap(display,current->w,*w,*h,vinfo.depth); XCopyPlane(display,bm,ret,current->gc,0,0,*w,*h,0,0,1L); @@ -638,8 +644,7 @@ void Resize(int w,int h) for(f=0;fmultino;f++) { XFreePixmap(display,current->pm[f]); - current->pm[f]=XCreatePixmap(display,current->w,w,h, - DefaultDepth(display,0)); + current->pm[f]=XCreatePixmap(display,current->w,w,h,vinfo.depth); XFillRectangle(display,current->pm[f], current->gc,0,0,current->pw,current->ph); } @@ -657,12 +662,10 @@ void Resize(int w,int h) current->pmi=0; - current->pm[0]=XCreatePixmap(display,current->w,w,h, - DefaultDepth(display,0)); + current->pm[0]=XCreatePixmap(display,current->w,w,h,vinfo.depth); if (current->buffer) - current->pm[1]=XCreatePixmap(display,current->w,w,h, - DefaultDepth(display,0)); + current->pm[1]=XCreatePixmap(display,current->w,w,h,vinfo.depth); } @@ -778,7 +781,7 @@ void EnableBuffers(int no, ulong clscol) for(f=0;fmultino;f++) { current->pm[f]=XCreatePixmap(display,current->w,current->ww,current->wh, - DefaultDepth(display,0)); + vinfo.depth); XFillRectangle(display,current->pm[f], current->gc,0,0,current->pw,current->ph); } diff --git a/Xbit.h b/Xbit.h index 0804b55..5bc7ff1 100644 --- a/Xbit.h +++ b/Xbit.h @@ -204,6 +204,8 @@ void SetCurrentWin Window w ); +int GetVisualDepth(void); + XImage *CreateXImage(void); void ClsXImage -- cgit v1.2.3