MCPcopy Create free account
hub / github.com/ThirteenAG/WidescreenFixesPack / GetScreenRect

Function GetScreenRect

includes/GTA/CCamera.cpp:11–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9extern uint32_t* BordersVar2;
10
11void GetScreenRect(CRect& rect)
12{
13 float fScreenRatio = *CDraw::pfScreenAspectRatio;
14 float dScreenHeightWeWannaCut = ((-9.0f / 16.0f) * fScreenRatio + 1.0f);
15 float dBorderProportionsFix = ((-144643.0f / 50000.0f) * fScreenRatio * fScreenRatio) + ((807321.0f / 100000.0f) * fScreenRatio) - (551143.0f / 100000.0f);
16
17 if (dBorderProportionsFix < 0.0)
18 dBorderProportionsFix = 0.0;
19
20 if (dScreenHeightWeWannaCut > 0.0)
21 {
22 // Letterbox
23 rect.m_fBottom = ((float)RsGlobal->MaximumHeight / 2) * (dScreenHeightWeWannaCut - dBorderProportionsFix);
24 rect.m_fTop = (float)RsGlobal->MaximumHeight - (((float)RsGlobal->MaximumHeight / 2) * (dScreenHeightWeWannaCut + dBorderProportionsFix));
25 }
26 else
27 {
28 // Pillarbox
29 dScreenHeightWeWannaCut = -dScreenHeightWeWannaCut;
30
31 rect.m_fLeft = ((float)RsGlobal->MaximumWidth / 4) * dScreenHeightWeWannaCut;
32 rect.m_fRight = (float)RsGlobal->MaximumWidth - ((float)RsGlobal->MaximumWidth / 4) * dScreenHeightWeWannaCut;
33 }
34}
35
36void Hide1pxAABug()
37{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected