From 95f355e8c652dbf2f63b454c613239f734f9de0e Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 11 Oct 2002 03:37:58 +0000 Subject: [PATCH] enable -nofade --- 2d/palette.c | 4 +++- arch/sdl/gr.c | 16 +++++++++++++++- include/palette.h | 3 ++- main/inferno.c | 8 ++++---- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/2d/palette.c b/2d/palette.c index 30c6c6e2..e3326c79 100644 --- a/2d/palette.c +++ b/2d/palette.c @@ -1,4 +1,4 @@ -/* $Id: palette.c,v 1.6 2002-09-07 07:18:22 btb Exp $ */ +/* $Id: palette.c,v 1.7 2002-10-11 03:37:58 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -172,6 +172,8 @@ ubyte gr_palette_gamma = 0; int gr_palette_gamma_param = 0; ubyte gr_palette_faded_out = 1; +int grd_fades_disabled=0; // Used to skip fading for development + extern void gr_palette_load( ubyte * pal ); void gr_palette_set_gamma( int gamma ) diff --git a/arch/sdl/gr.c b/arch/sdl/gr.c index 5c22ee05..28abced0 100644 --- a/arch/sdl/gr.c +++ b/arch/sdl/gr.c @@ -1,4 +1,4 @@ -/* $Id: gr.c,v 1.7 2002-08-04 23:18:11 btb Exp $ */ +/* $Id: gr.c,v 1.8 2002-10-11 03:37:58 btb Exp $ */ /* * * SDL video functions. @@ -320,6 +320,13 @@ int gr_palette_fade_out(ubyte *pal, int nsteps, int allow_keys) if (gr_palette_faded_out) return 0; +#if 1 //ifndef NDEBUG + if (grd_fades_disabled) { + gr_palette_clear(); + return 0; + } +#endif + palette = screen->format->palette; if (palette == NULL) { return -1; // Display is not palettised @@ -380,6 +387,13 @@ int gr_palette_fade_in(ubyte *pal, int nsteps, int allow_keys) if (!gr_palette_faded_out) return 0; +#if 1 //ifndef NDEBUG + if (grd_fades_disabled) { + gr_palette_load(pal); + return 0; + } +#endif + palette = screen->format->palette; if (palette == NULL) { diff --git a/include/palette.h b/include/palette.h index 7215e79d..f1f8e664 100644 --- a/include/palette.h +++ b/include/palette.h @@ -1,4 +1,4 @@ -/* $Id: palette.h,v 1.2 2002-08-15 07:17:39 btb Exp $ */ +/* $Id: palette.h,v 1.3 2002-10-11 03:37:58 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -61,6 +61,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. extern void gr_palette_set_gamma( int gamma ); extern int gr_palette_get_gamma(); extern ubyte gr_palette_faded_out; +extern int grd_fades_disabled; extern void gr_palette_clear(); extern int gr_palette_fade_out(ubyte *pal, int nsteps, int allow_keys ); extern int gr_palette_fade_in(ubyte *pal,int nsteps, int allow_keys ); diff --git a/main/inferno.c b/main/inferno.c index 3e5463da..c8c82649 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -1,4 +1,4 @@ -/* $Id: inferno.c,v 1.46 2002-10-10 19:16:52 btb Exp $ */ +/* $Id: inferno.c,v 1.47 2002-10-11 03:37:58 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -856,7 +856,6 @@ extern int VR_low_res; extern int Config_vr_type; extern int Config_vr_resolution; extern int Config_vr_tracking; -int grd_fades_disabled=1; #define LINE_LEN 100 @@ -946,7 +945,9 @@ void print_commandline_help() #ifdef __DJGPP__ printf( " -nocyberman %s\n","FIXME: Undocumented"); #endif +#ifndef NDEBUG printf( " -nofade %s\n","Disable fades"); +#endif #ifdef NETWORK printf( " -nomatrixcheat %s\n","FIXME: Undocumented"); printf( " -norankings %s\n","Disable multiplayer ranking system"); @@ -1041,7 +1042,6 @@ void print_commandline_help() void do_joystick_init() { - if (!FindArg( "-nojoystick" )) { con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6); joy_init(); @@ -1351,7 +1351,7 @@ int main(int argc,char **argv) con_printf(CON_VERBOSE, "\n%s\n\n", TXT_INITIALIZING_GRAPHICS); if (FindArg("-nofade")) grd_fades_disabled=1; - + //determine whether we're using high-res menus & movies #if !defined(POLY_ACC) if (FindArg("-nohires") || FindArg("-nohighres") || (gr_check_mode(MENU_HIRES_MODE) != 0) || disable_high_res) -- 2.39.2