BaseRatioSizes replacement functions

This commit is contained in:
Magnus Norddahl 2016-09-12 14:37:10 +02:00
parent 5720634045
commit 6d4e4dad25
2 changed files with 25 additions and 0 deletions

View File

@ -1721,6 +1721,26 @@ const int BaseRatioSizes[7][4] =
{ 1707, 338, 0, 48*9/16 } // 21:9 568.8889, 337.5, multiplied by three
};
int AspectBaseWidth(float aspect)
{
return (int)round(240.0f * aspect * 3.0f);
}
int AspectBaseHeight(float aspect)
{
return (int)round(200.0f * (320.0f / (240.0f * aspect)) * 3.0f);
}
int AspectPspriteOffset(float aspect)
{
return aspect < 1.3f ? (int)(6.5*FRACUNIT) : 0;
}
int AspectMultiplier(float aspect)
{
return (int)round(320.0f / (240.0f * aspect) * 48.0f);
}
void IVideo::DumpAdapters ()
{
Printf("Multi-monitor support unavailable.\n");

View File

@ -518,6 +518,11 @@ int CheckRatio (int width, int height, int *trueratio=NULL);
static inline int CheckRatio (double width, double height) { return CheckRatio(int(width), int(height)); }
float ActiveRatio (int width, int height, float *trueratio = NULL);
static inline double ActiveRatio (double width, double height) { return ActiveRatio(int(width), int(height)); }
int AspectBaseWidth(float aspect);
int AspectBaseHeight(float aspect);
int AspectPspriteOffset(float aspect);
int AspectMultiplier(float aspect);
extern const int BaseRatioSizes[7][4];
inline bool IsRatioWidescreen(int ratio) {