From b421863cec7ad8ed9bf4f3ea438a4552a1a9f750 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 13 Mar 2003 07:16:46 +0000 Subject: [PATCH] added -fps option --- ChangeLog | 4 ++++ main/game.c | 12 +++++++----- main/game.h | 2 ++ main/inferno.c | 11 ++++++++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e3c4c65..6bda424f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-03-12 Bradley Bell + + * main/game.c, main/game.h, main/inferno.c: added -maxfps option + 2003-03-12 Bradley Bell * arch/linux/alsadigi.c, arch/linux/findfile.c, diff --git a/main/game.c b/main/game.c index 7d0e2995..77ad2659 100644 --- a/main/game.c +++ b/main/game.c @@ -1,4 +1,4 @@ -/* $Id: game.c,v 1.18 2003-02-28 12:08:34 btb Exp $ */ +/* $Id: game.c,v 1.19 2003-03-13 07:16:46 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -17,7 +17,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -char game_rcsid[] = "$Id: game.c,v 1.18 2003-02-28 12:08:34 btb Exp $"; +char game_rcsid[] = "$Id: game.c,v 1.19 2003-03-13 07:16:46 btb Exp $"; #endif #ifdef WINDOWS @@ -1193,7 +1193,9 @@ int Movie_fixed_frametime; #define Movie_fixed_frametime 0 #endif -static const int max_fps = 80; +//added on 8/18/98 by Victor Rachels to add maximum framerate +int maxfps = 80; +//end this section void calc_frame_time() { @@ -1209,9 +1211,9 @@ void calc_frame_time() do { timer_value = timer_get_fixed_seconds(); FrameTime = timer_value - last_timer_value; - if (FrameTime < f1_0/max_fps); + if (FrameTime < f1_0/maxfps); timer_delay(1); - } while (FrameTime < f1_0/max_fps); + } while (FrameTime < f1_0/maxfps); #if defined(TIMER_TEST) && !defined(NDEBUG) _timer_value = timer_value; diff --git a/main/game.h b/main/game.h index 2115081c..4a26ece2 100644 --- a/main/game.h +++ b/main/game.h @@ -262,4 +262,6 @@ int gr_toggle_fullscreen_game(void); */ void flickering_light_read(flickering_light *fl, CFILE *fp); +extern int maxfps; + #endif diff --git a/main/inferno.c b/main/inferno.c index 365db509..cebc4196 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -1,4 +1,4 @@ -/* $Id: inferno.c,v 1.55 2003-02-28 09:56:10 btb Exp $ */ +/* $Id: inferno.c,v 1.56 2003-03-13 07:16:46 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -908,6 +908,7 @@ void print_commandline_help() printf( " D2X Options:\n\n"); printf( " -noredundancy %s\n", "Do not send messages when picking up redundant items in multi"); printf( " -shortpackets %s\n", "Set shortpackets to default as on"); + printf( " -maxfps %s\n", "Set maximum framerate (1-100)"); printf( " -notitles %s\n", "Do not show titlescreens on startup"); printf( " -hogdir %s\n", "set shared data directory to "); printf( " -ini %s\n", "option file (alternate to command line), defaults to d2x.ini"); @@ -1254,6 +1255,14 @@ int main(int argc,char **argv) //con_printf(CON_VERBOSE, "\n%s...", "Checking for Descent 2 CD-ROM"); + //added/edited 8/18/98 by Victor Rachels to set maximum fps <= 100 + if ((t = FindArg( "-maxfps" ))) { + t=atoi(Args[t+1]); + if (t>0&&t<=80) + maxfps=t; + } + //end addition - Victor Rachels + if ( FindArg( "-autodemo" )) Auto_demo = 1; -- 2.39.2