| Index: ReadMe.md |
| — | — | @@ -1,4 +1,4 @@ |
| 2 | | -# DXGL 0.5.11
|
| | 2 | +# DXGL 0.5.13
|
| 3 | 3 | https://www.dxgl.info
|
| 4 | 4 |
|
| 5 | 5 | ## Introduction
|
| Index: ddraw/glRenderer.cpp |
| — | — | @@ -3549,10 +3549,69 @@ |
| 3550 | 3550 | glUtil_SetFBO(This->util, NULL);
|
| 3551 | 3551 | }
|
| 3552 | 3552 |
|
| | 3553 | +BOOL Is512448Scale(glRenderer *This, glTexture *primary, glTexture *palette)
|
| | 3554 | +{
|
| | 3555 | + DWORD *ptr32;
|
| | 3556 | + WORD *ptr16;
|
| | 3557 | + BYTE *ptr8;
|
| | 3558 | + if (dxglcfg.HackAutoScale512448to640480)
|
| | 3559 | + {
|
| | 3560 | + if ((primary->levels[0].ddsd.dwWidth == 640) && (primary->levels[0].ddsd.dwHeight == 480))
|
| | 3561 | + {
|
| | 3562 | + if (primary->levels[0].dirty & 2) glTexture__Download(primary, 0);
|
| | 3563 | + if (primary->levels[0].ddsd.ddpfPixelFormat.dwRGBBitCount == 8)
|
| | 3564 | + {
|
| | 3565 | + ptr8 = (BYTE*)primary->levels[0].buffer;
|
| | 3566 | + ptr32 = (DWORD*)palette->levels[0].buffer;
|
| | 3567 | + if (!(ptr32[ptr8[0]] & 0xFFFFFF)) return TRUE;
|
| | 3568 | + else return FALSE;
|
| | 3569 | + }
|
| | 3570 | + else if (primary->levels[0].ddsd.ddpfPixelFormat.dwRGBBitCount == 16)
|
| | 3571 | + {
|
| | 3572 | + ptr16 = (WORD*)primary->levels[0].buffer;
|
| | 3573 | + if (!ptr16[0]) return TRUE;
|
| | 3574 | + else return FALSE;
|
| | 3575 | + }
|
| | 3576 | + else
|
| | 3577 | + {
|
| | 3578 | + ptr32 = (DWORD*)primary->levels[0].buffer;
|
| | 3579 | + if (!(ptr32[0] & 0xFFFFFF)) return TRUE;
|
| | 3580 | + else return FALSE;
|
| | 3581 | + }
|
| | 3582 | + }
|
| | 3583 | + else if ((primary->levels[0].ddsd.dwWidth == 320) && (primary->levels[0].ddsd.dwHeight == 240))
|
| | 3584 | + {
|
| | 3585 | + if (primary->levels[0].dirty & 2) glTexture__Download(primary, 0);
|
| | 3586 | + if (primary->levels[0].ddsd.ddpfPixelFormat.dwRGBBitCount == 8)
|
| | 3587 | + {
|
| | 3588 | + ptr8 = (BYTE*)primary->levels[0].buffer;
|
| | 3589 | + ptr32 = (DWORD*)palette->levels[0].buffer;
|
| | 3590 | + if (!(ptr32[ptr8[0]] & 0xFFFFFF)) return TRUE;
|
| | 3591 | + else return FALSE;
|
| | 3592 | + }
|
| | 3593 | + else if (primary->levels[0].ddsd.ddpfPixelFormat.dwRGBBitCount == 16)
|
| | 3594 | + {
|
| | 3595 | + ptr16 = (WORD*)primary->levels[0].buffer;
|
| | 3596 | + if (!ptr16[0]) return TRUE;
|
| | 3597 | + else return FALSE;
|
| | 3598 | + }
|
| | 3599 | + else
|
| | 3600 | + {
|
| | 3601 | + ptr32 = (DWORD*)primary->levels[0].buffer;
|
| | 3602 | + if (!(ptr32[0] & 0xFFFFFF)) return TRUE;
|
| | 3603 | + else return FALSE;
|
| | 3604 | + }
|
| | 3605 | + }
|
| | 3606 | + else return FALSE;
|
| | 3607 | + }
|
| | 3608 | + else return FALSE;
|
| | 3609 | +}
|
| | 3610 | +
|
| 3553 | 3611 | void glRenderer__DrawScreen(glRenderer *This, glTexture *texture, glTexture *paltex, GLint vsync, glTexture *previous, BOOL setsync)
|
| 3554 | 3612 | {
|
| 3555 | 3613 | int progtype;
|
| 3556 | 3614 | RECT r, r2;
|
| | 3615 | + BOOL scale512448 = Is512448Scale(This, texture, paltex);
|
| 3557 | 3616 | glUtil_BlendEnable(This->util, FALSE);
|
| 3558 | 3617 | if (previous) previous->levels[0].ddsd.ddsCaps.dwCaps &= ~DDSCAPS_FRONTBUFFER;
|
| 3559 | 3618 | texture->levels[0].ddsd.ddsCaps.dwCaps |= DDSCAPS_FRONTBUFFER;
|
| — | — | @@ -3669,8 +3728,18 @@ |
| 3670 | 3729 | This->bltvertices[0].y = This->bltvertices[1].y = This->bltvertices[1].x = This->bltvertices[3].x = 0.;
|
| 3671 | 3730 | This->bltvertices[2].y = This->bltvertices[3].y = (float)texture->bigheight;
|
| 3672 | 3731 | }
|
| 3673 | | - This->bltvertices[0].s = This->bltvertices[0].t = This->bltvertices[1].t = This->bltvertices[2].s = 1.;
|
| 3674 | | - This->bltvertices[1].s = This->bltvertices[2].t = This->bltvertices[3].s = This->bltvertices[3].t = 0.;
|
| | 3732 | + if (scale512448)
|
| | 3733 | + {
|
| | 3734 | + This->bltvertices[0].s = This->bltvertices[2].s = 0.9f;
|
| | 3735 | + This->bltvertices[0].t = This->bltvertices[1].t = 0.966666667f;
|
| | 3736 | + This->bltvertices[1].s = This->bltvertices[3].s = 0.1f;
|
| | 3737 | + This->bltvertices[2].t = This->bltvertices[3].t = 0.0333333333f;
|
| | 3738 | + }
|
| | 3739 | + else
|
| | 3740 | + {
|
| | 3741 | + This->bltvertices[0].s = This->bltvertices[0].t = This->bltvertices[1].t = This->bltvertices[2].s = 1.;
|
| | 3742 | + This->bltvertices[1].s = This->bltvertices[2].t = This->bltvertices[3].s = This->bltvertices[3].t = 0.;
|
| | 3743 | + }
|
| 3675 | 3744 | glUtil_EnableArray(This->util, This->shaders->shaders[progtype].pos, TRUE);
|
| 3676 | 3745 | This->ext->glVertexAttribPointer(This->shaders->shaders[progtype].pos,2,GL_FLOAT,GL_FALSE,sizeof(BltVertex),&This->bltvertices[0].x);
|
| 3677 | 3746 | glUtil_EnableArray(This->util, This->shaders->shaders[progtype].texcoord, TRUE);
|