Author: greatlrd
Date: Sun Jul 23 19:37:57 2006
New Revision: 23247
URL:
http://svn.reactos.org/svn/reactos?rev=23247&view=rev
Log:
1. Remove more dead code after all commit
2. Move Cleanup code to own file.
Added:
trunk/reactos/dll/directx/ddraw/cleanup.c (with props)
Modified:
trunk/reactos/dll/directx/ddraw/ddraw.rbuild
trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c
Added: trunk/reactos/dll/directx/ddraw/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/cleanup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/cleanup.c (added)
+++ trunk/reactos/dll/directx/ddraw/cleanup.c Sun Jul 23 19:37:57 2006
@@ -1,0 +1,51 @@
+/* $Id: main.c 21434 2006-04-01 19:12:56Z greatlrd $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * FILE: lib/ddraw/ddraw.c
+ * PURPOSE: DirectDraw Library
+ * PROGRAMMER: Magnus Olsen (greatlrd)
+ *
+ */
+
+#include <windows.h>
+#include "rosdraw.h"
+#include "d3dhal.h"
+
+VOID
+Cleanup(LPDIRECTDRAW7 iface)
+{
+ IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+ if (This->mDDrawGlobal.hDD != 0)
+ {
+ DdDeleteDirectDrawObject (&This->mDDrawGlobal);
+ }
+
+ if (This->mpTextures != NULL)
+ {
+ DxHeapMemFree(This->mpTextures);
+ }
+
+ if (This->mpFourCC != NULL)
+ {
+ DxHeapMemFree(This->mpFourCC);
+ }
+
+ if (This->mpvmList != NULL)
+ {
+ DxHeapMemFree(This->mpvmList);
+ }
+
+ if (This->mpModeInfos != NULL)
+ {
+ DxHeapMemFree(This->mpModeInfos);
+ }
+
+ if (This->hdc != NULL)
+ {
+ DeleteDC(This->hdc);
+ }
+
+}
+
Propchange: trunk/reactos/dll/directx/ddraw/cleanup.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rb…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original)
+++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Sun Jul 23 19:37:57 2006
@@ -18,6 +18,7 @@
<file>main.c</file>
<file>regsvr.c</file>
<file>startup.c</file>
+ <file>cleanup.c</file>
<file>clipper.c</file>
<file>color.c</file>
Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddra…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sun Jul 23 19:37:57 2006
@@ -9,43 +9,6 @@
*/
#include "rosdraw.h"
-
-VOID
-Hal_DirectDraw_Release (LPDIRECTDRAW7 iface)
-{
- IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
-
- if (This->mDDrawGlobal.hDD != 0)
- {
- DdDeleteDirectDrawObject (&This->mDDrawGlobal);
- }
-
- if (This->mpTextures != NULL)
- {
- DxHeapMemFree(This->mpTextures);
- }
-
- if (This->mpFourCC != NULL)
- {
- DxHeapMemFree(This->mpFourCC);
- }
-
- if (This->mpvmList != NULL)
- {
- DxHeapMemFree(This->mpvmList);
- }
-
- if (This->mpModeInfos != NULL)
- {
- DxHeapMemFree(This->mpModeInfos);
- }
-
- if (This->hdc != NULL)
- {
- DeleteDC(This->hdc);
- }
-
-}
HRESULT
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddr…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun Jul 23 19:37:57 2006
@@ -138,8 +138,7 @@
ChangeDisplaySettings(NULL, 0);
}
- Hal_DirectDraw_Release(iface);
- //Hel_DirectDraw_Release(iface);
+ Cleanup(iface);
if (This!=NULL)
{
HeapFree(GetProcessHeap(), 0, This);
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun Jul 23 19:37:57 2006
@@ -15,6 +15,10 @@
HRESULT WINAPI StartDirectDrawHal(LPDIRECTDRAW* iface);
HRESULT WINAPI StartDirectDrawHel(LPDIRECTDRAW* iface);
HRESULT WINAPI Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface, REFIID id, BOOL
ex);
+
+/* DirectDraw Cleanup code only internal use */
+VOID Cleanup(LPDIRECTDRAW7 iface);
+
/* own macro to alloc memmory */
#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m)
Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddr…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original)
+++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun Jul 23 19:37:57 2006
@@ -11,13 +11,6 @@
#include "rosdraw.h"
-
-
-VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface)
-{
-}
-
-
HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
LPDWORD total, LPDWORD free)
{
@@ -26,12 +19,6 @@
*total = HEL_GRAPHIC_MEMORY_MAX;
*free = This->HELMemoryAvilable;
return DD_OK;
-}
-
-
-HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h)
-{
- DX_STUB;
}
HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
@@ -43,55 +30,3 @@
{
DX_STUB;
}
-
-HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD
dwHeight,
- DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
-{
- IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
-
- // this only for exclusive mode
- if(!(This->cooperative_level & DDSCL_EXCLUSIVE))
- return DDERR_NOEXCLUSIVEMODE;
-
- // change the resolution using normal WinAPI function
- DEVMODE mode;
- mode.dmSize = sizeof(mode);
- mode.dmPelsWidth = dwWidth;
- mode.dmPelsHeight = dwHeight;
- mode.dmBitsPerPel = dwBPP;
-
- //mode.dmDisplayFrequency = dwRefreshRate;
- mode.dmFields = 0;
-
- DX_STUB_str("in hel");
-
- if(dwWidth)
- mode.dmFields |= DM_PELSWIDTH;
- if(dwHeight)
- mode.dmFields |= DM_PELSHEIGHT;
- if(dwBPP)
- mode.dmFields |= DM_BITSPERPEL;
- /*
- if(dwRefreshRate)
- mode.dmFields |= DM_DISPLAYFREQUENCY;
- */
- if (ChangeDisplaySettings(&mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
- return DDERR_UNSUPPORTEDMODE;
-
-
- // TODO: reactivate ddraw object, maximize window, set it in foreground
- // and set excluive mode (if implemented by the driver)
-
- /* FIXME fill the DirectDrawGlobal right the modeindex old and new */
-
- //if(dwWidth)
- // This->Height = dwWidth;
- //if(dwHeight)
- // This->Width = dwHeight;
- //if(dwBPP)
- // This->Bpp = dwBPP;
-
- return DD_OK;
-}
-
-