1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

add AoE2 workaround

This commit is contained in:
FunkyFr3sh 2018-10-29 07:01:32 +01:00
parent bde5fcd70b
commit 8f394009b1

View File

@ -433,6 +433,8 @@ HRESULT __stdcall ddraw_surface_GetDC(IDirectDrawSurfaceImpl *This, HDC FAR *a)
{
#if _DEBUG_X
printf("IDirectDrawSurface::GetDC(This=%p, ...)\n", This);
if (This->width % 4)
printf(" width=%d height=%d ???\n", This->width, This->height);
#endif
RGBQUAD *data =
@ -692,6 +694,8 @@ HRESULT __stdcall ddraw_CreateSurface(IDirectDrawImpl *This, LPDDSURFACEDESC lpD
if(Surface->width && Surface->height)
{
if (Surface->width == 622 && Surface->height == 51) Surface->width = 624; //AoE2
Surface->bmi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
Surface->bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Surface->bmi->bmiHeader.biWidth = Surface->width;