Author: greatlrd
Date: Sun Apr 9 15:53:23 2006
New Revision: 21525
URL:
http://svn.reactos.ru/svn/reactos?rev=21525&view=rev
Log:
Implement frist HEL Callback
HelDdCanCreateSurface
Fix minors bugs
there and there
Modified:
trunk/reactos/dll/directx/ddraw/ddraw.rbuild
trunk/reactos/dll/directx/ddraw/hal/surface_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
trunk/reactos/dll/directx/ddraw/soft/surface_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 Apr 9 15:53:23 2006
@@ -37,6 +37,7 @@
<directory name="soft">
<file>ddraw_hel.c</file>
<file>surface_hel.c</file>
+ <file>surface_callbacks_hel.c</file>
</directory>
<directory name="thunks">
Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Sun Apr 9 15:53:23 2006
@@ -22,8 +22,16 @@
mDdCanCreateSurface.lpDD = &This->mDDrawGlobal;
- mDdCanCreateSurface.CanCreateSurface =
This->mCallbacks.HALDD.CanCreateSurface;
-
+
+ if (This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags &
DDHAL_CB32_CANCREATESURFACE)
+ {
+ mDdCanCreateSurface.CanCreateSurface =
This->mCallbacks.HALDD.CanCreateSurface;
+ }
+ else
+ {
+ mDdCanCreateSurface.CanCreateSurface =
This->mCallbacks.HELDD.CanCreateSurface;
+ }
+
mDdCreateSurface.lpDD = &This->mDDrawGlobal;
mDdCreateSurface.CreateSurface = This->mCallbacks.HALDD.CreateSurface;
@@ -335,15 +343,22 @@
Lock.Lock = This->owner->mCallbacks.HALDDSurface.Lock;
Lock.dwFlags = flags;
Lock.lpDDSurface = This->Surf->mpPrimaryLocals[0];
- Lock.lpDD = &This->owner->mDDrawGlobal;
- // FIXME lpSurfData
- //Lock.lpSurfData =
-
- if (This->owner->mCallbacks.HALDDSurface.Lock(&Lock)!=
DDHAL_DRIVER_NOTHANDLED)
+ Lock.lpDD = &This->owner->mDDrawGlobal;
+ Lock.lpSurfData = NULL;
+
+ if (This->owner->mCallbacks.HALDDSurface.Lock(&Lock)!=
DDHAL_DRIVER_HANDLED)
{
return Lock.ddRVal;
}
- // FIXME LPDDSURFACEDESC2
+
+ RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
+ memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
+ pDDSD->dwSize = sizeof(DDSURFACEDESC2);
+
+ pDDSD->lpSurface = Lock.lpSurfData;
+
+
+ // FIXME some things is wrong it does not show the data on screen ??
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 Apr 9 15:53:23 2006
@@ -10,10 +10,11 @@
#include "rosdraw.h"
-static const DDPIXELFORMAT pixelformats[] =
+const DDPIXELFORMAT pixelformats[] =
{
/* 8bpp paletted */
- { sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, { 8 } },
+ { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 24 }, { 0xFF0000 },
+ { 0x00FF00 }, { 0x0000FF } },
/* 15bpp 5/5/5 */
{ sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 16 }, { 0x7C00 }, { 0x3E0 },
{ 0x1F } },
@@ -28,6 +29,37 @@
{ 0x00FF00 }, { 0x0000FF } }
};
+const DWORD pixelformatsCount = sizeof(pixelformats) / sizeof(DDPIXELFORMAT);
+
+/* more surface format not adding it */
+ /* 4 bit paletted 0 */
+ // sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_PALETTEINDEXED4, 0, 4, 0x00, 0x00,
0x00, 0x00
+
+ ///* 8bpp paletted 1 */
+ //{sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, 8, 0, 0, 0, 0},
+
+ ///* 15bpp 5:5:5 RGB 2 */
+ //{sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0x7c00, 0x03e0, 0x001f, 0},
+
+ ///* 15bpp 1:5:5:5 ARGB 3 */
+ //{sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, 16, 0x7c00, 0x03e0,
0x001f, 0x8000},
+
+ ///* 16bpp 5:6:5 RGB 4 */
+ //{sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0xf800, 0x07e0, 0x001f, 0}
+
+ ///* 16bpp 4:4:4:4 ARGB 5 */
+ //{sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS,´0, 16, 0x0f00,
0x00f0, 0x000f, 0xf000},
+
+ /* 24bpp 8/8/8 RGB 6 */
+ // {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 24 , 0x00FF0000,
0x0000FF00 , 0x000000FF, 0 },
+
+ /* 32bpp 8:8:8 RGB 7 */
+ // {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff,
0},
+
+ /* 32bpp 8:8:8:8 ARGB 8*/
+ // {sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, 32, 0x00ff0000,
0x0000ff00, 0x000000ff, 0xff000000}
+
+
/*
@@ -625,7 +657,7 @@
break;
case 32:
-
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[3],sizeof(DDPIXELFORMAT));
+
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[4],sizeof(DDPIXELFORMAT));
break;
default:
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 Sun Apr 9 15:53:23 2006
@@ -187,6 +187,10 @@
HRESULT Hel_DDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 override,
DWORD dwFlags);
HRESULT Hel_DDrawSurface_UpdateOverlayDisplay (LPDIRECTDRAWSURFACE7 iface, DWORD
dwFlags);
+/* HEL CALLBACK */
+DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd);
+
+
/* Setting for HEL should be move to ros special reg key ? */
/* setup how much graphic memory should hel be limit, set it now to 64MB */
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 Apr 9 15:53:23 2006
@@ -17,6 +17,11 @@
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
This->HELMemoryAvilable = HEL_GRAPHIC_MEMORY_MAX;
+
+
+ This->mCallbacks.HELDD.dwFlags = DDHAL_CB32_CANCREATESURFACE;
+ This->mCallbacks.HELDD.CanCreateSurface = HelDdCanCreateSurface;
+
return DD_OK;
}
Modified: trunk/reactos/dll/directx/ddraw/soft/surface_hel.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/soft/surf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/soft/surface_hel.c (original)
+++ trunk/reactos/dll/directx/ddraw/soft/surface_hel.c Sun Apr 9 15:53:23 2006
@@ -56,3 +56,7 @@
+
+
+
+