summaryrefslogtreecommitdiff
path: root/plugins/dfxvideo/draw.c
diff options
context:
space:
mode:
authoriCatButler <i.am.catbutler@gmail.com>2016-03-30 15:07:35 +0100
committeriCatButler <i.am.catbutler@gmail.com>2016-03-30 15:07:35 +0100
commit8b4350fee747708ffd376744ef5dc1e239a87ba6 (patch)
treea9ab6e2f25e06edc7c668353f8000856704f7fa3 /plugins/dfxvideo/draw.c
parente3df273095a5800e3dcdcb63bd66e269c0c2d3a8 (diff)
downloadpcsxr-8b4350fee747708ffd376744ef5dc1e239a87ba6.tar.gz
Bring up to date with PCSX-R master (97809)
Diffstat (limited to 'plugins/dfxvideo/draw.c')
-rwxr-xr-xplugins/dfxvideo/draw.c63
1 files changed, 38 insertions, 25 deletions
diff --git a/plugins/dfxvideo/draw.c b/plugins/dfxvideo/draw.c
index 73d0fef8..3cc5e1c2 100755
--- a/plugins/dfxvideo/draw.c
+++ b/plugins/dfxvideo/draw.c
@@ -902,11 +902,10 @@ static XVisualInfo *myvisual;
Display *display;
static Colormap colormap;
Window window;
+Window overlay;
static GC hGC;
static XImage * Ximage;
-static XvImage * XCimage;
static XImage * XPimage=0;
-char * Xpixels;
char * pCaptionText;
static int fx=0;
@@ -949,16 +948,16 @@ void DestroyDisplay(void)
XFreeGC(display,hGC);
hGC = 0;
}
+ if (overlay)
+ {
+ XDestroyWindow(display, overlay);
+ overlay = 0;
+ }
if(Ximage)
{
XDestroyImage(Ximage);
Ximage=0;
}
- if(XCimage)
- {
- XFree(XCimage);
- XCimage=0;
- }
XShmDetach(display,&shminfo);
shmdt(shminfo.shmaddr);
@@ -1254,6 +1253,22 @@ void CreateDisplay(void)
return;
}
+ overlay=XCreateWindow(display,window,
+ iResX - 128,0,128,96,
+ 0,myvisual->depth,
+ InputOutput,myvisual->visual,
+ CWBorderPixel | CWBackPixel |
+ CWEventMask | CWDontPropagate |
+ CWColormap | CWCursor | CWEventMask,
+ &winattr);
+
+ if(!overlay)
+ {
+ fprintf(stderr,"Failed in XCreateWindow()!!!\n");
+ DestroyDisplay();
+ return;
+ }
+
delwindow = XInternAtom(display,"WM_DELETE_WINDOW",0);
XSetWMProtocols(display, window, &delwindow, 1);
@@ -1352,14 +1367,6 @@ void CreateDisplay(void)
else
color = 0;
- Xpixels = (char *)malloc(8*8*4);
- for(i = 0; i < 8*8; ++i)
- ((uint32_t *)Xpixels)[i] = color;
-
- XCimage = XvCreateImage(display,xv_port,xv_id,
- (char *)Xpixels, 8, 8);
-
-
/*
Allocate max that could be needed:
Big(est?) PSX res: 640x512
@@ -1676,6 +1683,7 @@ void DoBufferSwap(void)
_w, _h, //dst w,h
1
);
+ DisplayPic();
if(ulKeybits&KEY_SHOWFPS) //DisplayText(); c // paint menu text
{
@@ -1695,7 +1703,6 @@ void DoBufferSwap(void)
XDrawImageString(display,window,hGC,2,13,szDispBuf,strlen(szDispBuf));
}
- //if(XPimage) DisplayPic();
XFree(xvi);
}
@@ -1707,15 +1714,11 @@ void DoClearScreenBuffer(void) // CLEAR DX BUFFER
XGetGeometry(display, window, &_dw, (int *)&_d, (int *)&_d, &_w, &_h, &_d, &_d);
- XvPutImage(display, xv_port, window, hGC, XCimage,
- 0, 0, 8, 8, 0, 0, _w, _h);
//XSync(display,False);
}
void DoClearFrontBuffer(void) // CLEAR DX BUFFER
{/*
- XPutImage(display,window,hGC, XCimage,
- 0, 0, 0, 0, iResX, iResY);
XSync(display,False);*/
}
@@ -1877,9 +1880,7 @@ void CreatePic(unsigned char * pMem)
void DestroyPic(void)
{
if(XPimage)
- { /*
- XPutImage(display,window,hGC, XCimage,
- 0, 0, 0, 0, iResX, iResY);*/
+ {
XDestroyImage(XPimage);
XPimage=0;
}
@@ -1887,8 +1888,20 @@ void DestroyPic(void)
void DisplayPic(void)
{
- XPutImage(display,window,hGC, XPimage,
- 0, 0, iResX-128, 0,128,96);
+ static int mapped = 0;
+ if (XPimage) {
+ if (!mapped) {
+ XMapWindow(display, overlay);
+ mapped = 1;
+ }
+ XPutImage(display,overlay,hGC, XPimage,
+ 0,0, 0,0, 128,96);
+ } else {
+ if (mapped) {
+ XUnmapWindow(display, overlay);
+ mapped = 0;
+ }
+ }
}
void ShowGpuPic(void)