Skip to content
Snippets Groups Projects
Forked from STJr / SRB2
143 commits behind, 2 commits ahead of the upstream repository.
r_fps.h 5.10 KiB
// 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-2024 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"
#include "m_perfstats.h" // ps_metric_t

extern consvar_t cv_fpscap;

extern ps_metric_t ps_interp_frac;
extern ps_metric_t ps_interp_lag;

UINT32 R_GetFramerateCap(void);
boolean R_UsingFrameInterpolation(void);

enum viewcontext_e
{
	VIEWCONTEXT_PLAYER1 = 0,
	VIEWCONTEXT_PLAYER2,
	VIEWCONTEXT_SKY1,
	VIEWCONTEXT_SKY2
};

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;
	fixed_t cos;
	fixed_t sin;
	mobj_t *mobj;
} viewvars_t;

extern viewvars_t *newview;

typedef struct {
	fixed_t x;
	fixed_t y;
	fixed_t z;
	subsector_t *subsector;
	angle_t angle;
	angle_t pitch;
	angle_t roll;
	angle_t spriteroll;
	fixed_t scale;
	fixed_t radius;
	fixed_t height;
	fixed_t spritexscale;
	fixed_t spriteyscale;
	fixed_t spritexoffset;