Index: ddraw/glDirect3DViewport.cpp |
— | — | @@ -75,7 +75,8 @@ |
76 | 76 | newvp->background = 0;
|
77 | 77 | ZeroMemory(&newvp->viewport,sizeof(D3DVIEWPORT2));
|
78 | 78 | newvp->viewport.dwSize = sizeof(D3DVIEWPORT2);
|
79 | | - newvp->maxX = newvp->maxY = newvp->scaleX = newvp->scaleY = 0;
|
| 79 | + ZeroMemory(&newvp->viewport, sizeof(D3DVIEWPORT));
|
| 80 | + newvp->viewport.dwSize = sizeof(D3DVIEWPORT);
|
80 | 81 | newvp->device = NULL;
|
81 | 82 | newvp->backZ = NULL;
|
82 | 83 | for(int i = 0; i < 8; i++)
|
— | — | @@ -251,11 +252,7 @@ |
252 | 253 | TRACE_ENTER(2,14,This,14,lpData);
|
253 | 254 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
254 | 255 | if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
255 | | - memcpy(lpData,&This->viewport,sizeof(D3DVIEWPORT2));
|
256 | | - lpData->dvScaleX = This->scaleX;
|
257 | | - lpData->dvScaleY = This->scaleY;
|
258 | | - lpData->dvMaxX = This->maxX;
|
259 | | - lpData->dvMaxY = This->maxY;
|
| 256 | + memcpy(lpData,&This->viewport1,sizeof(D3DVIEWPORT2));
|
260 | 257 | TRACE_EXIT(23,D3D_OK);
|
261 | 258 | return D3D_OK;
|
262 | 259 | }
|
— | — | @@ -342,10 +339,10 @@ |
343 | 340 | vp.dvClipY = This->viewport.dvClipY;
|
344 | 341 | if((vp.dvMinZ == 0) && (vp.dvMaxZ == 0)) vp.dvMaxZ = 1.0f;
|
345 | 342 | This->viewport = vp;
|
346 | | - This->maxX = lpData->dvMaxX;
|
347 | | - This->maxY = lpData->dvMaxY;
|
348 | | - This->scaleX = lpData->dvScaleX;
|
349 | | - This->scaleY = lpData->dvScaleY;
|
| 343 | + This->viewport1 = *lpData;
|
| 344 | + if ((This->viewport1.dvMinZ == 0) && (This->viewport1.dvMaxZ == 0))
|
| 345 | + This->viewport1.dvMaxZ = 1.0f;
|
| 346 | + This->viewportver = 1;
|
350 | 347 | if(This->current && This->device) glDirect3DViewport3_Sync(This);
|
351 | 348 | TRACE_EXIT(23,D3D_OK);
|
352 | 349 | return D3D_OK;
|
— | — | @@ -356,8 +353,18 @@ |
357 | 354 | if(!This) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
358 | 355 | if(!This->device) TRACE_RET(HRESULT,23,D3DERR_VIEWPORTHASNODEVICE);
|
359 | 356 | if(!lpData) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 357 | + D3DVIEWPORT vp;
|
| 358 | + memcpy(&vp, lpData, sizeof(D3DVIEWPORT2));
|
| 359 | + vp.dvMaxX = This->viewport1.dvMaxX;
|
| 360 | + vp.dvMaxY = This->viewport1.dvMaxY;
|
| 361 | + vp.dvScaleX = This->viewport1.dvScaleX;
|
| 362 | + vp.dvScaleY = This->viewport1.dvScaleY;
|
| 363 | + if ((vp.dvMinZ == 0) && (vp.dvMaxZ == 0)) vp.dvMaxZ = 1.0f;
|
360 | 364 | This->viewport = *lpData;
|
361 | | - if(This->current && This->device) glDirect3DViewport3_Sync(This);
|
| 365 | + This->viewport1 = vp;
|
| 366 | + if ((This->viewport.dvMinZ == 0) && (This->viewport.dvMaxZ == 0))
|
| 367 | + This->viewport.dvMaxZ = 1.0f;
|
| 368 | + if (This->current && This->device) glDirect3DViewport3_Sync(This);
|
362 | 369 | TRACE_EXIT(23,D3D_OK);
|
363 | 370 | return D3D_OK;
|
364 | 371 | }
|
— | — | @@ -403,7 +410,7 @@ |
404 | 411 | vp7.dvMinZ = This->viewport.dvMinZ;
|
405 | 412 | vp7.dvMaxZ = This->viewport.dvMaxZ;
|
406 | 413 | This->device->SetViewport(&vp7);
|
407 | | - This->device->SetScale(This->scaleX,This->scaleY);
|
| 414 | + This->device->SetScale(This->viewport1.dvScaleX,This->viewport1.dvScaleY);
|
408 | 415 | TRACE_EXIT(0,0);
|
409 | 416 | }
|
410 | 417 |
|
Index: ddraw/glDirect3DViewport.h |
— | — | @@ -40,11 +40,9 @@ |
41 | 41 | glDirect3DDevice7 *device;
|
42 | 42 | glDirectDrawSurface7 *backZ;
|
43 | 43 | D3DMATERIALHANDLE background;
|
| 44 | + D3DVIEWPORT viewport1;
|
44 | 45 | D3DVIEWPORT2 viewport;
|
45 | | - D3DVALUE maxX;
|
46 | | - D3DVALUE maxY;
|
47 | | - D3DVALUE scaleX;
|
48 | | - D3DVALUE scaleY;
|
| 46 | + int viewportver;
|
49 | 47 | bool current;
|
50 | 48 | };
|
51 | 49 |
|