mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
Sorry I have create a mess in ddraw.c
1. found why createsurface did stop working, fixed 2. Split some surface member betwin gbl and lcl struct 3. Reimplement the revert I did, implement Revision: 23263 and Revision: 23262 again 4. Revert new createsurface code and setdisplay mode code that was intrudes 5. Alot other changes as well. 6. Todo Need remove the old code for HAL and HEL split. 7. move Our ddraw working again with apps it did work with. 8. Almost complete kill the file ddraw_hal.c some api is left be kill for at moment they are in use svn path=/trunk/; revision=23268
This commit is contained in:
parent
5b0708bb5f
commit
44cab3a37e
9 changed files with 586 additions and 763 deletions
|
@ -1,51 +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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* $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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include "rosdraw.h"
|
||||
|
||||
|
||||
|
||||
|
||||
HRESULT
|
||||
Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||
LPDWORD total, LPDWORD free)
|
||||
|
@ -42,7 +44,29 @@ Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
|||
return mem.ddRVal;
|
||||
}
|
||||
|
||||
HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h)
|
||||
{
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData;
|
||||
|
||||
if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK))
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
WaitVectorData.lpDD = &This->mDDrawGlobal;
|
||||
WaitVectorData.dwFlags = dwFlags;
|
||||
WaitVectorData.hEvent = (DWORD)h;
|
||||
WaitVectorData.ddRVal = DDERR_NOTPALETTIZED;
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDD.WaitForVerticalBlank(&WaitVectorData) != DDHAL_DRIVER_HANDLED)
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
return WaitVectorData.ddRVal;
|
||||
}
|
||||
|
||||
HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
|
||||
{
|
||||
|
@ -67,31 +91,36 @@ HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
|
|||
return GetScan.ddRVal;
|
||||
}
|
||||
|
||||
HRESULT Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
|
||||
|
||||
|
||||
|
||||
|
||||
HRESULT Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
{
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
DDHAL_SETMODEDATA mode;
|
||||
|
||||
DDHAL_FLIPTOGDISURFACEDATA FlipGdi;
|
||||
|
||||
if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE))
|
||||
if (!(This->mDDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_SETMODE))
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
FlipGdi.lpDD = &This->mDDrawGlobal;
|
||||
FlipGdi.ddRVal = DDERR_NOTPALETTIZED;
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDD.FlipToGDISurface(&FlipGdi) != DDHAL_DRIVER_HANDLED)
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
/* FIXME where should FlipGdi.dwToGDI be fill in */
|
||||
return FlipGdi.ddRVal;
|
||||
mode.lpDD = &This->mDDrawGlobal;
|
||||
mode.ddRVal = DDERR_NODRIVERSUPPORT;
|
||||
|
||||
|
||||
|
||||
// FIXME : add search for which mode.ModeIndex we should use
|
||||
// FIXME : fill the mode.inexcl;
|
||||
// FIXME : fill the mode.useRefreshRate;
|
||||
|
||||
if (This->mDDrawGlobal.lpDDCBtmp->HALDD.SetMode(&mode) != DDHAL_DRIVER_HANDLED)
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
return mode.ddRVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@ HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest,
|
|||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
|
||||
mDdBlt.lpDDDestSurface = This->Owner->mpPrimaryLocals[0];
|
||||
mDdBlt.lpDDDestSurface = This->Surf->mpPrimaryLocals[0];
|
||||
|
||||
if (!DdResetVisrgn(This->Owner->mpPrimaryLocals[0], NULL))
|
||||
if (!DdResetVisrgn(This->Surf->mpPrimaryLocals[0], NULL))
|
||||
{
|
||||
return DDERR_NOGDI;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURF
|
|||
Lock.lpDD = &This->Owner->mDDrawGlobal;
|
||||
Lock.lpSurfData = NULL;
|
||||
|
||||
if (!DdResetVisrgn(&This->Owner->mPrimaryLocal, NULL))
|
||||
if (!DdResetVisrgn(&This->Surf->mPrimaryLocal, NULL))
|
||||
{
|
||||
OutputDebugStringA("Here DdResetVisrgn lock");
|
||||
return DDERR_UNSUPPORTED;
|
||||
|
@ -138,13 +138,13 @@ HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURF
|
|||
{
|
||||
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
|
||||
// FIXME the interanl mddsdPrimary shall be DDSURFACEDESC2
|
||||
memcpy(pDDSD,&This->Owner->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
pDDSD->dwSize = sizeof(DDSURFACEDESC2);
|
||||
}
|
||||
if (pDDSD->dwSize == sizeof(DDSURFACEDESC))
|
||||
{
|
||||
RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC));
|
||||
memcpy(pDDSD,&This->Owner->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
|
||||
pDDSD->dwSize = sizeof(DDSURFACEDESC);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -125,7 +125,7 @@ Main_DDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
|
|||
That = (IDirectDrawSurfaceImpl*)pAttach;
|
||||
|
||||
//FIXME Have I put This and That in right order ?? DdAttachSurface(from, to)
|
||||
return DdAttachSurface( That->Owner->mpPrimaryLocals[0],This->Owner->mpPrimaryLocals[0]);
|
||||
return DdAttachSurface( That->Surf->mpPrimaryLocals[0],This->Surf->mpPrimaryLocals[0]);
|
||||
}
|
||||
|
||||
/* MSDN: "not currently implemented." */
|
||||
|
@ -274,7 +274,7 @@ Main_DDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface, LPDDSCAPS2 pCaps)
|
|||
This = (IDirectDrawSurfaceImpl*)iface;
|
||||
|
||||
RtlZeroMemory(pCaps,sizeof(DDSCAPS2));
|
||||
pCaps->dwCaps = This->Owner->mddsdPrimary.ddsCaps.dwCaps;
|
||||
pCaps->dwCaps = This->Surf->mddsdPrimary.ddsCaps.dwCaps;
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
@ -321,14 +321,14 @@ Main_DDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC)
|
|||
for now we aussme the surface exits and create the hDC for it
|
||||
*/
|
||||
|
||||
if ((HDC)This->Owner->mPrimaryLocal.hDC == NULL)
|
||||
if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL)
|
||||
{
|
||||
This->Owner->mPrimaryLocal.hDC = (ULONG_PTR)GetDC((HWND)This->Owner->mDDrawGlobal.lpExclusiveOwner->hWnd);
|
||||
*phDC = (HDC)This->Owner->mPrimaryLocal.hDC;
|
||||
This->Surf->mPrimaryLocal.hDC = (ULONG_PTR)GetDC((HWND)This->Owner->mDDrawGlobal.lpExclusiveOwner->hWnd);
|
||||
*phDC = (HDC)This->Surf->mPrimaryLocal.hDC;
|
||||
}
|
||||
else
|
||||
{
|
||||
*phDC = (HDC)This->Owner->mpPrimaryLocals[0]->hDC;
|
||||
*phDC = (HDC)This->Surf->mpPrimaryLocals[0]->hDC;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
|
@ -420,7 +420,7 @@ Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
|
|||
}
|
||||
|
||||
RtlZeroMemory(pDDSD,dwSize);
|
||||
memcpy(pDDSD, &This->Owner->mddsdPrimary, sizeof(DDSURFACEDESC));
|
||||
memcpy(pDDSD, &This->Surf->mddsdPrimary, sizeof(DDSURFACEDESC));
|
||||
pDDSD->dwSize = dwSize;
|
||||
|
||||
return DD_OK;
|
||||
|
@ -482,7 +482,7 @@ Main_DDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC)
|
|||
|
||||
/* FIXME check if surface exits or not */
|
||||
|
||||
if ((HDC)This->Owner->mPrimaryLocal.hDC == NULL)
|
||||
if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL)
|
||||
{
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,10 @@ typedef struct
|
|||
DWORD *mpFourCC;
|
||||
|
||||
UINT mcTextures;
|
||||
DDSURFACEDESC2 *mpTextures;
|
||||
DDSURFACEDESC *mpTextures;
|
||||
|
||||
|
||||
|
||||
|
||||
/* ExclusiveOwner */
|
||||
|
||||
|
@ -82,7 +85,7 @@ typedef struct
|
|||
|
||||
/* HEL stuff */
|
||||
DWORD HELMemoryAvilable;
|
||||
|
||||
|
||||
/* DD Callbacks info */
|
||||
DDHAL_DESTROYDRIVERDATA mDdDestroyDriver;
|
||||
DDHAL_CREATESURFACEDATA mDdCreateSurface;
|
||||
|
@ -95,15 +98,7 @@ typedef struct
|
|||
DDHAL_SETEXCLUSIVEMODEDATA mDdSetExclusiveMode;
|
||||
DDHAL_FLIPTOGDISURFACEDATA mDdFlipToGDISurface;
|
||||
|
||||
/* Primarey surface we must reach it from every where */
|
||||
DDRAWI_DDRAWSURFACE_GBL mPrimaryGlobal;
|
||||
DDRAWI_DDRAWSURFACE_MORE mPrimaryMore;
|
||||
DDRAWI_DDRAWSURFACE_LCL mPrimaryLocal;
|
||||
DDRAWI_DDRAWSURFACE_LCL *mpPrimaryLocals[1];
|
||||
DDRAWI_DDRAWCLIPPER_LCL mPrimaryClipperLocal;
|
||||
DDRAWI_DDRAWCLIPPER_GBL mPrimaryClipperGlobal;
|
||||
|
||||
DDSURFACEDESC2 mddsdPrimary;
|
||||
|
||||
/* adding a switch */
|
||||
DWORD devicetype;
|
||||
|
@ -113,6 +108,15 @@ typedef struct
|
|||
/******** Surface Object ********/
|
||||
typedef struct
|
||||
{
|
||||
/* Primarey surface we must reach it from every where */
|
||||
|
||||
DDRAWI_DDRAWSURFACE_MORE mPrimaryMore;
|
||||
DDRAWI_DDRAWSURFACE_LCL mPrimaryLocal;
|
||||
DDRAWI_DDRAWSURFACE_LCL *mpPrimaryLocals[1];
|
||||
DDRAWI_DDRAWCLIPPER_LCL mPrimaryClipperLocal;
|
||||
DDRAWI_DDRAWCLIPPER_GBL mPrimaryClipperGlobal;
|
||||
|
||||
DDSURFACEDESC mddsdPrimary;
|
||||
|
||||
DDRAWI_DDRAWSURFACE_LCL *mpInUseSurfaceLocals[1];
|
||||
|
||||
|
|
|
@ -21,12 +21,67 @@ 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;
|
||||
}
|
||||
|
||||
HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
|
||||
|
||||
|
||||
HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
{
|
||||
DX_STUB;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,187 +28,16 @@ DWORD CALLBACK HelDdCreateSurface(LPDDHAL_CREATESURFACEDATA lpCreateSurface)
|
|||
DX_STUB;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
DWORD CALLBACK HelDdSetColorKey(LPDDHAL_SETCOLORKEYDATA lpSetColorKey)
|
||||
{
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode)
|
||||
{
|
||||
// change the resolution using normal WinAPI function
|
||||
DEVMODE mode;
|
||||
mode.dmSize = sizeof(DEVMODE);
|
||||
mode.dmPelsWidth = 0;
|
||||
mode.dmPelsHeight = 0;
|
||||
mode.dmBitsPerPel = 0;
|
||||
|
||||
/* FIXME use emuate display to get the res */
|
||||
|
||||
/* 320x200 15, 16, 32 */
|
||||
if (SetMode->dwModeIndex == 0x10d)
|
||||
{
|
||||
mode.dmPelsWidth = 320;
|
||||
mode.dmPelsHeight = 200;
|
||||
mode.dmBitsPerPel = 15;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x10e)
|
||||
{
|
||||
mode.dmPelsWidth = 320;
|
||||
mode.dmPelsHeight = 200;
|
||||
mode.dmBitsPerPel = 16;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x10f)
|
||||
{
|
||||
mode.dmPelsWidth = 320;
|
||||
mode.dmPelsHeight = 200;
|
||||
mode.dmBitsPerPel = 32;
|
||||
}
|
||||
|
||||
/* 640x400 8 */
|
||||
if (SetMode->dwModeIndex == 0x100)
|
||||
{
|
||||
mode.dmPelsWidth = 640;
|
||||
mode.dmPelsHeight = 400;
|
||||
mode.dmBitsPerPel = 8;
|
||||
}
|
||||
|
||||
/* 640x480 8, 15, 16 , 32*/
|
||||
if (SetMode->dwModeIndex == 0x101)
|
||||
{
|
||||
mode.dmPelsWidth = 640;
|
||||
mode.dmPelsHeight = 480;
|
||||
mode.dmBitsPerPel = 8;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x110)
|
||||
{
|
||||
mode.dmPelsWidth = 640;
|
||||
mode.dmPelsHeight = 480;
|
||||
mode.dmBitsPerPel = 15;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x111)
|
||||
{
|
||||
mode.dmPelsWidth = 640;
|
||||
mode.dmPelsHeight = 480;
|
||||
mode.dmBitsPerPel = 16;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x112)
|
||||
{
|
||||
mode.dmPelsWidth = 640;
|
||||
mode.dmPelsHeight = 480;
|
||||
mode.dmBitsPerPel = 32;
|
||||
}
|
||||
|
||||
/* 800x600 4, 8, 15, 16 , 32*/
|
||||
if (SetMode->dwModeIndex == 0x102)
|
||||
{
|
||||
mode.dmPelsWidth = 800;
|
||||
mode.dmPelsHeight = 600;
|
||||
mode.dmBitsPerPel = 4;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x103)
|
||||
{
|
||||
mode.dmPelsWidth = 800;
|
||||
mode.dmPelsHeight = 600;
|
||||
mode.dmBitsPerPel = 8;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x113)
|
||||
{
|
||||
mode.dmPelsWidth = 800;
|
||||
mode.dmPelsHeight = 600;
|
||||
mode.dmBitsPerPel = 15;
|
||||
}
|
||||
|
||||
|
||||
if (SetMode->dwModeIndex == 0x114)
|
||||
{
|
||||
mode.dmPelsWidth = 800;
|
||||
mode.dmPelsHeight = 600;
|
||||
mode.dmBitsPerPel = 16;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x115)
|
||||
{
|
||||
mode.dmPelsWidth = 800;
|
||||
mode.dmPelsHeight = 600;
|
||||
mode.dmBitsPerPel = 32;
|
||||
}
|
||||
|
||||
/* 1024x768 8, 15, 16 , 32*/
|
||||
|
||||
if (SetMode->dwModeIndex == 0x104)
|
||||
{
|
||||
mode.dmPelsWidth = 1024;
|
||||
mode.dmPelsHeight = 768;
|
||||
mode.dmBitsPerPel = 4;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x105)
|
||||
{
|
||||
mode.dmPelsWidth = 1024;
|
||||
mode.dmPelsHeight = 768;
|
||||
mode.dmBitsPerPel = 8;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x116)
|
||||
{
|
||||
mode.dmPelsWidth = 1024;
|
||||
mode.dmPelsHeight = 768;
|
||||
mode.dmBitsPerPel = 15;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x117)
|
||||
{
|
||||
mode.dmPelsWidth = 1024;
|
||||
mode.dmPelsHeight = 768;
|
||||
mode.dmBitsPerPel = 16;
|
||||
}
|
||||
|
||||
if (SetMode->dwModeIndex == 0x118)
|
||||
{
|
||||
mode.dmPelsWidth = 1024;
|
||||
mode.dmPelsHeight = 768;
|
||||
mode.dmBitsPerPel = 32;
|
||||
}
|
||||
|
||||
//mode.dmDisplayFrequency = dwRefreshRate;
|
||||
mode.dmFields = 0;
|
||||
|
||||
DX_STUB_str("in hel");
|
||||
|
||||
if(mode.dmPelsWidth != 0)
|
||||
mode.dmFields |= DM_PELSWIDTH;
|
||||
if(mode.dmPelsHeight != 0)
|
||||
mode.dmFields |= DM_PELSHEIGHT;
|
||||
if( mode.dmBitsPerPel != 0)
|
||||
mode.dmFields |= DM_BITSPERPEL;
|
||||
/*
|
||||
if(dwRefreshRate)
|
||||
mode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
*/
|
||||
|
||||
DX_WINDBG_trace_res((int)mode.dmPelsWidth, (int)mode.dmPelsHeight, (int)mode.dmBitsPerPel );
|
||||
|
||||
if (ChangeDisplaySettings(&mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
DX_STUB_str("FAIL");
|
||||
SetMode->ddRVal = DDERR_UNSUPPORTEDMODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
DX_STUB_str("OK");
|
||||
SetMode->ddRVal = DD_OK;
|
||||
}
|
||||
|
||||
return DDHAL_DRIVER_HANDLED;
|
||||
{
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
DWORD CALLBACK HelDdWaitForVerticalBlank(LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
|
||||
|
|
|
@ -291,7 +291,7 @@ StartDirectDrawHal(LPDIRECTDRAW* iface)
|
|||
}
|
||||
|
||||
This->mcTextures = This->mD3dDriverData.dwNumTextureFormats;
|
||||
This->mpTextures = (DDSURFACEDESC2*) DxHeapMemAlloc(sizeof(DDSURFACEDESC2) * This->mcTextures);
|
||||
This->mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * This->mcTextures);
|
||||
if (This->mpTextures == NULL)
|
||||
{
|
||||
DxHeapMemFree( This->mpFourCC);
|
||||
|
@ -364,6 +364,16 @@ StartDirectDrawHal(LPDIRECTDRAW* iface)
|
|||
DriverInfo.dwExpectedSize = sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS);
|
||||
This->mHALInfo.GetDriverInfo(&DriverInfo);
|
||||
|
||||
/* Setup global surface */
|
||||
/*This->mPrimaryGlobal.dwGlobalFlags = DDRAWISURFGBL_ISGDISURFACE;
|
||||
This->mPrimaryGlobal.lpDD = &This->mDDrawGlobal;
|
||||
This->mPrimaryGlobal.lpDDHandle = &This->mDDrawGlobal;
|
||||
This->mPrimaryGlobal.wWidth = (WORD)This->mpModeInfos[0].dwWidth;
|
||||
This->mPrimaryGlobal.wHeight = (WORD)This->mpModeInfos[0].dwHeight;
|
||||
This->mPrimaryGlobal.lPitch = This->mpModeInfos[0].lPitch;*/
|
||||
|
||||
/* FIXME free it in cleanup */
|
||||
This->mDDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)DxHeapMemAlloc(sizeof(DDRAWI_DDRAWSURFACE_INT));
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue