Index: ddraw/glDirectDrawClipper.cpp |
— | — | @@ -55,6 +55,7 @@ |
56 | 56 | glDirectDrawClipper *newclipper;
|
57 | 57 | TRACE_ENTER(3, 9, dwFlags, 14, parent, 14, lplpDDClipper);
|
58 | 58 | if (!lplpDDClipper) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 59 | + if (dwFlags) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
59 | 60 | newclipper = (glDirectDrawClipper*)malloc(sizeof(glDirectDrawClipper));
|
60 | 61 | if (!newclipper) TRACE_RET(HRESULT, 23, DDERR_OUTOFMEMORY);
|
61 | 62 | ZeroMemory(newclipper, sizeof(glDirectDrawClipper));
|
— | — | @@ -325,6 +326,7 @@ |
326 | 327 | {
|
327 | 328 | TRACE_ENTER(2,14,This,14,lphWnd);
|
328 | 329 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 330 | + if (!lphWnd) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
329 | 331 | if(!This->hWnd) TRACE_RET(HRESULT,23,DDERR_NOHWND);
|
330 | 332 | *lphWnd = This->hWnd;
|
331 | 333 | TRACE_VAR("*lphWnd",13,*lphWnd);
|
— | — | @@ -335,6 +337,7 @@ |
336 | 338 | {
|
337 | 339 | TRACE_ENTER(3,14,This,14,lpDD,9,dwFlags);
|
338 | 340 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 341 | + if (dwFlags) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
339 | 342 | if(This->initialized) TRACE_RET(HRESULT,23,DDERR_ALREADYINITIALIZED);
|
340 | 343 | This->glDD7 = (glDirectDraw7*)lpDD;
|
341 | 344 | if(This->glDD7) This->hasparent = true;
|
— | — | @@ -348,21 +351,33 @@ |
349 | 352 | This->refcount = 1;
|
350 | 353 | This->initialized = true;
|
351 | 354 | This->dirty = true;
|
| 355 | + This->cliplistchanged = TRUE;
|
352 | 356 | TRACE_EXIT(23,DD_OK);
|
353 | 357 | return DD_OK;
|
354 | 358 | }
|
355 | 359 | HRESULT WINAPI glDirectDrawClipper_IsClipListChanged(glDirectDrawClipper *This, BOOL FAR *lpbChanged)
|
356 | 360 | {
|
| 361 | + WINDOWPLACEMENT newpos;
|
357 | 362 | TRACE_ENTER(2,14,This,14,lpbChanged);
|
358 | 363 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
359 | | - FIXME("IDirectDrawClipper::IsClipListChanged: stub");
|
360 | | - TRACE_EXIT(23,DDERR_GENERIC);
|
361 | | - ERR(DDERR_GENERIC);
|
| 364 | + if (!lpbChanged) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
| 365 | + newpos.length = sizeof(WINDOWPLACEMENT);
|
| 366 | + if (This->hWnd) GetWindowPlacement(This->hWnd, &newpos);
|
| 367 | + if (memcmp(&This->lastpos, &newpos, sizeof(WINDOWPLACEMENT)))
|
| 368 | + {
|
| 369 | + This->cliplistchanged = TRUE;
|
| 370 | + memcpy(&This->lastpos, &newpos, sizeof(WINDOWPLACEMENT));
|
| 371 | + }
|
| 372 | + *lpbChanged = This->cliplistchanged;
|
| 373 | + This->cliplistchanged = FALSE;
|
| 374 | + TRACE_EXIT(23, DD_OK);
|
| 375 | + return DD_OK;
|
362 | 376 | }
|
363 | 377 | HRESULT WINAPI glDirectDrawClipper_SetClipList(glDirectDrawClipper *This, LPRGNDATA lpClipList, DWORD dwFlags)
|
364 | 378 | {
|
365 | 379 | TRACE_ENTER(3,14,This,14,lpClipList,9,dwFlags);
|
366 | 380 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 381 | + if (dwFlags) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
367 | 382 | if(This->hWnd) TRACE_RET(HRESULT,23,DDERR_CLIPPERISUSINGHWND);
|
368 | 383 | bool memfail;
|
369 | 384 | if(lpClipList)
|
— | — | @@ -437,6 +452,7 @@ |
438 | 453 | }
|
439 | 454 | else This->clipsize = 0;
|
440 | 455 | This->dirty = true;
|
| 456 | + This->cliplistchanged = TRUE;
|
441 | 457 | TRACE_EXIT(23,DD_OK);
|
442 | 458 | return DD_OK;
|
443 | 459 | }
|
— | — | @@ -444,7 +460,11 @@ |
445 | 461 | {
|
446 | 462 | TRACE_ENTER(3,14,This,9,dwFlags,13,hWnd);
|
447 | 463 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 464 | + if (dwFlags) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
448 | 465 | This->hWnd = hWnd;
|
| 466 | + This->lastpos.length = sizeof(WINDOWPLACEMENT);
|
| 467 | + GetWindowPlacement(hWnd, &This->lastpos);
|
| 468 | + This->cliplistchanged = TRUE;
|
449 | 469 | TRACE_EXIT(23,DD_OK);
|
450 | 470 | return DD_OK;
|
451 | 471 | }
|
Index: ddraw/glDirectDrawClipper.h |
— | — | @@ -38,6 +38,8 @@ |
39 | 39 | int maxsize;
|
40 | 40 | bool hascliplist;
|
41 | 41 | bool dirty;
|
| 42 | + BOOL cliplistchanged;
|
| 43 | + WINDOWPLACEMENT lastpos;
|
42 | 44 | } glDirectDrawClipper;
|
43 | 45 |
|
44 | 46 | typedef struct glDirectDrawClipperVtbl
|