RingRacers/src/r_fps.h
Sally Coolatta 369d5398c5 Lots of FPS stuff
- Disabled VSync, due to the numerous problems it has.
- Instead, added an FPS cap.
- Frame interpolation is now tied to fpscap != 35.
- By default, the FPS cap is set to the monitor's refresh rate.
- Rewrote the FPS counter.
2022-03-26 23:48:08 -04:00

69 lines
1.8 KiB
C

// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze, Andrey Budko (prboom)
// Copyright (C) 1999-2019 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file r_fps.h
/// \brief Uncapped framerate stuff.
#ifndef __R_FPS_H__
#define __R_FPS_H__
#include "m_fixed.h"
#include "p_local.h"
#include "r_state.h"
extern consvar_t cv_fpscap;
UINT32 R_GetFramerateCap(void);
boolean R_UsingFrameInterpolation(void);
enum viewcontext_e
{
VIEWCONTEXT_PLAYER1 = 0,
VIEWCONTEXT_PLAYER2,
VIEWCONTEXT_PLAYER3,
VIEWCONTEXT_PLAYER4,
VIEWCONTEXT_SKY1,
VIEWCONTEXT_SKY2,
VIEWCONTEXT_SKY3,
VIEWCONTEXT_SKY4
};
typedef struct {
fixed_t x;
fixed_t y;
fixed_t z;
boolean sky;
sector_t *sector;
player_t *player;
angle_t angle;
angle_t aim;
angle_t roll;
fixed_t cos;
fixed_t sin;
mobj_t *mobj;
} viewvars_t;
extern viewvars_t *newview;
// Interpolates the current view variables (r_state.h) against the selected view context in R_SetViewContext
void R_InterpolateView(fixed_t frac);
// Special function just for software
void R_InterpolateViewRollAngle(fixed_t frac);
// Buffer the current new views into the old views. Call once after each real tic.
void R_UpdateViewInterpolation(void);
// Set the current view context (the viewvars pointed to by newview)
void R_SetViewContext(enum viewcontext_e _viewcontext);
fixed_t R_InterpolateFixed(fixed_t from, fixed_t to);
angle_t R_InterpolateAngle(angle_t from, angle_t to);
#endif