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:
parent
2dd84d86f6
commit
9821d80044
7
main.c
7
main.c
@ -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);
|
||||
|
21
surface.c
21
surface.c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user