Author: greatlrd
Date: Mon Jul 24 12:34:18 2006
New Revision: 23263
URL:
http://svn.reactos.org/svn/reactos?rev=23263&view=rev
Log:
Kill a ungly hack; I will rewrite it later
Modified:
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
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 Mon Jul 24 12:34:18 2006
@@ -488,55 +488,7 @@
}
-const DDPIXELFORMAT pixelformats[] =
-{
- /* 8bpp paletted */
- { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 24 }, { 0xFF0000 },
- { 0x00FF00 }, { 0x0000FF } },
- /* 15bpp 5/5/5 */
- { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 16 }, { 0x7C00 }, { 0x3E0 },
- { 0x1F } },
- /* 16bpp 5/6/5 */
- { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 16 }, { 0xF800 }, { 0x7E0 },
- { 0x1F } },
- /* 24bpp 8/8/8 */
- { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 24 }, { 0xFF0000 },
- { 0x00FF00 }, { 0x0000FF } },
- /* 32bpp 8/8/8 */
- { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, { 32 }, { 0xFF0000 },
- { 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}
-
+
@@ -993,108 +945,7 @@
LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2 callback)
{
DX_WINDBG_trace();
-
- IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
- DDSURFACEDESC2 desc_callback;
- DEVMODE DevMode;
- int iMode=0;
-
- if (pDDSD!=NULL)
- {
- // FIXME fill in pDDSD
- }
-
- RtlZeroMemory(&desc_callback, sizeof(DDSURFACEDESC2));
- desc_callback.dwSize = sizeof(DDSURFACEDESC2);
-
- desc_callback.dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT|DDSD_CAPS |
DDSD_PITCH;
-
- if (dwFlags & DDEDM_REFRESHRATES)
- {
- desc_callback.dwFlags |= DDSD_REFRESHRATE;
- desc_callback.dwRefreshRate = This->mDDrawGlobal.dwMonitorFrequency;
- }
-
-
- /// FIXME check if the mode are suppretd before sending it back
-
- while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0))
- {
-
- if (pDDSD)
- {
- if ((pDDSD->dwFlags & DDSD_WIDTH) && (pDDSD->dwWidth !=
DevMode.dmPelsWidth))
- continue;
- if ((pDDSD->dwFlags & DDSD_HEIGHT) && (pDDSD->dwHeight !=
DevMode.dmPelsHeight))
- continue;
- if ((pDDSD->dwFlags & DDSD_PIXELFORMAT) &&
(pDDSD->ddpfPixelFormat.dwFlags & DDPF_RGB) &&
- (pDDSD->ddpfPixelFormat.dwRGBBitCount != DevMode.dmBitsPerPel))
- continue;
- }
-
-
- desc_callback.dwHeight = DevMode.dmPelsHeight;
- desc_callback.dwWidth = DevMode.dmPelsWidth;
-
- if (DevMode.dmFields & DM_DISPLAYFREQUENCY)
- {
- desc_callback.dwRefreshRate = DevMode.dmDisplayFrequency;
- }
-
- switch(DevMode.dmBitsPerPel)
- {
- case 8:
-
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[0],sizeof(DDPIXELFORMAT));
- break;
-
- case 15:
-
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[1],sizeof(DDPIXELFORMAT));
- break;
-
- case 16:
-
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[2],sizeof(DDPIXELFORMAT));
- break;
-
-
- case 24:
-
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[3],sizeof(DDPIXELFORMAT));
- break;
-
- case 32:
-
memcpy(&desc_callback.ddpfPixelFormat,&pixelformats[4],sizeof(DDPIXELFORMAT));
- break;
-
- default:
- break;
- }
-
- if (desc_callback.ddpfPixelFormat.dwRGBBitCount==15)
- {
- desc_callback.lPitch = DevMode.dmPelsWidth + (8 - ( DevMode.dmPelsWidth %
8)) % 8;
- }
- else
- {
- desc_callback.lPitch = DevMode.dmPelsWidth *
(desc_callback.ddpfPixelFormat.dwRGBBitCount / 8);
- desc_callback.lPitch = desc_callback.lPitch + (8 - (desc_callback.lPitch %
8)) % 8;
- }
-
- desc_callback.ddsCaps.dwCaps = 0;
- if (desc_callback.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8)
- {
- desc_callback.ddsCaps.dwCaps |= DDSCAPS_PALETTE;
- }
-
-
- if (callback(&desc_callback, context) == DDENUMRET_CANCEL)
- {
-
- return DD_OK;
- }
-
- iMode++;
- }
-
- return DD_OK;
+ DX_STUB;
}
HRESULT WINAPI Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,