Topic: some question about function CalcScreenParams
hi guys, i have a question about the function CalcScreenParams, it locate in game/client/render.cpp.
The function implementation code is as follows:
static void CalcScreenParams(float Amount, float WMax, float HMax, float Aspect, float *w, float *h)
{
float f = sqrtf(Amount) / sqrtf(Aspect);
*w = f*Aspect;
*h = f;
// limit the view
...
}
the function invoking code is as follows:
CalcScreenParams(1150*1000, 1500, 1050, Aspect, &Width, &Height);
so my question is here,
the function parameter Amount means what?
why specify Amount=1150*1000. (i guess it related with screen aspect ratio or total pixel count or something else?)
float f = sqrtf(Amount) / sqrtf(Aspect); how this expression works? why the result is height.
i searched some keyword on forum and internet but didn't find something helpful, so someone can explain it? many thanks!!!
i know it specify maxWidth is 1500 and maxHeight is 1050 for limit view.