diff --git a/arch/ogl/gr.c b/arch/ogl/gr.c index 466fffa16..17be1f0b8 100755 --- a/arch/ogl/gr.c +++ b/arch/ogl/gr.c @@ -211,8 +211,10 @@ void ogl_get_verinfo(void){ int gr_set_mode(u_int32_t mode) { - unsigned int w,h; + unsigned int w,h,t; char *gr_bm_data; + float awidth = 3; + float aheight = 4; #ifdef NOGRAPH return 0; @@ -227,18 +229,24 @@ return 0; //if (screen != NULL) gr_palette_clear(); // ogl_init_state(); + + if ((t = FindArg( "-aspect" ))) { + t=atoi(Args[t+1]); + if (t>0&&t<=16) + aheight=t; + } + if ((t = FindArg( "-aspect" ))) { + t=atoi(Args[t+2]); + if (t>0&&t<=16) + awidth=t; + } gr_bm_data=grd_curscreen->sc_canvas.cv_bitmap.bm_data;//since we use realloc, we want to keep this pointer around. memset( grd_curscreen, 0, sizeof(grs_screen)); grd_curscreen->sc_mode = mode; grd_curscreen->sc_w = w; grd_curscreen->sc_h = h; - if (FindArg("-16to9")) - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*9,grd_curscreen->sc_h*16); - else if (FindArg("-16to10")) - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*10,grd_curscreen->sc_h*16); - else - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*3,grd_curscreen->sc_h*4); + grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*awidth,grd_curscreen->sc_h*aheight); grd_curscreen->sc_canvas.cv_bitmap.bm_x = 0; grd_curscreen->sc_canvas.cv_bitmap.bm_y = 0; grd_curscreen->sc_canvas.cv_bitmap.bm_w = w; diff --git a/arch/sdl/gr.c b/arch/sdl/gr.c index ee3a7f31a..da51ffa31 100755 --- a/arch/sdl/gr.c +++ b/arch/sdl/gr.c @@ -65,7 +65,9 @@ void gr_update() int gr_set_mode(u_int32_t mode) { - int w,h; + int w,h,t; + float awidth = 3; + float aheight = 4; #ifdef NOGRAPH return 0; @@ -79,6 +81,17 @@ int gr_set_mode(u_int32_t mode) if (screen != NULL) gr_palette_clear(); + if ((t = FindArg( "-aspect" ))) { + t=atoi(Args[t+1]); + if (t>0&&t<=16) + aheight=t; + } + if ((t = FindArg( "-aspect" ))) { + t=atoi(Args[t+2]); + if (t>0&&t<=16) + awidth=t; + } + //added on 11/06/98 by Matt Mueller to set the title bar. (moved from below) //sekmu: might wanna copy this litte blurb to one of the text files or something //we want to set it here so that X window manager "Style" type commands work @@ -108,12 +121,7 @@ int gr_set_mode(u_int32_t mode) grd_curscreen->sc_mode = mode; grd_curscreen->sc_w = w; grd_curscreen->sc_h = h; - if (FindArg("-16to9")) - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*9,grd_curscreen->sc_h*16); - else if (FindArg("-16to10")) - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*10,grd_curscreen->sc_h*16); - else - grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*3,grd_curscreen->sc_h*4); + grd_curscreen->sc_aspect = fixdiv(grd_curscreen->sc_w*awidth,grd_curscreen->sc_h*aheight); grd_curscreen->sc_canvas.cv_bitmap.bm_x = 0; grd_curscreen->sc_canvas.cv_bitmap.bm_y = 0; grd_curscreen->sc_canvas.cv_bitmap.bm_w = w; diff --git a/d1x.ini b/d1x.ini index b9d6e3161..ae949672c 100755 --- a/d1x.ini +++ b/d1x.ini @@ -11,8 +11,7 @@ ;-gl_trilinear ;set gl texture filters to trilinear mipmapping ;-gl_refresh ;set refresh rate (in fullscreen mode) ;-gl_reticle ;[WINDOWS ONLY] use OGL reticle 0=never 1=above 320x* 2=always -;-16to9 ;use 16/9 widescreen -;-16to10 ;use 16/10 widescreen +;-aspect ;use specified aspect - example: -aspect 16 9, -aspect 16 7.5 etc. *********** ***Sound*** diff --git a/main/inferno.c b/main/inferno.c index c5e666ccb..f7c13097e 100755 --- a/main/inferno.c +++ b/main/inferno.c @@ -319,8 +319,7 @@ void show_cmdline_help() { #ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE printf( " -window %s\n", "Run the game in a window"); // ZICO - from window to fullscreen #endif - printf( " -16to9 %s\n", "use 16/9 widescreen"); - printf( " -16to10 %s\n", "use 16/10 widescreen"); + printf( " -aspect %s\n" ";use specified aspect - example: -aspect 16 9, -aspect 16 7.5 etc."); #ifdef OGL printf( " -gl_texmaxfilt %s\n","set GL_TEXTURE_MAX_FILTER (see readme.d1x)"); printf( " -gl_texminfilt %s\n","set GL_TEXTURE_MIN_FILTER (see readme.d1x)");