From 3b7d0928f0b0087fc69b4b2cdae287ad0a365bb5 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Tue, 17 Apr 2001 17:35:36 +0000 Subject: [PATCH] Removed User_DirectDraw_GetCaps. Using Main_DirectDraw_GetCaps instead, and the User constructor filling in the main capability bits. --- dlls/ddraw/ddraw/dga2.c | 2 +- dlls/ddraw/ddraw/dga2.h | 2 +- dlls/ddraw/ddraw/user.c | 43 ++++++++++++++++++++++++++++++++++++- dlls/ddraw/ddraw/user.h | 5 +---- dlls/ddraw/ddraw/xvidmode.c | 4 ++-- dlls/ddraw/ddraw/xvidmode.h | 2 +- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/dlls/ddraw/ddraw/dga2.c b/dlls/ddraw/ddraw/dga2.c index ad3dcf2379f..f11c0cd32a2 100644 --- a/dlls/ddraw/ddraw/dga2.c +++ b/dlls/ddraw/ddraw/dga2.c @@ -411,7 +411,7 @@ static ICOM_VTABLE(IDirectDraw7) XF86DGA2_DirectDraw_VTable = User_DirectDraw_EnumDisplayModes, Main_DirectDraw_EnumSurfaces, Main_DirectDraw_FlipToGDISurface, - User_DirectDraw_GetCaps, + Main_DirectDraw_GetCaps, Main_DirectDraw_GetDisplayMode, Main_DirectDraw_GetFourCCCodes, Main_DirectDraw_GetGDISurface, diff --git a/dlls/ddraw/ddraw/dga2.h b/dlls/ddraw/ddraw/dga2.h index 3dd6b838da7..e744409cfa6 100644 --- a/dlls/ddraw/ddraw/dga2.h +++ b/dlls/ddraw/ddraw/dga2.h @@ -1,4 +1,4 @@ -/* Copyright 2000 TransGaming Technologies, Inc. */ +/* Copyright 2000-2001 TransGaming Technologies, Inc. */ #ifndef WINE_DDRAW_DDRAW_DGA2_H_INCLUDED #define WINE_DDRAW_DDRAW_DGA2_H_INCLUDED diff --git a/dlls/ddraw/ddraw/user.c b/dlls/ddraw/ddraw/user.c index 0e74636c88f..219766023dd 100644 --- a/dlls/ddraw/ddraw/user.c +++ b/dlls/ddraw/ddraw/user.c @@ -144,6 +144,45 @@ HRESULT User_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex) ICOM_INIT_INTERFACE(This, IDirectDraw7, User_DirectDraw_VTable); + /* capabilities */ +#define BLIT_CAPS (DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTDEPTHFILL \ + | DDCAPS_BLTSTRETCH | DDCAPS_CANBLTSYSMEM | DDCAPS_CANCLIP \ + | DDCAPS_CANCLIPSTRETCHED | DDCAPS_COLORKEY \ + | DDCAPS_COLORKEYHWASSIST) +#define CKEY_CAPS (DDCKEYCAPS_DESTBLT | DDCKEYCAPS_SRCBLT) +#define FX_CAPS (DDFXCAPS_BLTALPHA | DDFXCAPS_BLTMIRRORLEFTRIGHT \ + | DDFXCAPS_BLTMIRRORUPDOWN | DDFXCAPS_BLTROTATION90 \ + | DDFXCAPS_BLTSHRINKX | DDFXCAPS_BLTSHRINKXN \ + | DDFXCAPS_BLTSHRINKY | DDFXCAPS_BLTSHRINKXN \ + | DDFXCAPS_BLTSTRETCHX | DDFXCAPS_BLTSTRETCHXN \ + | DDFXCAPS_BLTSTRETCHY | DDFXCAPS_BLTSTRETCHYN) + This->caps.dwCaps |= DDCAPS_GDI | DDCAPS_PALETTE | BLIT_CAPS; + This->caps.dwCaps2 |= DDCAPS2_CERTIFIED | DDCAPS2_NOPAGELOCKREQUIRED | + DDCAPS2_PRIMARYGAMMA | DDCAPS2_WIDESURFACES; + This->caps.dwCKeyCaps |= CKEY_CAPS; + This->caps.dwFXCaps |= FX_CAPS; + This->caps.dwPalCaps |= DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE; + This->caps.dwVidMemTotal = 16*1024*1024; + This->caps.dwVidMemFree = 16*1024*1024; + This->caps.dwSVBCaps |= BLIT_CAPS; + This->caps.dwSVBCKeyCaps |= CKEY_CAPS; + This->caps.dwSVBFXCaps |= FX_CAPS; + This->caps.dwVSBCaps |= BLIT_CAPS; + This->caps.dwVSBCKeyCaps |= CKEY_CAPS; + This->caps.dwVSBFXCaps |= FX_CAPS; + This->caps.dwSSBCaps |= BLIT_CAPS; + This->caps.dwSSBCKeyCaps |= CKEY_CAPS; + This->caps.dwSSBFXCaps |= FX_CAPS; + This->caps.ddsCaps.dwCaps |= DDSCAPS_ALPHA | DDSCAPS_BACKBUFFER | + DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER | + DDSCAPS_OFFSCREENPLAIN | DDSCAPS_PALETTE | + DDSCAPS_PRIMARYSURFACE | DDSCAPS_SYSTEMMEMORY | + DDSCAPS_VIDEOMEMORY | DDSCAPS_VISIBLE; + This->caps.ddsOldCaps.dwCaps = This->caps.ddsCaps.dwCaps; +#undef BLIT_CAPS +#undef CKEY_CAPS +#undef FX_CAPS + return S_OK; } @@ -322,6 +361,7 @@ User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags, /* EnumSurfaces: generic */ /* FlipToGDISurface: ??? */ +#if 0 HRESULT WINAPI User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, LPDDCAPS pHELCaps) @@ -441,6 +481,7 @@ User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, return DD_OK; } +#endif HRESULT WINAPI User_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface, @@ -508,7 +549,7 @@ static ICOM_VTABLE(IDirectDraw7) User_DirectDraw_VTable = User_DirectDraw_EnumDisplayModes, Main_DirectDraw_EnumSurfaces, Main_DirectDraw_FlipToGDISurface, - User_DirectDraw_GetCaps, + Main_DirectDraw_GetCaps, Main_DirectDraw_GetDisplayMode, Main_DirectDraw_GetFourCCCodes, Main_DirectDraw_GetGDISurface, diff --git a/dlls/ddraw/ddraw/user.h b/dlls/ddraw/ddraw/user.h index ff15a64c55b..56d9a5ff339 100644 --- a/dlls/ddraw/ddraw/user.h +++ b/dlls/ddraw/ddraw/user.h @@ -1,4 +1,4 @@ -/* Copyright 2000 TransGaming Technologies Inc. */ +/* Copyright 2000-2001 TransGaming Technologies Inc. */ #ifndef WINE_DDRAW_DDRAW_USER_H_INCLUDED #define WINE_DDRAW_DDRAW_USER_H_INCLUDED @@ -36,9 +36,6 @@ User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags, LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2 callback); HRESULT WINAPI -User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, - LPDDCAPS pHELCaps); -HRESULT WINAPI User_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface, LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags); diff --git a/dlls/ddraw/ddraw/xvidmode.c b/dlls/ddraw/ddraw/xvidmode.c index 2e6141704ef..86ee2cc01ba 100644 --- a/dlls/ddraw/ddraw/xvidmode.c +++ b/dlls/ddraw/ddraw/xvidmode.c @@ -1,7 +1,7 @@ /* DirectDraw driver for User-based primary surfaces * with XF86VidMode mode switching in full-screen mode. * - * Copyright 2000 TransGaming Technologies Inc. + * Copyright 2000-2001 TransGaming Technologies Inc. */ #include "config.h" @@ -373,7 +373,7 @@ static ICOM_VTABLE(IDirectDraw7) XVidMode_DirectDraw_VTable = User_DirectDraw_EnumDisplayModes, Main_DirectDraw_EnumSurfaces, Main_DirectDraw_FlipToGDISurface, - User_DirectDraw_GetCaps, + Main_DirectDraw_GetCaps, Main_DirectDraw_GetDisplayMode, Main_DirectDraw_GetFourCCCodes, Main_DirectDraw_GetGDISurface, diff --git a/dlls/ddraw/ddraw/xvidmode.h b/dlls/ddraw/ddraw/xvidmode.h index 8ba0b18b829..556a8778546 100644 --- a/dlls/ddraw/ddraw/xvidmode.h +++ b/dlls/ddraw/ddraw/xvidmode.h @@ -1,4 +1,4 @@ -/* Copyright 2000 TransGaming Technologies, Inc. */ +/* Copyright 2000-2001 TransGaming Technologies, Inc. */ #ifndef WINE_DDRAW_DDRAW_XVIDMODE_H_INCLUDED #define WINE_DDRAW_DDRAW_XVIDMODE_H_INCLUDED