Author: greatlrd
Date: Mon May 1 14:04:59 2006
New Revision: 21760
URL:
http://svn.reactos.ru/svn/reactos?rev=21760&view=rev
Log:
Working on a redesign of whole directdraw interface
frist commit of many
Added:
trunk/reactos/dll/directx/ddraw/clipper.c (with props)
Removed:
trunk/reactos/dll/directx/ddraw/main/clipper_main.c
Modified:
trunk/reactos/dll/directx/ddraw/ddraw.rbuild
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
Added: trunk/reactos/dll/directx/ddraw/clipper.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/clipper.c…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/clipper.c (added)
+++ trunk/reactos/dll/directx/ddraw/clipper.c Mon May 1 14:04:59 2006
@@ -1,0 +1,132 @@
+/* $Id$
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS
+ * FILE: lib/ddraw/main/clipper.c
+ * PURPOSE: IDirectDrawClipper Implementation
+ * PROGRAMMER: Maarten Bosma
+ *
+ */
+
+#include "rosdraw.h"
+
+
+ULONG WINAPI
+DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface)
+{
+ DX_WINDBG_trace();
+
+ IDirectDrawClipperImpl* This = (IDirectDrawClipperImpl*)iface;
+ ULONG ref=0;
+
+ if (iface!=NULL)
+ {
+ ref = InterlockedDecrement( (PLONG) &This->ref);
+
+ if (ref == 0)
+ {
+ /* Add here if we need releae some memory pointer before
+ * exists
+ */
+
+ if (This!=NULL)
+ {
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+ }
+ }
+ return ref;
+}
+
+ULONG WINAPI
+DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface)
+{
+ DX_WINDBG_trace();
+
+ IDirectDrawClipperImpl * This = (IDirectDrawClipperImpl*)iface;
+
+ ULONG ref=0;
+
+ if (iface!=NULL)
+ {
+ ref = InterlockedIncrement( (PLONG) &This->ref);
+ }
+ return ref;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_Initialize( LPDIRECTDRAWCLIPPER iface,
+ LPDIRECTDRAW lpDD,
+ DWORD dwFlags)
+{
+ /* FIXME not implment */
+ DX_WINDBG_trace();
+ DX_STUB_DD_OK;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_SetHwnd( LPDIRECTDRAWCLIPPER iface,
+ DWORD dwFlags,
+ HWND hWnd)
+{
+ /* FIXME not implment */
+ DX_WINDBG_trace();
+ DX_STUB_DD_OK;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_GetClipList( LPDIRECTDRAWCLIPPER iface,
+ LPRECT lpRect,
+ LPRGNDATA lpClipList,
+ LPDWORD lpdwSize)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_SetClipList( LPDIRECTDRAWCLIPPER iface,
+ LPRGNDATA lprgn,
+ DWORD dwFlag)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_QueryInterface( LPDIRECTDRAWCLIPPER iface,
+ REFIID riid,
+ LPVOID* ppvObj)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_GetHWnd( LPDIRECTDRAWCLIPPER iface,
+ HWND* hWndPtr)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+DirectDrawClipper_IsClipListChanged( LPDIRECTDRAWCLIPPER iface,
+ BOOL* lpbChanged)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+IDirectDrawClipperVtbl DirectDrawClipper_Vtable =
+{
+ DirectDrawClipper_QueryInterface,
+ DirectDrawClipper_AddRef,
+ DirectDrawClipper_Release,
+ DirectDrawClipper_GetClipList,
+ DirectDrawClipper_GetHWnd,
+ DirectDrawClipper_Initialize,
+ DirectDrawClipper_IsClipListChanged,
+ DirectDrawClipper_SetClipList,
+ DirectDrawClipper_SetHwnd
+};
Propchange: trunk/reactos/dll/directx/ddraw/clipper.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/dll/directx/ddraw/clipper.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rbu…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original)
+++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Mon May 1 14:04:59 2006
@@ -18,6 +18,8 @@
<file>main.c</file>
<file>regsvr.c</file>
+ <file>clipper.c</file>
+
<directory name="hal">
<file>ddraw_hal.c</file>
<file>surface_hal.c</file>
@@ -25,8 +27,7 @@
<directory name="main">
<file>ddraw_main.c</file>
- <file>surface_main.c</file>
- <file>clipper_main.c</file>
+ <file>surface_main.c</file>
<file>color_main.c</file>
<file>gamma_main.c</file>
<file>palette_main.c</file>
Removed: trunk/reactos/dll/directx/ddraw/main/clipper_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/clip…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/clipper_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/clipper_main.c (removed)
@@ -1,78 +1,0 @@
-/* $Id$
- *
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS
- * FILE: lib/ddraw/main/clipper.c
- * PURPOSE: IDirectDrawClipper Implementation
- * PROGRAMMER: Maarten Bosma
- *
- */
-
-#include "rosdraw.h"
-
-
-ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface)
-{
- return 0;
-}
-
-ULONG WINAPI Main_DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface)
-{
- return 1;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_Initialize(
- LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags)
-{
- return DD_OK;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_SetHwnd(
- LPDIRECTDRAWCLIPPER iface, DWORD dwFlags, HWND hWnd)
-{
- DX_STUB;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_GetClipList(
- LPDIRECTDRAWCLIPPER iface, LPRECT lpRect, LPRGNDATA lpClipList,
- LPDWORD lpdwSize)
-{
- DX_STUB;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_SetClipList(
- LPDIRECTDRAWCLIPPER iface,LPRGNDATA lprgn,DWORD dwFlag)
-{
- DX_STUB;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_QueryInterface(
- LPDIRECTDRAWCLIPPER iface, REFIID riid, LPVOID* ppvObj)
-{
- return E_NOINTERFACE;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_GetHWnd(
- LPDIRECTDRAWCLIPPER iface, HWND* hWndPtr)
-{
- DX_STUB;
-}
-
-HRESULT WINAPI Main_DirectDrawClipper_IsClipListChanged(
- LPDIRECTDRAWCLIPPER iface, BOOL* lpbChanged)
-{
- DX_STUB;
-}
-
-IDirectDrawClipperVtbl DirectDrawClipper_Vtable =
-{
- Main_DirectDrawClipper_QueryInterface,
- Main_DirectDrawClipper_AddRef,
- Main_DirectDrawClipper_Release,
- Main_DirectDrawClipper_GetClipList,
- Main_DirectDrawClipper_GetHWnd,
- Main_DirectDrawClipper_Initialize,
- Main_DirectDrawClipper_IsClipListChanged,
- Main_DirectDrawClipper_SetClipList,
- Main_DirectDrawClipper_SetHwnd
-};
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Mon May 1 14:04:59 2006
@@ -789,13 +789,18 @@
IDirectDrawImpl *This = (IDirectDrawImpl *)iface;
if (pDriverCaps != NULL)
- {
+ {
+
+
+
Main_DirectDraw_GetAvailableVidMem(iface,
&ddscaps,
&This->mDDrawGlobal.ddCaps.dwVidMemTotal,
&This->mDDrawGlobal.ddCaps.dwVidMemFree);
-
+
RtlCopyMemory(pDriverCaps,&This->mDDrawGlobal.ddCaps,sizeof(DDCORECAPS));
+ pDriverCaps->dwSize=sizeof(DDCAPS);
+
status = DD_OK;
}
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Mon May 1 14:04:59 2006
@@ -159,6 +159,54 @@
} IDirectDrawPaletteImpl;
+/******** Gamma Object ********/
+
+typedef struct
+{
+ IDirectDrawGammaControlVtbl* lpVtbl;
+ LONG ref;
+ IDirectDrawImpl* Owner;
+ IDirectDrawSurfaceImpl* Surf;
+
+
+} IDirectDrawGammaImpl;
+
+/******** Color Object ********/
+
+typedef struct
+{
+ IDirectDrawColorControlVtbl* lpVtbl;
+ LONG ref;
+ IDirectDrawImpl* Owner;
+ IDirectDrawSurfaceImpl* Surf;
+
+
+} IDirectDrawColorImpl;
+
+/******** Kernel Object ********/
+
+typedef struct
+{
+ IDirectDrawKernelVtbl* lpVtbl;
+ LONG ref;
+ IDirectDrawImpl* Owner;
+ IDirectDrawSurfaceImpl* Surf;
+
+} IDirectDrawKernelImpl;
+
+/******** SurfaceKernel Object ********/
+
+typedef struct
+{
+ IDirectDrawSurfaceKernelVtbl* lpVtbl;
+ LONG ref;
+ IDirectDrawImpl* Owner;
+ IDirectDrawSurfaceImpl* Surf;
+ IDirectDrawKernelImpl * Kernl;
+
+} IDirectDrawSurfaceKernelImpl;
+
+
/*********** VTables ************/
extern IDirectDraw7Vtbl DirectDraw7_Vtable;
@@ -173,6 +221,8 @@
extern IDirectDrawClipperVtbl DirectDrawClipper_Vtable;
extern IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable;
extern IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable;
+extern IDirectDrawKernelVtbl DirectDrawKernel_Vtable;
+extern IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable;
/********* Prototypes **********/
@@ -211,8 +261,16 @@
HRESULT Hel_DDrawSurface_UpdateOverlayDisplay (LPDIRECTDRAWSURFACE7 iface, DWORD
dwFlags);
/* HEL CALLBACK */
-DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd);
-DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface);
+DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver);
+DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface);
+DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey);
+DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode);
+DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA
lpWaitForVerticalBlank);
+DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface);
+DWORD CALLBACK HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette);
+DWORD CALLBACK HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine);
+DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode);
+DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface);
/* Setting for HEL should be move to ros special reg key ? */
@@ -232,6 +290,18 @@
firstcall = FALSE; \
} \
return DDERR_UNSUPPORTED;
+
+#define DX_STUB_DD_OK \
+ static BOOL firstcall = TRUE; \
+ if (firstcall) \
+ { \
+ char buffer[1024]; \
+ sprintf ( buffer, "Function %s is not implemented yet (%s:%d)\n",
__FUNCTION__,__FILE__,__LINE__ ); \
+ OutputDebugStringA(buffer); \
+ firstcall = FALSE; \
+ } \
+ return DD_OK;
+
#define DX_STUB_str(x) \
static BOOL firstcall = TRUE; \