Index: common/releasever.h |
— | — | @@ -4,8 +4,8 @@ |
5 | 5 |
|
6 | 6 | #define DXGLMAJORVER 0
|
7 | 7 | #define DXGLMINORVER 5
|
8 | | -#define DXGLPOINTVER 15
|
9 | | -#define DXGLBETA 0
|
| 8 | +#define DXGLPOINTVER 16
|
| 9 | +#define DXGLBETA 1
|
10 | 10 |
|
11 | 11 | #define STR2(x) #x
|
12 | 12 | #define STR(x) STR2(x)
|
Index: ddraw/glDirectDrawPalette.c |
— | — | @@ -142,8 +142,16 @@ |
143 | 143 | TRACE_EXIT(23,DD_OK);
|
144 | 144 | return DD_OK;
|
145 | 145 | }
|
| 146 | + if (!memcmp(riid, &IID_IDirectDrawPalette, sizeof(GUID)))
|
| 147 | + {
|
| 148 | + glDirectDrawPalette_AddRef(This);
|
| 149 | + *ppvObj = This;
|
| 150 | + TRACE_VAR("*ppvObj", 14, *ppvObj);
|
| 151 | + TRACE_EXIT(23, DD_OK);
|
| 152 | + return DD_OK;
|
| 153 | + }
|
146 | 154 | TRACE_EXIT(23,E_NOINTERFACE);
|
147 | | - ERR(E_NOINTERFACE);
|
| 155 | + return E_NOINTERFACE;
|
148 | 156 | }
|
149 | 157 |
|
150 | 158 | ULONG WINAPI glDirectDrawPalette_AddRef(glDirectDrawPalette *This)
|
— | — | @@ -187,7 +195,9 @@ |
188 | 196 | DWORD allentries = 256;
|
189 | 197 | DWORD entrysize;
|
190 | 198 | TRACE_ENTER(5, 14, This, 9, dwFlags, 8, dwBase, 8, dwNumEntries, 14, lpEntries);
|
| 199 | + if (dwFlags) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
191 | 200 | if (!IsReadablePointer(This, sizeof(glDirectDrawPalette))) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 201 | + if (!IsWritablePointer(lpEntries, dwNumEntries * 4, FALSE)) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
192 | 202 | if(This->flags & DDPCAPS_1BIT) allentries=2;
|
193 | 203 | if(This->flags & DDPCAPS_2BIT) allentries=4;
|
194 | 204 | if(This->flags & DDPCAPS_4BIT) allentries=16;
|
— | — | @@ -212,7 +222,9 @@ |
213 | 223 | DWORD entrysize;
|
214 | 224 | DDSURFACEDESC2 ddsd;
|
215 | 225 | TRACE_ENTER(5, 14, This, 9, dwFlags, 8, dwStartingEntry, 8, dwCount, 14, lpEntries);
|
| 226 | + if (dwFlags) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
216 | 227 | if (!IsReadablePointer(This, sizeof(glDirectDrawPalette))) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 228 | + if (!IsReadablePointer(lpEntries, dwCount * 4)) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
217 | 229 | if(This->flags & DDPCAPS_1BIT) allentries=2;
|
218 | 230 | if(This->flags & DDPCAPS_2BIT) allentries=4;
|
219 | 231 | if(This->flags & DDPCAPS_4BIT) allentries=16;
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -3412,25 +3412,33 @@ |
3413 | 3413 | {
|
3414 | 3414 | ddsdSrc = cmd->src->levels[cmd->srclevel].ddsd;
|
3415 | 3415 | if (cmd->src->levels[cmd->srclevel].dirty & 1) glTexture__Upload(cmd->src, cmd->srclevel);
|
| 3416 | + if (!memcmp(&cmd->srcrect, &nullrect, sizeof(RECT)))
|
| 3417 | + {
|
| 3418 | + srcrect.left = 0;
|
| 3419 | + srcrect.top = 0;
|
| 3420 | + srcrect.right = ddsdSrc.dwWidth;
|
| 3421 | + srcrect.bottom = ddsdSrc.dwHeight;
|
| 3422 | + }
|
3416 | 3423 | }
|
3417 | 3424 | if (cmd->dest->levels[cmd->destlevel].dirty & 1)
|
3418 | 3425 | glTexture__Upload(cmd->dest, cmd->destlevel);
|
3419 | | - if (!memcmp(&cmd->srcrect, &nullrect, sizeof(RECT)))
|
3420 | | - {
|
3421 | | - srcrect.left = 0;
|
3422 | | - srcrect.top = 0;
|
3423 | | - srcrect.right = ddsdSrc.dwWidth;
|
3424 | | - srcrect.bottom = ddsdSrc.dwHeight;
|
3425 | | - }
|
3426 | 3426 | else srcrect = cmd->srcrect;
|
3427 | 3427 | This->bltvertices[1].x = This->bltvertices[3].x = (GLfloat)destrect.left;
|
3428 | 3428 | This->bltvertices[0].x = This->bltvertices[2].x = (GLfloat)destrect.right;
|
3429 | 3429 | This->bltvertices[0].y = This->bltvertices[1].y = (GLfloat)ddsd.dwHeight - (GLfloat)destrect.top;
|
3430 | 3430 | This->bltvertices[2].y = This->bltvertices[3].y = (GLfloat)ddsd.dwHeight - (GLfloat)destrect.bottom;
|
3431 | | - This->bltvertices[1].s = This->bltvertices[3].s = (GLfloat)srcrect.left / (GLfloat)ddsdSrc.dwWidth;
|
3432 | | - This->bltvertices[0].s = This->bltvertices[2].s = (GLfloat)srcrect.right / (GLfloat)ddsdSrc.dwWidth;
|
3433 | | - This->bltvertices[0].t = This->bltvertices[1].t = (GLfloat)srcrect.top / (GLfloat)ddsdSrc.dwHeight;
|
3434 | | - This->bltvertices[2].t = This->bltvertices[3].t = (GLfloat)srcrect.bottom / (GLfloat)ddsdSrc.dwHeight;
|
| 3431 | + if (cmd->src)
|
| 3432 | + {
|
| 3433 | + This->bltvertices[1].s = This->bltvertices[3].s = (GLfloat)srcrect.left / (GLfloat)ddsdSrc.dwWidth;
|
| 3434 | + This->bltvertices[0].s = This->bltvertices[2].s = (GLfloat)srcrect.right / (GLfloat)ddsdSrc.dwWidth;
|
| 3435 | + This->bltvertices[0].t = This->bltvertices[1].t = (GLfloat)srcrect.top / (GLfloat)ddsdSrc.dwHeight;
|
| 3436 | + This->bltvertices[2].t = This->bltvertices[3].t = (GLfloat)srcrect.bottom / (GLfloat)ddsdSrc.dwHeight;
|
| 3437 | + }
|
| 3438 | + else
|
| 3439 | + {
|
| 3440 | + This->bltvertices[1].s = This->bltvertices[3].s = This->bltvertices[0].t = This->bltvertices[1].t = 0.0f;
|
| 3441 | + This->bltvertices[0].s = This->bltvertices[2].s = This->bltvertices[2].t = This->bltvertices[3].t = 1.0f;
|
| 3442 | + }
|
3435 | 3443 | if ((cmd->bltfx.dwSize == sizeof(DDBLTFX)) && (cmd->flags & DDBLT_DDFX))
|
3436 | 3444 | {
|
3437 | 3445 | if (cmd->bltfx.dwDDFX & DDBLTFX_MIRRORLEFTRIGHT)
|