From 4c2272a54e63dd4b4cefe02c272a845d9b9ad560 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Tue, 3 Jul 2018 21:05:58 +0200 Subject: [PATCH] add support for DDBLT_COLORFILL --- src/surface.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/surface.c b/src/surface.c index 2600fbb..a917536 100644 --- a/src/surface.c +++ b/src/surface.c @@ -102,6 +102,22 @@ HRESULT __stdcall ddraw_surface_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestR } #endif + if (dwFlags & DDBLT_COLORFILL) + { + int dst_w = lpDestRect->right - lpDestRect->left; + int dst_h = lpDestRect->bottom - lpDestRect->top; + + for (int y = 0; y < dst_h; y++) + { + int ydst = This->width * (y + lpDestRect->top); + + for (int x = 0; x < dst_w; x++) + { + ((unsigned char *)This->surface)[x + lpDestRect->left + ydst] = lpDDBltFx->dwFillColor; + } + } + } + if(Source) { //BitBlt(This->hDC, lpDestRect->left, lpDestRect->top, lpDestRect->right, lpDestRect->bottom,