2013-03-16 20:25:38 +00:00
|
|
|
/*
|
2006-11-08 11:47:44 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
2007-05-12 17:30:37 +00:00
|
|
|
* PROJECT: ReactOS DirectX
|
2015-09-27 14:00:29 +00:00
|
|
|
* FILE: dll/directx/ddraw/Ddraw/callbacks_dd_hel.c
|
2007-05-12 17:30:37 +00:00
|
|
|
* PURPOSE: HEL Callbacks for Direct Draw
|
2006-11-08 11:47:44 +00:00
|
|
|
* PROGRAMMER: Magnus Olsen
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-11-19 19:13:35 +00:00
|
|
|
#include "rosdraw.h"
|
2006-11-08 11:47:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern DDPIXELFORMAT pixelformats[];
|
|
|
|
extern DWORD pixelformatsCount;
|
|
|
|
|
|
|
|
/*
|
2007-10-19 23:21:45 +00:00
|
|
|
* Direct Draw Callbacks
|
2006-11-08 11:47:44 +00:00
|
|
|
*/
|
2007-10-19 23:21:45 +00:00
|
|
|
|
2006-11-08 11:47:44 +00:00
|
|
|
DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
2006-11-29 22:09:52 +00:00
|
|
|
|
2006-11-30 21:04:09 +00:00
|
|
|
DWORD CALLBACK HelDdSetColorKey(LPDDHAL_DRVSETCOLORKEYDATA lpDrvSetColorKey)
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
2006-11-29 22:09:52 +00:00
|
|
|
|
2006-11-08 11:47:44 +00:00
|
|
|
|
|
|
|
DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
|
2006-12-13 21:28:52 +00:00
|
|
|
{
|
|
|
|
DEVMODE DevMode;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB_str("in hel");
|
2006-11-08 11:47:44 +00:00
|
|
|
|
2006-12-13 21:28:52 +00:00
|
|
|
DevMode.dmSize = (WORD)sizeof(DEVMODE);
|
|
|
|
DevMode.dmDriverExtra = 0;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
SetMode->ddRVal = DDERR_UNSUPPORTEDMODE;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
|
|
|
if (EnumDisplaySettingsEx(NULL, SetMode->dwModeIndex, &DevMode, 0 ) != 0)
|
2006-12-13 21:28:52 +00:00
|
|
|
{
|
2007-06-22 19:34:06 +00:00
|
|
|
|
2006-12-13 21:28:52 +00:00
|
|
|
|
|
|
|
if (ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
|
|
|
{
|
|
|
|
DX_STUB_str("FAIL");
|
2007-10-19 23:21:45 +00:00
|
|
|
SetMode->ddRVal = DDERR_UNSUPPORTEDMODE;
|
2006-12-13 21:28:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DX_STUB_str("OK");
|
|
|
|
SetMode->ddRVal = DD_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return DDHAL_DRIVER_HANDLED;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CALLBACK HelDdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
2010-11-30 16:29:49 +00:00
|
|
|
DWORD CALLBACK HelDdCreatePalette(LPDDHAL_CREATEPALETTEDATA lpCreatePalette)
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
2010-11-30 16:29:49 +00:00
|
|
|
DDRAWI_DDRAWPALETTE_GBL* ddPalGbl = lpCreatePalette->lpDDPalette;
|
|
|
|
LOGPALETTE* logPal ;
|
|
|
|
WORD size=1;
|
|
|
|
|
|
|
|
if(ddPalGbl->dwFlags & DDRAWIPAL_2)
|
|
|
|
size = 2;
|
|
|
|
else if(ddPalGbl->dwFlags & DDRAWIPAL_4)
|
|
|
|
size = 4;
|
|
|
|
else if(ddPalGbl->dwFlags & DDRAWIPAL_16)
|
|
|
|
size = 16;
|
|
|
|
else if(ddPalGbl->dwFlags & DDRAWIPAL_256)
|
|
|
|
size = 256;
|
|
|
|
|
|
|
|
DxHeapMemAlloc(logPal, sizeof(LOGPALETTE) + size*sizeof(PALETTEENTRY));
|
|
|
|
if(logPal == NULL)
|
|
|
|
{
|
|
|
|
lpCreatePalette->ddRVal = DDERR_OUTOFMEMORY;
|
|
|
|
return DDHAL_DRIVER_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
logPal->palVersion = 0x300;
|
|
|
|
logPal->palNumEntries = size;
|
|
|
|
CopyMemory(&logPal->palPalEntry[0], lpCreatePalette->lpColorTable, size*sizeof(PALETTEENTRY));
|
|
|
|
|
|
|
|
ddPalGbl->hHELGDIPalette = CreatePalette(logPal);
|
|
|
|
|
|
|
|
if (ddPalGbl->hHELGDIPalette == NULL)
|
|
|
|
{
|
|
|
|
DxHeapMemFree(logPal);
|
|
|
|
lpCreatePalette->ddRVal = DDERR_INVALIDOBJECT;
|
|
|
|
return DDHAL_DRIVER_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
DxHeapMemFree(logPal);
|
|
|
|
ddPalGbl->lpColorTable = lpCreatePalette->lpColorTable;
|
|
|
|
ddPalGbl->dwFlags |= DDRAWIPAL_INHEL | DDRAWIPAL_GDI ;
|
|
|
|
lpCreatePalette->ddRVal = DD_OK;
|
|
|
|
return DDHAL_DRIVER_HANDLED;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CALLBACK HelDdGetScanLine(LPDDHAL_GETSCANLINEDATA lpGetScanLine)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_WINDBG_trace();
|
|
|
|
DX_STUB_str("Not implement yet, return DD_OK for not bsod\n");
|
|
|
|
lpSetExclusiveMode->ddRVal = DD_OK;
|
2007-10-19 23:21:45 +00:00
|
|
|
|
2006-12-13 21:28:52 +00:00
|
|
|
return DDHAL_DRIVER_HANDLED;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)
|
|
|
|
{
|
2006-12-13 21:28:52 +00:00
|
|
|
DX_STUB;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|