Use bpp from display mode for surfaces
This commit is contained in:
parent
15ff8f8e2a
commit
3c257aac86
4 changed files with 114 additions and 50 deletions
51
main.c
51
main.c
|
@ -18,47 +18,10 @@
|
|||
#include <stdio.h>
|
||||
#include "ddraw.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "surface.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* IUnknown */
|
||||
HRESULT (*QueryInterface)(void *, REFIID, void **);
|
||||
ULONG (*AddRef)(void *);
|
||||
ULONG (*Release)(void *);
|
||||
|
||||
/* IDirectDraw */
|
||||
HRESULT (*Compact)(void *);
|
||||
HRESULT (*CreateClipper)(void *);
|
||||
HRESULT (*CreatePalette)(void *, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR *, IUnknown FAR *);
|
||||
HRESULT (*CreateSurface)(void *, LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *);
|
||||
HRESULT (*DuplicateSurface)(void *);
|
||||
HRESULT (*EnumDisplayModes)(void *);
|
||||
HRESULT (*EnumSurfaces)(void *);
|
||||
HRESULT (*FlipToGDISurface)(void *);
|
||||
HRESULT (*GetCaps)(void *, LPDDCAPS, LPDDCAPS);
|
||||
HRESULT (*GetDisplayMode)(void *);
|
||||
HRESULT (*GetFourCCCodes)(void *);
|
||||
HRESULT (*GetGDISurface)(void *);
|
||||
HRESULT (*GetMonitorFrequency)(void *);
|
||||
HRESULT (*SetScanLine)(void *);
|
||||
HRESULT (*GetVerticalBlankStatus)(void *);
|
||||
HRESULT (*Initialize)(void *);
|
||||
HRESULT (*RestoreDisplayMode)(void *);
|
||||
HRESULT (*SetCooperativeLevel)(void *, HWND, DWORD);
|
||||
HRESULT (*SetDisplayMode)(void *, DWORD, DWORD, DWORD, DWORD, DWORD);
|
||||
HRESULT (*WaitForVerticalBlank)(void *);
|
||||
} fakeDirectDraw;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fakeDirectDraw *Functions;
|
||||
|
||||
ULONG Ref;
|
||||
|
||||
} fakeDirectDrawObject;
|
||||
|
||||
HRESULT ddraw_GetCaps(void *This, LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps)
|
||||
{
|
||||
printf("DirectDraw::GetCaps(This=%p, lpDDDriverCaps=%p, lpDDEmulCaps=%p)\n", This, lpDDDriverCaps, lpDDEmulCaps);
|
||||
|
@ -93,10 +56,16 @@ HRESULT ddraw_SetCooperativeLevel(void *This, HWND hWnd, DWORD dwFlags)
|
|||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT ddraw_SetDisplayMode(void *This, DWORD width, DWORD height, DWORD bpp, DWORD refreshRate, DWORD flags)
|
||||
HRESULT ddraw_SetDisplayMode(void *_This, DWORD width, DWORD height, DWORD bpp)
|
||||
{
|
||||
printf("DirectDraw::SetDisplayMode(This=%p, width=%d, height=%d, bpp=%d, refreshRate=%d, flags=0x%08X)\n",
|
||||
This, (unsigned int)width, (unsigned int)height, (unsigned int)bpp, (unsigned int)refreshRate, (unsigned int)flags);
|
||||
fakeDirectDrawObject *This = (fakeDirectDrawObject *)_This;
|
||||
|
||||
printf("DirectDraw::SetDisplayMode(This=%p, width=%d, height=%d, bpp=%d)\n", This, (unsigned int)width, (unsigned int)height, (unsigned int)bpp);
|
||||
|
||||
This->width = width;
|
||||
This->height = height;
|
||||
This->bpp = bpp;
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue