Author: greatlrd
Date: Sun May 7 12:26:40 2006
New Revision: 21819
URL:
http://svn.reactos.ru/svn/reactos?rev=21819&view=rev
Log:
revert last commit it bsd the ddraw in some case
Removed:
trunk/reactos/dll/directx/ddraw/helinterface.c
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/main/surface_main.c
trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c
trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c
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 Sun May 7 12:26:40 2006
@@ -17,7 +17,6 @@
<file>ddraw.rc</file>
<file>main.c</file>
<file>regsvr.c</file>
- <file>helinterface.c</file>
<file>clipper.c</file>
<file>color.c</file>
Modified: trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/ddraw…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/ddraw_hal.c Sun May 7 12:26:40 2006
@@ -199,7 +199,29 @@
-
+HRESULT
+Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface)
+{
+ IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+ DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode;
+
+ if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_SETEXCLUSIVEMODE))
+ {
+ return DDERR_NODRIVERSUPPORT;
+ }
+
+ SetExclusiveMode.lpDD = &This->mDDrawGlobal;
+ SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED;
+ SetExclusiveMode.dwEnterExcl = This->cooperative_level;
+
+ if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode(&SetExclusiveMode)
!= DDHAL_DRIVER_HANDLED)
+ {
+ return DDERR_NODRIVERSUPPORT;
+ }
+
+ return SetExclusiveMode.ddRVal;
+}
Removed: trunk/reactos/dll/directx/ddraw/helinterface.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/helinterf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/helinterface.c (original)
+++ trunk/reactos/dll/directx/ddraw/helinterface.c (removed)
@@ -1,40 +1,0 @@
-#include "rosdraw.h"
-
-HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface)
-{
- IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
-
- This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX;
-
- This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_DESTROYDRIVER;
- This->mCallbacks.HELDD.DestroyDriver = HelDdDestroyDriver;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATESURFACE;
- This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface;
-
- // DDHAL_CB32_
- //This->mCallbacks.HELDD.SetColorKey = HelDdSetColorKey;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETMODE;
- This->mCallbacks.HELDD.SetMode = HelDdSetMode;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_WAITFORVERTICALBLANK;
- This->mCallbacks.HELDD.WaitForVerticalBlank = HelDdWaitForVerticalBlank;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CANCREATESURFACE;
- This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_CREATEPALETTE;
- This->mCallbacks.HELDD.CreatePalette = HelDdCreatePalette;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_GETSCANLINE;
- This->mCallbacks.HELDD.GetScanLine = HelDdGetScanLine;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_SETEXCLUSIVEMODE;
- This->mCallbacks.HELDD.SetExclusiveMode = HelDdSetExclusiveMode;
-
- This->mCallbacks.HELDD.dwFlags += DDHAL_CB32_FLIPTOGDISURFACE;
- This->mCallbacks.HELDD.FlipToGDISurface = HelDdFlipToGDISurface;
-
- return DD_OK;
-}
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 Sun May 7 12:26:40 2006
@@ -290,7 +290,6 @@
DX_WINDBG_trace();
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
- DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode;
// check the parameters
if ((This->cooperative_level == cooplevel) &&
((HWND)This->mDDrawGlobal.lpExclusiveOwner->hWnd == hwnd))
@@ -314,27 +313,13 @@
//mDDrawGlobal.lpExclusiveOwner->dwLocalFlags
This->cooperative_level = cooplevel;
-
- SetExclusiveMode.lpDD = &This->mDDrawGlobal;
- SetExclusiveMode.ddRVal = DDERR_NODRIVERSUPPORT;
- SetExclusiveMode.dwEnterExcl = This->cooperative_level;
-
- if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_SETEXCLUSIVEMODE))
- {
- SetExclusiveMode.SetExclusiveMode =
This->mDDrawGlobal.lpDDCBtmp->HELDD.SetExclusiveMode;
- }
- else
- {
- SetExclusiveMode.SetExclusiveMode =
This->mDDrawGlobal.lpDDCBtmp->HALDD.SetExclusiveMode;
- }
-
- if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) !=
DDHAL_DRIVER_HANDLED)
- {
- return DDERR_NODRIVERSUPPORT;
- }
-
- return SetExclusiveMode.ddRVal;
-
+
+ if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_SETEXCLUSIVEMODE)
+ {
+ return Hal_DirectDraw_SetCooperativeLevel (iface);
+ }
+
+ return Hel_DirectDraw_SetCooperativeLevel(iface);
}
Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/surf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Sun May 7 12:26:40 2006
@@ -496,9 +496,9 @@
Main_DDrawSurface_SetClipper (LPDIRECTDRAWSURFACE7 iface,
LPDIRECTDRAWCLIPPER pDDClipper)
{
- /* FIXME not implment */
- DX_WINDBG_trace();
- DX_STUB_DD_OK;
+ DX_WINDBG_trace();
+
+ DX_STUB;
}
HRESULT WINAPI
Modified: trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/ddra…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c (original)
+++ trunk/reactos/dll/directx/ddraw/soft/ddraw_hel.c Sun May 7 12:26:40 2006
@@ -12,7 +12,25 @@
+HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface)
+{
+ IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+ This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX;
+
+ This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CANCREATESURFACE;
+ This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface;
+
+ This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CREATESURFACE;
+ This->mCallbacks.HELDD.CreateSurface = HelDdCreateSurface;
+
+ return DD_OK;
+}
+
+HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface)
+{
+ return DD_OK;
+}
VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface)
{
Modified: trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c (original)
+++ trunk/reactos/dll/directx/ddraw/soft/surface_callbacks_hel.c Sun May 7 12:26:40 2006
@@ -14,70 +14,132 @@
extern DDPIXELFORMAT pixelformats[];
extern DWORD pixelformatsCount;
-/*
- * Direct Draw Callbacks
- */
-
-DWORD CALLBACK
-HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver)
+DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd)
{
- DX_STUB;
+ DWORD count;
+
+ // FIXME check the HAL pixelformat table if it exists
+
+ // FIXME check how big the surface in byte and report it can be create or not
+ // if we got egunt with HEL memmory
+
+
+ // HEL only support 16bits & 15bits Z-Buffer
+ if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) &&
+ (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
+ {
+ pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+
+ if (DDSD_ZBUFFERBITDEPTH & pccsd->lpDDSurfaceDesc->dwFlags)
+ {
+ if (pccsd->lpDDSurfaceDesc->dwZBufferBitDepth == 16)
+ {
+ pccsd->ddRVal = DD_OK;
+ }
+ }
+ else
+ {
+ if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwZBufferBitDepth == 16)
+ {
+ pccsd->ddRVal = DD_OK;
+ }
+ }
+ return DDHAL_DRIVER_HANDLED;
+ }
+
+ // Check diffent pixel format
+ if (pccsd->bIsDifferentPixelFormat)
+ {
+ //if(pccsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC)
+ if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & 0)
+ {
+ switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC)
+ {
+ //case FOURCC_YUV422:
+ case 0:
+ // FIXME check if display is 8bmp or not if it return
DDERR_INVALIDPIXELFORMAT
+ pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount = 16;
+ pccsd->ddRVal = DD_OK;
+ return DDHAL_DRIVER_HANDLED;
+
+ default:
+ pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+ return DDHAL_DRIVER_HANDLED;
+ }
+
+ }
+ else if((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_TEXTURE))
+ {
+ for(count=0;count< pixelformatsCount ;count++)
+ {
+ if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags !=
pixelformats->dwFlags)
+ {
+ continue;
+ }
+
+ if (!(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags &
(DDPF_YUV | DDPF_FOURCC)))
+ {
+ if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount !=
pixelformats->dwRGBBitCount )
+ {
+ continue;
+ }
+ }
+
+ if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags &
DDPF_RGB)
+ {
+ if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask !=
pixelformats->dwRBitMask) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask !=
pixelformats->dwGBitMask) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask !=
pixelformats->dwBBitMask) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBAlphaBitMask
!= pixelformats->dwRGBAlphaBitMask))
+ {
+ continue;
+ }
+ }
+
+ if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_YUV)
+ {
+ if ((pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC !=
pixelformats->dwFourCC) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVBitCount !=
pixelformats->dwYUVBitCount) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYBitMask !=
pixelformats->dwYBitMask) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwUBitMask !=
pixelformats->dwUBitMask) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwVBitMask !=
pixelformats->dwVBitMask) ||
+ (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwYUVAlphaBitMask
!= pixelformats->dwYUVAlphaBitMask))
+ {
+ continue;
+ }
+ }
+ else if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags &
DDPF_FOURCC)
+ {
+
+ if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC !=
pixelformats->dwFourCC)
+ {
+ continue;
+ }
+ }
+ if (pccsd->lpDDSurfaceDesc->dwFlags & DDPF_ZPIXELS)
+ {
+ if (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwRGBZBitMask !=
pixelformats->dwRGBZBitMask)
+ {
+ continue;
+ }
+ }
+
+ pccsd->ddRVal = DD_OK;
+ return DDHAL_DRIVER_HANDLED;
+ }
+
+ // for did not found a pixel format
+ pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT;
+ return DDHAL_DRIVER_HANDLED;
+ }
+ }
+
+ // no diffent pixel format was found so we return OK
+ pccsd->ddRVal = DD_OK;
+ return DDHAL_DRIVER_HANDLED;
}
-DWORD CALLBACK
-HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
+DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
{
- DX_STUB;
+ DX_STUB;
}
-
-/*
-DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey)
-{
- DX_STUB;
-}
-*/
-
-DWORD CALLBACK
-HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
-{
- DX_STUB;
-}
-
-DWORD CALLBACK
-HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
-{
- DX_STUB;
-}
-
-DWORD CALLBACK
-HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface)
-{
- DX_STUB;
-}
-
-DWORD CALLBACK
-HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette)
-{
- DX_STUB;
-}
-
-DWORD CALLBACK
-HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine)
-{
- DX_STUB;
-}
-
-DWORD CALLBACK
-HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode)
-{
- DX_WINDBG_trace();
- DX_STUB_str("Not implement yet, return DD_OK for not bsod\n");
- return DD_OK;
-}
-
-DWORD CALLBACK
-HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)
-{
- DX_STUB;
-}
-