Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Determines how weapons and their muzzle flash are placed and scaled when drawn in the first person view.
- // 0 - the weapon and its muzzle flash are placed and scaled like in UT 436.
- // > 0 - muzzle flash is adjusted by the viewport's aspect ratio and FOVAngle.
- // 1 - the weapon is placed like in UT 436, taking 4:3 FOV as the FOVAngle.
- // 2 - the weapon is placed at its default position or possibly shifted from such a position closer to the viewport
- // depending on viewport's FOVAngle and WeaponFOVScaling.
- var globalconfig transient byte WeaponFOVFix;
- // Determines how much the weapon is moved towards the viewport when using WeaponFOVFix == 2 with a large FOVAngle.
- // Min value is 0.0 which corresponds to the Unreal 1 method, max value is 1.0.
- var globalconfig transient float WeaponFOVScaling;
- exec function SetNarrowFOV(float FOV)
- {
- local string CurrentRes;
- local int i;
- local float ScreenWidth, ScreenHeight;
- CurrentRes = ConsoleCommand("GetCurrentRes");
- i = InStr(CurrentRes, "x");
- if (i > 0)
- {
- ScreenWidth = int(Left(CurrentRes, i));
- ScreenHeight = int(Mid(CurrentRes, i + 1));
- if (ScreenWidth > 0 && ScreenHeight > 0)
- SetDesiredFOV(Atan(Tan(FClamp(FOV, 1.0, 179.0) * Pi / 360.0) *
- FMax(1.0, 0.75 * ScreenWidth / ScreenHeight)) * 360.0 / Pi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement