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

add missing lock

This commit is contained in:
FunkyFr3sh 2017-11-15 06:33:31 +01:00
parent 2dd84d86f6
commit 9821d80044
3 changed files with 16 additions and 12 deletions

BIN
ddraw.dll

Binary file not shown.

7
main.c
View File

@ -374,8 +374,6 @@ void ToggleFullscreen()
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT rc = { 0, 0, ddraw->render.width, ddraw->render.height };
switch(uMsg)
{
case WM_MOVE:
@ -521,11 +519,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
case WM_ERASEBKGND:
EnterCriticalSection(&ddraw->cs);
FillRect(ddraw->render.hDC, &rc, (HBRUSH) GetStockObject(BLACK_BRUSH));
LeaveCriticalSection(&ddraw->cs);
break;
}
return ddraw->WndProc(hWnd, uMsg, wParam, lParam);

View File

@ -120,11 +120,22 @@ HRESULT __stdcall ddraw_surface_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestR
unsigned char* from=Source->surface + y0*Source->width + x0;
int s = x1-x0;
int y;
for(y=y0; y<y1; ++y, to+=This->width, from+=Source->width)
{
memcpy(to, from, s);
}
if((This->caps & DDSCAPS_PRIMARYSURFACE) && !(This->flags & DDSD_BACKBUFFERCOUNT))
{
EnterCriticalSection(&ddraw->cs);
int y;
for(y=y0; y<y1; ++y, to+=This->width, from+=Source->width)
memcpy(to, from, s);
LeaveCriticalSection(&ddraw->cs);
}
else
{
int y;
for(y=y0; y<y1; ++y, to+=This->width, from+=Source->width)
memcpy(to, from, s);
}
}
return DD_OK;