mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
1. Remove more dead code after all commit
2. Move Cleanup code to own file. svn path=/trunk/; revision=23247
This commit is contained in:
@@ -0,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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -10,43 +10,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
|
||||
Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||
|
||||
@@ -138,8 +138,7 @@ Main_DirectDraw_Release (LPDIRECTDRAW7 iface)
|
||||
ChangeDisplaySettings(NULL, 0);
|
||||
}
|
||||
|
||||
Hal_DirectDraw_Release(iface);
|
||||
//Hel_DirectDraw_Release(iface);
|
||||
Cleanup(iface);
|
||||
if (This!=NULL)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
||||
@@ -16,6 +16,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)
|
||||
#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -28,12 +21,6 @@ HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h)
|
||||
{
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
|
||||
{
|
||||
DX_STUB;
|
||||
@@ -43,55 +30,3 @@ HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user