From 7f67d63ea0c718c5e2da958fa84949e384bc0723 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 20 May 2004 23:36:16 +0000 Subject: [PATCH] integrated some niceautomap stuff from d1x --- ChangeLog | 4 ++++ main/automap.c | 10 +++++++++- main/automap.h | 3 ++- main/inferno.c | 10 +++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97cb9ac7..ddba4047 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-05-20 Bradley Bell + + * main/inferno.c: integrated some niceautomap stuff from d1x + 2004-05-20 Matthew Mueller * arch/win32/joyhh.c: fixed the config bug where it'd always put diff --git a/main/automap.c b/main/automap.c index f13a6f35..8d8d9fd8 100644 --- a/main/automap.c +++ b/main/automap.c @@ -1,4 +1,4 @@ -/* $Id: automap.c,v 1.16 2003-11-15 00:37:48 btb Exp $ */ +/* $Id: automap.c,v 1.17 2004-05-20 23:36:13 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -1010,6 +1010,7 @@ u_int32_t automap_mode = SM(640,480); int automap_width = 640; int automap_height = 480; int automap_use_game_res=0; +int nice_automap = 0; #define RESCALE_X(x) ((x) * automap_width / 640) #define RESCALE_Y(y) ((y) * automap_height / 480) @@ -1505,6 +1506,13 @@ WIN(if (redraw_screen) redraw_screen = 0); } t2 = timer_get_fixed_seconds(); + while (t2 - t1 < F1_0 / 100) // ogl is fast enough that the automap can read the input too fast and you start to turn really slow. So delay a bit (and free up some cpu :) + { + if (nice_automap) + timer_delay(1); + + t2 = timer_get_fixed_seconds(); + } if (pause_game) FrameTime=t2-t1; t1 = t2; diff --git a/main/automap.h b/main/automap.h index ea2ebdba..b041d637 100644 --- a/main/automap.h +++ b/main/automap.h @@ -1,4 +1,4 @@ -/* $Id: automap.h,v 1.4 2003-11-15 00:36:54 btb Exp $ */ +/* $Id: automap.h,v 1.5 2004-05-20 23:36:15 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -71,5 +71,6 @@ extern u_int32_t automap_mode; //extern int automap_height; //end addition -MM extern int automap_use_game_res; +extern int nice_automap; #endif diff --git a/main/inferno.c b/main/inferno.c index 299a58b5..206789cf 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -1,4 +1,4 @@ -/* $Id: inferno.c,v 1.78 2004-05-20 19:10:25 btb Exp $ */ +/* $Id: inferno.c,v 1.79 2004-05-20 23:36:16 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -1015,6 +1015,7 @@ void print_commandline_help() #else printf( " -x %s\n", "Change screen resolution to by "); #endif + printf(" -niceautomap %s\n", "Free cpu while doing automap"); printf( " -automapx %s\n","Set automap resolution to by "); printf( " -automap_gameres %s\n","Set automap to use the same resolution as in game"); // printf( " -menux %s\n","Set menu resolution to by "); @@ -1266,6 +1267,13 @@ int main(int argc, char *argv[]) } //end addition - Victor Rachels +#ifdef SUPPORTS_NICEFPS + if (FindArg("-nicefps")) + use_nice_fps = 1; + if (FindArg("-niceautomap")) + nice_automap = 1; +#endif + if (FindArg("-renderstats")) gr_renderstats = 1; -- 2.39.2