From dc160a5bb9797dc533b04dea7eaafe35eb3ddbe7 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Sat, 16 Jun 2001 01:06:03 +0000 Subject: [PATCH] Changed overlay support to ifdef --- zsnes/src/gui/gui.asm | 7 +- zsnes/src/gui/guikeys.inc | 22 +---- zsnes/src/gui/guimouse.inc | 49 +--------- zsnes/src/gui/guiwindp.inc | 15 +-- zsnes/src/win/winlink.cpp | 187 ++++++++++++++++--------------------- 5 files changed, 89 insertions(+), 191 deletions(-) diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index cbef9d06..0791c4fa 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -176,7 +176,6 @@ EXTSYM numlockptr %ifdef __WIN32__ EXTSYM CheckPriority EXTSYM CheckAlwaysOnTop -EXTSYM initDirectDraw %endif NEWSYM GuiAsmStart @@ -586,8 +585,6 @@ NEWSYM TripleBufferWin, db 0 NEWSYM ExclusiveSound, db 0 -NEWSYM OverlayEnabled, db 0 - GUIsave equ $-GUIRAdd NEWSYM CombinDataGlob, times 3300 db 0 ; 20-name, 42-combo, 2-key#, 1-P#, 1-ff @@ -605,9 +602,9 @@ ModemOKStat db 0 ; OK is detected on modem status ; LOAD STAT INPT OPT VID SND CHT NET GMKEY GUIOP ABT RSET SRC STCN MOVE CMBO ADDO GUIwinposxo dd 0,5 ,60 ,30 ,55 ,50 ,65 ,5 ,30 ,20 ,10 ,80 ,65 ,20 ,70 ,50 ,3 ,50 -GUIwinposyo dd 0,20 ,70 ,30 ,20 ,20 ,22 ,20 ,30 ,20 ,20 ,50 ,60 ,30 ,65 ,50 ,22 ,60 +GUIwinposyo dd 0,20 ,70 ,30 ,20 ,20 ,26 ,20 ,30 ,20 ,20 ,50 ,60 ,30 ,65 ,50 ,22 ,60 GUIwinsizex dd 0,244 ,126 ,189 ,167 ,170 ,148 ,244 ,8*16,13*16,240 ,7*16,9*16,8*16,9*16,140 ,250 ,160 -GUIwinsizey dd 0,190 ,3*16,166 ,190 ,196 ,184 ,191 ,40 ,189 ,192 ,98 ,42 ,40 ,42 ,70 ,190 ,60 +GUIwinsizey dd 0,190 ,3*16,166 ,190 ,192 ,178 ,191 ,40 ,189 ,192 ,98 ,42 ,40 ,42 ,70 ,190 ,60 GUIwinptr db 0 GUItextcolor db 0,0,0,0,0 diff --git a/zsnes/src/gui/guikeys.inc b/zsnes/src/gui/guikeys.inc index 221b0ec1..31f3c186 100644 --- a/zsnes/src/gui/guikeys.inc +++ b/zsnes/src/gui/guikeys.inc @@ -818,13 +818,6 @@ GUIOptionKeys: xor byte[vsyncon],1 mov al,[vsyncon] mov [cfgvsync],al -%ifdef __WIN32__ - cmp byte[OverlayEnabled],1 - jne .novsync - pushad - call initDirectDraw - popad -%endif .novsync %endif cmp dh,'M' @@ -895,14 +888,11 @@ GUIOptionKeys: jne .nosavepath xor byte[DontSavePath],1 .nosavepath + cmp dh,'I' + jne .nospcdisable + xor byte[SPCDisable],1 +.nospcdisable %ifdef __WIN32__ - cmp dh,'Y' - jne .nooverlay - xor byte[OverlayEnabled],1 - pushad - call initDirectDraw - popad -.nooverlay cmp dh,'S' jne .noalttimer xor byte[AlternateTimer],1 @@ -1036,10 +1026,6 @@ GUISoundKeys: xor byte[ExclusiveSound],1 .noexclusivesound %endif - cmp dh,'D' - jne .nospcdisable - xor byte[SPCDisable],1 -.nospcdisable ret .sampratenext db 1,4,5,6,2,3,0,0,0,0 diff --git a/zsnes/src/gui/guimouse.inc b/zsnes/src/gui/guimouse.inc index 7343e1dc..fda312ba 100644 --- a/zsnes/src/gui/guimouse.inc +++ b/zsnes/src/gui/guimouse.inc @@ -994,24 +994,6 @@ GUIWinClicked: %%noclick %endmacro -%ifdef __WIN32__ -%macro GUIClickCButtonov 3 - cmp eax,%1+1 - jl %%noclick - cmp edx,%2+3 - jl %%noclick - cmp eax,%1+6 - jg %%noclick - cmp edx,%2+8 - jg %%noclick - xor %3,1 - pushad - call initDirectDraw - popad -%%noclick -%endmacro -%endif - %macro GUIClickCButtonat 3 cmp eax,%1+1 jl %%noclick @@ -1151,32 +1133,6 @@ GUIWinClicked: %%noclick %endmacro -%ifndef __LINUX__ -%macro GUIClickCButton2ov 5 - cmp eax,%1+1 - jl %%noclick - cmp edx,%2+3 - jl %%noclick - cmp eax,%1+6 - jg %%noclick - cmp edx,%2+8 - jg %%noclick - xor %3,%5 - mov al,%3 - mov %4,al -%ifdef __WIN32__ - cmp byte[OverlayEnabled],1 - jne %%noinit - pushad - call initDirectDraw - popad -%%noinit -%endif - ret -%%noclick -%endmacro -%endif - %macro GUIClickCButton3 5 cmp eax,%1+1 jl %%noclick @@ -2144,7 +2100,7 @@ DisplayGUIOptionClick: GUIClickCButton2 11,36,byte[newengen],byte[cfgnewgfx],1 .invalidng %ifndef __LINUX__ - GUIClickCButton2ov 11,46,byte[vsyncon],byte[cfgvsync],1 + GUIClickCButton2 11,46,byte[vsyncon],byte[cfgvsync],1 %endif GUIClickCButton2 11,56,byte[FPUCopy],byte[cfgcopymethod],2 GUIClickCButtonM 11,66,byte[pl12s34] @@ -2163,8 +2119,8 @@ DisplayGUIOptionClick: GUIClickCButton 11,146,byte[LatestSave] GUIClickCButton 11,156,byte[AutoState] GUIClickCButton 11,166,byte[DontSavePath] + GUIClickCButton 11,176,byte[SPCDisable] %ifdef __WIN32__ - GUIClickCButtonov 11,176,byte[OverlayEnabled] GUIClickCButtonat 11,186,byte[AlternateTimer] %endif ; Frameskip = 0 @@ -2296,7 +2252,6 @@ DisplayGUISoundClick: %ifdef __WIN32__ GUIClickCButton 11,171,byte[ExclusiveSound] %endif - GUIClickCButton 11,181,byte[SPCDisable] cmp eax,15 jl near .nosrate cmp edx,61 diff --git a/zsnes/src/gui/guiwindp.inc b/zsnes/src/gui/guiwindp.inc index e18c055d..72f1ce22 100644 --- a/zsnes/src/gui/guiwindp.inc +++ b/zsnes/src/gui/guiwindp.inc @@ -1374,7 +1374,7 @@ DisplayGUIOption: GUIOuttextwin2u 4,26,151,GUIOptionTextH,9 GUIOuttextwin2u 4,26,161,GUIOptionTextI,15 GUIOuttextwin2u 4,26,171,GUIOptionTextJ,0 - GUIOuttextwin2u 4,26,181,GUIOptionTextK,6 + GUIOuttextwin2u 4,26,181,GUIOptionTextK,1 add byte[GUItextcolor],15 GUIOuttextwin2 4,5,15,[GUITemp] GUIOuttextwin2 4,25,30,GUIOptionText2 @@ -1505,7 +1505,7 @@ DisplayGUIOption: .nocheckbox13 GUIDisplayIconWin 4,11,166,[GUITemp] mov dword[GUITemp],GUIIconDataCheckBoxUC - cmp byte[OverlayEnabled],0 + cmp byte[SPCDisable],0 je .nocheckbox14 mov dword[GUITemp],GUIIconDataCheckBoxC .nocheckbox14 @@ -1580,7 +1580,7 @@ GUIOptionTextG db 'OLD GFX MODE 2',0 GUIOptionTextH db 'START AT LATEST SAVE',0 GUIOptionTextI db 'AUTO STATE SAVE/LOAD',0 GUIOptionTextJ db 'DON',39,'T SAVE CURRENT PATH',0 -GUIOptionTextK db 'OVERLAY SUPPORT',0 +GUIOptionTextK db 'DISABLE SOUND CPU EMU',0 GUIOptionTextL db 'USE ALTERNATE TIMER',0 GUIOptionText8 db '-',0 GUIOptionText9 db '+',0 @@ -2142,7 +2142,6 @@ DisplayGUISound: GUIOuttextwin2u 6,26,166,GUISoundTextM,0 %ifdef __WIN32__ GUIOuttextwin2u 6,26,176,GUISoundTextN,1 - GUIOuttextwin2u 6,26,186,GUISoundTextO,0 %endif add byte[GUItextcolor],15 GUIOuttextwin2 6,25,25,GUISoundText1 @@ -2170,7 +2169,6 @@ DisplayGUISound: GUIOuttextwin2 6,25,165,GUISoundTextM %ifdef __WIN32__ GUIOuttextwin2 6,25,175,GUISoundTextN - GUIOuttextwin2 6,25,185,GUISoundTextO %endif mov al,[GUIWincol] mov byte[GUItextcolor],al @@ -2270,12 +2268,6 @@ DisplayGUISound: mov dword[GUITemp],GUIIconDataCheckBoxC .nocheckbox9 GUIDisplayIconWin 6,11,171,[GUITemp] - mov dword[GUITemp],GUIIconDataCheckBoxUC - cmp byte[OverlayEnabled],0 - je .nocheckbox10 - mov dword[GUITemp],GUIIconDataCheckBoxC -.nocheckbox10 - GUIDisplayIconWin 6,11,181,[GUITemp] %endif DrawGUIWinBox 6,15,61,69,69,167 mov dword[GUITemp],GUISoundText7 @@ -2368,7 +2360,6 @@ GUISoundTextK db 'LOW PASS FILTER',0 GUISoundTextL db 'SOUND BUFFERING',0 GUISoundTextM db 'CUBIC SPLINE INTERP',0 GUISoundTextN db 'EXCLUSIVE MODE',0 -GUISoundTextO db 'DISABLE SPC EMU',0 DisplayGUICheatConv: mov eax,[ccheatnpos] diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 9c99a2e0..ffc5e6c5 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -15,6 +15,8 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//#define OVERLAY_SUPPORT + #define DIRECTINPUT_VERSION 0x0800 #define DIRECTSOUND_VERSION 0x0800 @@ -44,9 +46,9 @@ DWORD FirstSound=1; int AllowDefault=0; int SoundEnabled=1; -DWORD Overlay = 0; -DWORD Overlay_failed = 0; +#ifdef OVERLAY_SUPPORT DWORD Overlay_Colorkey = 0; +#endif DWORD FirstActivate = 1; @@ -78,7 +80,9 @@ LPDIRECTDRAWSURFACE7 DD_Primary = NULL; LPDIRECTDRAWSURFACE7 DD_CFB = NULL; LPDIRECTDRAWSURFACE7 DD_BackBuffer = NULL; LPDIRECTDRAWCLIPPER lpDDClipper = NULL; +#ifdef OVERLAY_SUPPORT DDOVERLAYFX ddofx; +#endif RECT rcWindow; LPDIRECTINPUT8 DInput = NULL; @@ -150,11 +154,6 @@ extern "C" void drawscreenwin(void); DWORD LastUsedPos=0; DWORD CurMode=-1; - - void initDirectDraw() - { - InitDirectDraw(); - } } void DDrawError(){ @@ -166,20 +165,18 @@ void DDrawError(){ extern "C" BYTE vsyncon; extern "C" BYTE TripleBufferWin; -extern "C" BYTE OverlayEnabled; -typedef DWORD (__fastcall* lpLockSurface)(); -DWORD __fastcall LockSurface_normal(); -DWORD __fastcall LockSurface_overlay(); -lpLockSurface LockSurface; - -typedef void (__fastcall* lpUnlockSurface)(); -void __fastcall UnlockSurface_normal(); -void __fastcall UnlockSurface_overlay(); -lpUnlockSurface UnlockSurface; - -void DrawScreen_normal() +void DrawScreen() { +#ifdef OVERLAY_SUPPORT + if (vsyncon == 1) + { + if (DD_BackBuffer == NULL) InitDirectDraw(); + DD_CFB->Flip(NULL,DDFLIP_WAIT); + } + else + if (DD_BackBuffer) InitDirectDraw(); +#else if (vsyncon == 1) { if(FullScreen == 1) @@ -215,12 +212,7 @@ void DrawScreen_normal() DD_Primary->Blt(&rcWindow, DD_CFB, NULL, DDBLT_WAIT, NULL); } } -} - -void DrawScreen_overlay() -{ - if (vsyncon == 1) - DD_CFB->Flip(NULL,DDFLIP_WAIT); +#endif } DWORD InputEn=0; @@ -283,7 +275,6 @@ extern "C" void CheckAlwaysOnTop() extern "C" void MinimizeWindow() { - if (Overlay && (DD_CFB)) DD_CFB->UpdateOverlay(NULL, DD_Primary, NULL, DDOVER_HIDE, NULL); ShowWindow(hMainWindow, SW_MINIMIZE); IsActivated = 0; } @@ -463,30 +454,29 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_MOVE: break; case WM_PAINT: - if (Overlay && Overlay_Colorkey && (DD_Primary)) - { - HDC hdc; - POINT pt; - RECT rc1; - struct tagPAINTSTRUCT ps; - DDBLTFX ddbfx; +#ifdef OVERLAY_SUPPORT + HDC hdc; + POINT pt; + RECT rc1; + struct tagPAINTSTRUCT ps; + DDBLTFX ddbfx; - hdc = BeginPaint(hWnd, &ps); + hdc = BeginPaint(hWnd, &ps); - rc1 = ps.rcPaint; - ClientToScreen(hMainWindow, ( LPPOINT )&rc1 ); - ClientToScreen(hMainWindow, ( LPPOINT )&rc1 + 1 ); + rc1 = ps.rcPaint; + ClientToScreen(hMainWindow, ( LPPOINT )&rc1 ); + ClientToScreen(hMainWindow, ( LPPOINT )&rc1 + 1 ); - ddbfx.dwSize = sizeof(DDBLTFX); - ddbfx.dwFillColor = Overlay_Colorkey; + ddbfx.dwSize = sizeof(DDBLTFX); + ddbfx.dwFillColor = Overlay_Colorkey; - DD_Primary->Blt(&rc1, NULL, &rc1, DDBLT_COLORFILL | - DDBLT_WAIT, &ddbfx); + DD_Primary->Blt(&rc1, NULL, &rc1, DDBLT_COLORFILL | + DDBLT_WAIT, &ddbfx); - EndPaint(hWnd, &ps); - } - else + EndPaint(hWnd, &ps); +#else ValidateRect(hWnd,NULL); +#endif break; case WM_ACTIVATE: if (LOWORD(wParam) != WA_INACTIVE) @@ -494,10 +484,11 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) IsActivated = 1; if(FirstActivate == 0) { - if (Overlay == 1) - ShowWindow(hMainWindow, SW_SHOWNORMAL); +#ifdef OVERLAY_SUPPORT + ShowWindow(hMainWindow, SW_SHOWNORMAL); +#endif initwinvideo(); - if (Overlay == 1) +#ifdef OVERLAY_SUPPORT { HRESULT hr; RECT rc1; @@ -528,8 +519,8 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) sprintf(err,"IDirectDrawSurface7::UpdateOverlay failed: 0x%x", hr); MessageBox(NULL, err, "DirectDraw Error", MB_ICONERROR); } - } +#endif } InputAcquire(); if (FirstActivate == 1) FirstActivate = 0; @@ -1230,20 +1221,21 @@ int InitDirectDraw() } - if (OverlayEnabled == 1 && !Overlay_failed) +#ifdef OVERLAY_SUPPORT + ddcaps.dwSize = sizeof(DDCAPS); + if(lpDD->GetCaps(&ddcaps, NULL) != DD_OK) { - ddcaps.dwSize = sizeof(DDCAPS); - if(lpDD->GetCaps(&ddcaps, NULL) != DD_OK) - { - MessageBox(NULL, "IDirectDraw7::GetCaps failed.", "DirectDraw Error", MB_ICONERROR); - } - if ((ddcaps.dwCaps & DDCAPS_OVERLAY) && - (ddcaps.dwCaps & DDCAPS_OVERLAYSTRETCH)) - Overlay = 1; - if (ddcaps.dwCaps & DDCAPS_COLORKEY) - Overlay_Colorkey = 1; + MessageBox(NULL, "IDirectDraw7::GetCaps failed.", "DirectDraw Error", MB_ICONERROR); } - else Overlay = 0; + if ((ddcaps.dwCaps & DDCAPS_OVERLAY) == 0 || + (ddcaps.dwCaps & DDCAPS_OVERLAYSTRETCH) == 0) + { + MessageBox(NULL, "Sorry, no support for overlays.", "DirectDraw Error", MB_ICONERROR); + exit(0); + } + if (ddcaps.dwCaps & DDCAPS_COLORKEY) + Overlay_Colorkey = 1; +#endif if(FullScreen == 1) { @@ -1265,26 +1257,27 @@ int InitDirectDraw() CheckAlwaysOnTop(); } -overlay_failed: - ZeroMemory(&ddsd2, sizeof(DDSURFACEDESC2)); ddsd2.dwSize = sizeof(DDSURFACEDESC2); ddsd2.dwFlags = DDSD_CAPS; ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - if(!Overlay && FullScreen == 1) +#ifndef OVERLAY_SUPPORT + if(FullScreen == 1) { ddsd2.dwFlags |= DDSD_BACKBUFFERCOUNT; ddsd2.dwBackBufferCount = 2; ddsd2.ddsCaps.dwCaps |= DDSCAPS_FLIP | DDSCAPS_COMPLEX; } +#endif if (lpDD->CreateSurface( &ddsd2, &DD_Primary, NULL) != DD_OK) { MessageBox(NULL, "IDirectDraw7::CreateSurface failed.", "DirectDraw Error", MB_ICONERROR); } - if(!Overlay && FullScreen == 1) +#ifndef OVERLAY_SUPPORT + if(FullScreen == 1) { ddsd2.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; if (DD_Primary->GetAttachedSurface(&ddsd2.ddsCaps, &DD_BackBuffer) != DD_OK) @@ -1292,6 +1285,7 @@ overlay_failed: MessageBox(NULL, "IDirectDrawSurface7::GetAttachedSurface failed.", "DirectDraw Error", MB_ICONERROR); } } +#endif if(FullScreen == 0) { if (lpDD->CreateClipper(0,&lpDDClipper,NULL) != DD_OK) @@ -1324,11 +1318,13 @@ overlay_failed: BitDepth=format.dwRGBBitCount; GBitMask=format.dwGBitMask; // 0x07E0 or not - if (BitDepth==24 && Overlay==0) +#ifndef OVERLAY_SUPPORT + if (BitDepth==24) { MessageBox(NULL,"ZSNESw does not support 24bit color.\nPlease change your resolution to either 16bit or 32bit color","Error",MB_OK); exit(0); } +#endif converta = (BitDepth==16 && GBitMask!=0x07E0); @@ -1336,8 +1332,9 @@ overlay_failed: ddsd2.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; ddsd2.dwWidth = SurfaceX; ddsd2.dwHeight = SurfaceY; - if (Overlay) - { + +#ifdef OVERLAY_SUPPORT + DWORD flags = DDOVER_SHOW, ddofx_ptr = NULL; ddsd2.ddsCaps.dwCaps = DDSCAPS_OVERLAY; @@ -1400,10 +1397,8 @@ overlay_failed: { DD_Primary->Release(); - Overlay = 0; - Overlay_failed = 1; - OverlayEnabled = 0; - goto overlay_failed; + MessageBox(NULL,"Sorry, no overlay hardware available.", "DirectDraw Error", MB_ICONERROR); + exit(0); } if ( hr != DD_OK ) @@ -1477,12 +1472,7 @@ overlay_nocolorkey: DD_Primary->Blt(&rc1, NULL, &rc1, DDBLT_COLORFILL | DDBLT_WAIT, &ddbfx); } - - LockSurface = (lpLockSurface) &LockSurface_overlay; - UnlockSurface = (lpUnlockSurface) &UnlockSurface_overlay; - } - else - { +#else ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; @@ -1491,32 +1481,15 @@ overlay_nocolorkey: { MessageBox(NULL, "IDirectDraw7::CreateSurface failed.", "DirectDraw Error", MB_ICONERROR); } - LockSurface = (lpLockSurface) &LockSurface_normal; - UnlockSurface = (lpUnlockSurface) &UnlockSurface_normal; - } +#endif + return TRUE; } BYTE* SurfBuf; DDSURFACEDESC2 ddsd; -DWORD __fastcall LockSurface_normal() -{ - if (DD_CFB == NULL) return(0); - - memset(&ddsd,0,sizeof(ddsd)); - ddsd.dwSize = sizeof( ddsd ); - ddsd.dwFlags = DDSD_LPSURFACE | DDSD_PITCH; - if (DD_CFB->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL) != DD_OK) - { - return(0); - } - - SurfBuf = (BYTE*)ddsd.lpSurface; - return(ddsd.lPitch); -} - -DWORD __fastcall LockSurface_overlay() +DWORD LockSurface() { HRESULT hr; @@ -1526,9 +1499,11 @@ DWORD __fastcall LockSurface_overlay() memset(&ddsd,0,sizeof(ddsd)); ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_LPSURFACE | DDSD_PITCH; - if (DD_BackBuffer) +#ifdef OVERLAY_SUPPORT + if (vsyncon == 1 && (DD_BackBuffer)) hr=DD_BackBuffer->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL); else +#endif hr=DD_CFB->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL); if (hr != DD_OK) @@ -1540,19 +1515,15 @@ DWORD __fastcall LockSurface_overlay() return(ddsd.lPitch); } -void __fastcall UnlockSurface_normal() +void UnlockSurface() { - DD_CFB->Unlock((struct tagRECT *)ddsd.lpSurface); - DrawScreen_normal(); -} - -void __fastcall UnlockSurface_overlay() -{ - if (DD_BackBuffer) +#ifdef OVERLAY_SUPPORT + if (vsyncon == 1 && (DD_BackBuffer)) DD_BackBuffer->Unlock((struct tagRECT *)ddsd.lpSurface); else +#endif DD_CFB->Unlock((struct tagRECT *)ddsd.lpSurface); - DrawScreen_overlay(); + DrawScreen(); } extern "C" { @@ -2797,14 +2768,12 @@ int GetMouseButton(void) if (Y>(GetSystemMetrics( SM_CYSCREEN )-WindowHeight)) Y=(GetSystemMetrics( SM_CYSCREEN )-WindowHeight); InputRead(); initwinvideo(); - if (Overlay && (DD_CFB)) DD_CFB->SetOverlayPosition(X, Y); } } if (Moving==1) { Moving=0; initwinvideo(); - if (Overlay && (DD_CFB)) DD_CFB->SetOverlayPosition(X, Y); } return((int)MouseButton); }