View Angles (Part 1 - Redux) (#1002)

* Added ViewAngle/Pitch/Roll properties to actors.

- These are offsets for camera angles that allow turning the camera without affecting aim or movement direction.
- Added A_SetView<Angle/Pitch/Roll>, which will set the view direction.
- Added ABSVIEWANGLES flag, used to make the view absolute instead of an offset.

* Converted functions to be direct-native.
This commit is contained in:
MajorCooke 2020-08-27 12:03:06 -05:00 committed by GitHub
commit eaba63e13b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 203 additions and 35 deletions

View file

@ -804,7 +804,17 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor
viewpoint.sector = viewpoint.camera->Sector;
viewpoint.showviewer = false;
}
iview->New.Angles = viewpoint.camera->Angles;
// [MC] Apply the view angles first, which is the offsets. If the absolute isn't desired,
// add the standard angles on top of it.
viewpoint.Angles = viewpoint.camera->ViewAngles;
if (!(viewpoint.camera->flags8 & MF8_ABSVIEWANGLES))
{
viewpoint.Angles += viewpoint.camera->Angles;
}
iview->New.Angles = viewpoint.Angles;
if (viewpoint.camera->player != 0)
{
player = viewpoint.camera->player;