Index: ddraw/glTexture.cpp |
— | — | @@ -88,8 +88,9 @@ |
89 | 89 | {sizeof(DDPIXELFORMAT), DDPF_ALPHA, 0, 8, 0, 0, 0, 0}, // 8-bit alpha
|
90 | 90 | {sizeof(DDPIXELFORMAT), DDPF_LUMINANCE|DDPF_ALPHAPIXELS,0, 16, 0xFF, 0, 0, 0xFF00}, // 8-bit luminance alpha
|
91 | 91 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 16, 0, 0xFFFF, 0, 0}, // 16 bit Z buffer
|
92 | | - {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 24, 0, 0xFFFFFF00, 0, 0}, // 24 bit Z buffer
|
93 | | - {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFF00, 0, 0}, // 24 bit Z buffer, 32-bit space
|
| 92 | + {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 24, 0, 0xFFFFFF, 0, 0}, // 24 bit Z buffer
|
| 93 | + {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFF, 0, 0}, // 24 bit Z buffer, 32-bit space
|
| 94 | + {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFF00, 0, 0}, // 24 bit Z buffer, 32-bit space, reversed
|
94 | 95 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFFFF, 0, 0}, // 32 bit Z buffer
|
95 | 96 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 8, 0xFFFFFF00, 0xFF, 0}, // 32 bit Z buffer with stencil
|
96 | 97 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 8, 0xFF, 0xFFFFFF00, 0} // 32 bit Z buffer with stencil, reversed
|
— | — | @@ -1191,7 +1192,22 @@ |
1192 | 1193 | This->colorbits[2] = 0;
|
1193 | 1194 | This->colorbits[3] = 0;
|
1194 | 1195 | break;
|
1195 | | - case 21: // 32-bit Z buffer
|
| 1196 | + case 21: // 32/24 bit Z buffer reversed
|
| 1197 | + This->internalformats[0] = GL_DEPTH_COMPONENT24;
|
| 1198 | + This->format = GL_DEPTH_COMPONENT;
|
| 1199 | + This->type = GL_UNSIGNED_INT;
|
| 1200 | + if (!This->target) This->target = GL_TEXTURE_2D;
|
| 1201 | + This->colororder = 4;
|
| 1202 | + This->colorsizes[0] = 16777215;
|
| 1203 | + This->colorsizes[1] = 16777215;
|
| 1204 | + This->colorsizes[2] = 16777215;
|
| 1205 | + This->colorsizes[3] = 16777215;
|
| 1206 | + This->colorbits[0] = 24;
|
| 1207 | + This->colorbits[1] = 0;
|
| 1208 | + This->colorbits[2] = 0;
|
| 1209 | + This->colorbits[3] = 0;
|
| 1210 | + break;
|
| 1211 | + case 22: // 32-bit Z buffer
|
1196 | 1212 | This->internalformats[0] = GL_DEPTH_COMPONENT32;
|
1197 | 1213 | This->format = GL_DEPTH_COMPONENT;
|
1198 | 1214 | This->type = GL_UNSIGNED_INT;
|
— | — | @@ -1206,8 +1222,7 @@ |
1207 | 1223 | This->colorbits[2] = 0;
|
1208 | 1224 | This->colorbits[3] = 0;
|
1209 | 1225 | break;
|
1210 | | - case 22: // 32-bit Z/Stencil buffer, depth LSB
|
1211 | | - This->blttype = 0x18;
|
| 1226 | + case 23: // 32-bit Z/Stencil buffer, depth LSB
|
1212 | 1227 | This->internalformats[0] = GL_DEPTH24_STENCIL8;
|
1213 | 1228 | This->format = GL_DEPTH_STENCIL;
|
1214 | 1229 | This->type = GL_UNSIGNED_INT_24_8;
|
— | — | @@ -1222,7 +1237,7 @@ |
1223 | 1238 | This->colorbits[2] = 0;
|
1224 | 1239 | This->colorbits[3] = 8;
|
1225 | 1240 | break;
|
1226 | | - case 23: // 32-bit Z/Stencil buffer, depth MSB
|
| 1241 | + case 24: // 32-bit Z/Stencil buffer, depth MSB
|
1227 | 1242 | This->blttype = 0x18;
|
1228 | 1243 | This->internalformats[0] = GL_DEPTH24_STENCIL8;
|
1229 | 1244 | This->format = GL_DEPTH_STENCIL;
|
Index: dxglcfg/surfacegen.cpp |
— | — | @@ -323,6 +323,16 @@ |
324 | 324 | }
|
325 | 325 | }
|
326 | 326 | }
|
| 327 | + else if ((ddsd.ddpfPixelFormat.dwFlags & DDPF_ZBUFFER) && (ddsd.ddpfPixelFormat.dwZBitMask == 0xFFFFFF00))
|
| 328 | + {
|
| 329 | + for (y = 0; y < ddsd.dwHeight; y++)
|
| 330 | + {
|
| 331 | + for (x = 0; x < ddsd.dwWidth; x++)
|
| 332 | + {
|
| 333 | + buffer32[x + ((ddsd.lPitch / 4) * y)] = (unsigned long)((x / (ddsd.dwWidth / 4096.)) + 4096 * floor((y / (ddsd.dwHeight / 4096.)))) << 8;
|
| 334 | + }
|
| 335 | + }
|
| 336 | + }
|
327 | 337 | else
|
328 | 338 | {
|
329 | 339 | for (y = 0; y < ddsd.dwHeight; y++)
|
— | — | @@ -1740,6 +1750,7 @@ |
1741 | 1751 | _T("16-bit Zbuffer"),
|
1742 | 1752 | _T("24-bit Zbuffer"),
|
1743 | 1753 | _T("24-bit Z, 32bit"),
|
| 1754 | + _T("24-bit Z,32b.rev"),
|
1744 | 1755 | _T("32-bit Zbuffer"),
|
1745 | 1756 | _T("32-bit Z/stencil"),
|
1746 | 1757 | _T("32-bit Z/st.rev")
|
— | — | @@ -1769,8 +1780,9 @@ |
1770 | 1781 | {sizeof(DDPIXELFORMAT), DDPF_ALPHA, 0, 8, 0, 0, 0, 0}, // 8-bit alpha
|
1771 | 1782 | {sizeof(DDPIXELFORMAT), DDPF_LUMINANCE|DDPF_ALPHAPIXELS,0, 16, 0xFF, 0, 0, 0xFF00}, // 8-bit luminance alpha
|
1772 | 1783 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 16, 0, 0xFFFF, 0, 0}, // 16 bit Z buffer
|
1773 | | - {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 24, 0, 0xFFFFFF00, 0, 0}, // 24 bit Z buffer
|
1774 | | - {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFF00, 0, 0}, // 24 bit Z buffer, 32-bit space
|
| 1784 | + {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 24, 0, 0xFFFFFF, 0, 0}, // 24 bit Z buffer
|
| 1785 | + {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFF, 0, 0}, // 24 bit Z buffer, 32-bit space
|
| 1786 | + {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFF00, 0, 0}, // 24 bit Z buffer, 32-bit space, reversed
|
1775 | 1787 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 0, 0xFFFFFFFF, 0, 0}, // 32 bit Z buffer
|
1776 | 1788 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 8, 0xFFFFFF00, 0xFF, 0}, // 32 bit Z buffer with stencil
|
1777 | 1789 | {sizeof(DDPIXELFORMAT), DDPF_ZBUFFER, 0, 32, 8, 0xFF, 0xFFFFFF00, 0} // 32 bit Z buffer with stencil, reversed
|