Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -1320,21 +1320,29 @@ |
1321 | 1321 | {
|
1322 | 1322 | ddsd.dwFlags |= DDSD_CKSRCBLT;
|
1323 | 1323 | colorkey[0] = key;
|
| 1324 | + ddsd.ddckCKSrcBlt = *lpDDColorKey;
|
| 1325 | + if (!key.colorspace) ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
1324 | 1326 | }
|
1325 | 1327 | if(dwFlags & DDCKEY_DESTBLT)
|
1326 | 1328 | {
|
1327 | 1329 | ddsd.dwFlags |= DDSD_CKDESTBLT;
|
1328 | 1330 | colorkey[1] = key;
|
| 1331 | + ddsd.ddckCKDestBlt = *lpDDColorKey;
|
| 1332 | + if (!key.colorspace) ddsd.ddckCKDestBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
1329 | 1333 | }
|
1330 | 1334 | if(dwFlags & DDCKEY_SRCOVERLAY)
|
1331 | 1335 | {
|
1332 | 1336 | ddsd.dwFlags |= DDSD_CKSRCOVERLAY;
|
1333 | 1337 | colorkey[2] = key;
|
| 1338 | + ddsd.ddckCKSrcOverlay = *lpDDColorKey;
|
| 1339 | + if (!key.colorspace) ddsd.ddckCKSrcOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
1334 | 1340 | }
|
1335 | 1341 | if(dwFlags & DDCKEY_DESTOVERLAY)
|
1336 | 1342 | {
|
1337 | 1343 | ddsd.dwFlags |= DDSD_CKDESTOVERLAY;
|
1338 | 1344 | colorkey[3] = key;
|
| 1345 | + ddsd.ddckCKDestOverlay = *lpDDColorKey;
|
| 1346 | + if (!key.colorspace) ddsd.ddckCKDestOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
1339 | 1347 | }
|
1340 | 1348 | glRenderer_SetTextureColorKey(this->ddInterface->renderer, this->texture, dwFlags, lpDDColorKey, this->miplevel);
|
1341 | 1349 | TRACE_EXIT(23,DD_OK);
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -2928,29 +2928,29 @@ |
2929 | 2929 | {
|
2930 | 2930 | texture->levels[level].ddsd.dwFlags |= DDSD_CKSRCBLT;
|
2931 | 2931 | texture->levels[level].ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = lpDDColorKey->dwColorSpaceLowValue;
|
2932 | | - if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2933 | | - else texture->levels[level].ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2932 | + if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2933 | + else texture->levels[level].ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2934 | 2934 | }
|
2935 | 2935 | if (dwFlags & DDCKEY_DESTBLT)
|
2936 | 2936 | {
|
2937 | 2937 | texture->levels[level].ddsd.dwFlags |= DDSD_CKDESTBLT;
|
2938 | 2938 | texture->levels[level].ddsd.ddckCKDestBlt.dwColorSpaceLowValue = lpDDColorKey->dwColorSpaceLowValue;
|
2939 | | - if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKDestBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2940 | | - else texture->levels[level].ddsd.ddckCKDestBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2939 | + if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKDestBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2940 | + else texture->levels[level].ddsd.ddckCKDestBlt.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2941 | 2941 | }
|
2942 | 2942 | if (dwFlags & DDCKEY_SRCOVERLAY)
|
2943 | 2943 | {
|
2944 | 2944 | texture->levels[level].ddsd.dwFlags |= DDSD_CKSRCOVERLAY;
|
2945 | 2945 | texture->levels[level].ddsd.ddckCKSrcOverlay.dwColorSpaceLowValue = lpDDColorKey->dwColorSpaceLowValue;
|
2946 | | - if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKSrcOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2947 | | - else texture->levels[level].ddsd.ddckCKSrcOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2946 | + if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKSrcOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2947 | + else texture->levels[level].ddsd.ddckCKSrcOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2948 | 2948 | }
|
2949 | 2949 | if (dwFlags & DDCKEY_DESTOVERLAY)
|
2950 | 2950 | {
|
2951 | 2951 | texture->levels[level].ddsd.dwFlags |= DDSD_CKDESTOVERLAY;
|
2952 | 2952 | texture->levels[level].ddsd.ddckCKDestOverlay.dwColorSpaceLowValue = lpDDColorKey->dwColorSpaceLowValue;
|
2953 | | - if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKDestOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2954 | | - else texture->levels[level].ddsd.ddckCKDestOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2953 | + if (DDCKEY_COLORSPACE) texture->levels[level].ddsd.ddckCKDestOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceHighValue;
|
| 2954 | + else texture->levels[level].ddsd.ddckCKDestOverlay.dwColorSpaceHighValue = lpDDColorKey->dwColorSpaceLowValue;
|
2955 | 2955 | }
|
2956 | 2956 | SetEvent(This->busy);
|
2957 | 2957 | }
|
Index: ddraw/glTexture.cpp |
— | — | @@ -371,13 +371,13 @@ |
372 | 372 | {
|
373 | 373 | if (This->palette) glTexture_Release(This->palette, backend);
|
374 | 374 | This->palette = palette;
|
375 | | - glTexture_AddRef(palette);
|
| 375 | + if (palette) glTexture_AddRef(palette);
|
376 | 376 | }
|
377 | 377 | void glTexture_SetStencil(glTexture *This, glTexture *stencil, BOOL backend)
|
378 | 378 | {
|
379 | 379 | if (This->stencil) glTexture_Release(This->stencil, backend);
|
380 | 380 | This->stencil = stencil;
|
381 | | - glTexture_AddRef(stencil);
|
| 381 | + if (stencil) glTexture_AddRef(stencil);
|
382 | 382 | }
|
383 | 383 | void glTexture_CreateDummyColor(glTexture *This, BOOL backend)
|
384 | 384 | {
|