mirror of https://github.com/snes9xgit/snes9x.git
win32: properly adjust height for filters (fixes #305)
This commit is contained in:
parent
06f84ee6b3
commit
9a78a04a90
|
@ -477,12 +477,31 @@ inline static bool GetFilterBlendSupport(RenderFilter filterID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void SetRect(RECT* rect, int width, int height, int scale)
|
void AdjustHeightExtend(unsigned int &height)
|
||||||
{
|
{
|
||||||
|
if(GUI.HeightExtend)
|
||||||
|
{
|
||||||
|
if(height == SNES_HEIGHT)
|
||||||
|
height = SNES_HEIGHT_EXTENDED;
|
||||||
|
else if(height == SNES_HEIGHT * 2)
|
||||||
|
height = SNES_HEIGHT_EXTENDED * 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(height == SNES_HEIGHT_EXTENDED)
|
||||||
|
height = SNES_HEIGHT;
|
||||||
|
else if(height == SNES_HEIGHT_EXTENDED * 2)
|
||||||
|
height = SNES_HEIGHT * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void SetRect(RECT* rect, unsigned int width, unsigned int height, int scale)
|
||||||
|
{
|
||||||
|
AdjustHeightExtend(height);
|
||||||
rect->left = 0;
|
rect->left = 0;
|
||||||
rect->right = width * scale;
|
rect->right = width * scale;
|
||||||
rect->top = 0;
|
rect->top = 0;
|
||||||
rect->bottom = (height - (GUI.HeightExtend ? 0 : 15)) * scale;
|
rect->bottom = height * scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT GetFilterOutputSize(SSurface Src)
|
RECT GetFilterOutputSize(SSurface Src)
|
||||||
|
@ -536,6 +555,7 @@ void SelectRenderMethod()
|
||||||
|
|
||||||
void RenderMethod(SSurface Src, SSurface Dst, RECT * rect)
|
void RenderMethod(SSurface Src, SSurface Dst, RECT * rect)
|
||||||
{
|
{
|
||||||
|
AdjustHeightExtend(Src.Height);
|
||||||
if(Src.Height > SNES_HEIGHT_EXTENDED || Src.Width == 512) {
|
if(Src.Height > SNES_HEIGHT_EXTENDED || Src.Width == 512) {
|
||||||
if(GUI.BlendHiRes && Src.Width == 512 && !GetFilterBlendSupport(GUI.ScaleHiRes)) {
|
if(GUI.BlendHiRes && Src.Width == 512 && !GetFilterBlendSupport(GUI.ScaleHiRes)) {
|
||||||
RenderMergeHires(Src.Surface,Src.Pitch,BlendBuffer,EXT_PITCH,Src.Width,Src.Height);
|
RenderMergeHires(Src.Surface,Src.Pitch,BlendBuffer,EXT_PITCH,Src.Width,Src.Height);
|
||||||
|
|
Loading…
Reference in New Issue