Sprite Scaling option

This commit is contained in:
Fire-Head 2020-12-29 20:24:16 +03:00
parent 40b90618ef
commit 224e805fe4
11 changed files with 106 additions and 17 deletions

View file

@ -35,8 +35,14 @@ CDraw::FindAspectRatio(void)
default:
case AR_4_3:
return 4.0f / 3.0f;
case AR_5_4:
return 5.0f / 4.0f;
case AR_16_10:
return 16.0f / 10.0f;
case AR_16_9:
return 16.0f / 9.0f;
case AR_21_9:
return 21.0f / 9.0f;
};
#endif
}
@ -72,12 +78,13 @@ CDraw::SetFOV(float fov)
}
#ifdef ASPECT_RATIO_SCALE
float
ScaleAndCenterX(float x)
float CDraw::ScaleY(float y)
{
if (SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH)
return x;
else
return (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X(x);
switch ( CMenuManager::m_PrefsSpriteScalingMode )
{
case SCL_PC: return y * ((float)DEFAULT_SCREEN_HEIGHT/SCREEN_HEIGHT_NTSC);
default:
return y;
}
}
#endif