From 89feeb17e23ddd1183dbbe46a2d18172adde4768 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sat, 22 May 2004 22:43:56 +0000 Subject: [PATCH] made opengl use 32bpp screen mode by default, add option to use 16bpp (d1x r1.4, r1.16, r1.34) --- ChangeLog | 4 ++++ arch/ogl/sdlgl.c | 14 +++++++++----- arch/ogl/wgl.c | 4 ++-- main/inferno.c | 3 ++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8cf56608..6be84871 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-05-22 Matthew Mueller + * arch/ogl/sdlgl.c, arch/ogl/wgl.c, main/inferno.c: made opengl + use 32bpp screen mode by default, add option to use 16bpp (d1x + r1.4, r1.16, r1.34) + * arch/ogl/ogl.c: allow for texture dimensions of 1, and fix ogl replacement texture paletted->rgb conversion alpha problem (d1x r1.43) diff --git a/arch/ogl/sdlgl.c b/arch/ogl/sdlgl.c index c61b73e5..e227801b 100644 --- a/arch/ogl/sdlgl.c +++ b/arch/ogl/sdlgl.c @@ -1,4 +1,4 @@ -/* $Id: sdlgl.c,v 1.11 2004-05-20 02:04:28 btb Exp $ */ +/* $Id: sdlgl.c,v 1.12 2004-05-22 22:43:50 btb Exp $ */ /* * * Graphics functions for SDL-GL. @@ -68,7 +68,10 @@ int ogl_check_mode(int x, int y) } -int ogl_init_window(int x, int y){ +int ogl_init_window(int x, int y) +{ + int bpp = FindArg("-gl_16bpp") ? 16 : 32; + if (gl_initialized){ if (x==curx && y==cury && curfull==ogl_fullscreen) return 0; @@ -86,9 +89,10 @@ int ogl_init_window(int x, int y){ } #endif - if (!SDL_SetVideoMode(x,y, 16, SDL_OPENGL | (ogl_fullscreen?SDL_FULLSCREEN:0))) { - Error("Could not set %dx%dx16 opengl video mode\n",x,y); - } + if (!SDL_SetVideoMode(x, y, bpp, SDL_OPENGL | (ogl_fullscreen ? SDL_FULLSCREEN : 0))) + { + Error("Could not set %dx%dx%d opengl video mode\n", x, y, bpp); + } SDL_ShowCursor(0); curx=x;cury=y;curfull=ogl_fullscreen; diff --git a/arch/ogl/wgl.c b/arch/ogl/wgl.c index b136be77..33d1eedd 100644 --- a/arch/ogl/wgl.c +++ b/arch/ogl/wgl.c @@ -1,4 +1,4 @@ -/* $Id: wgl.c,v 1.8 2004-05-20 07:49:21 btb Exp $ */ +/* $Id: wgl.c,v 1.9 2004-05-22 22:43:52 btb Exp $ */ /* * * opengl platform specific functions for WGL - added by Peter Hawkins @@ -355,7 +355,7 @@ bool OpenGL_Initialize(void) int retval; devmode.dmSize=sizeof(devmode); - devmode.dmBitsPerPel=16; + devmode.dmBitsPerPel = FindArg("-gl_16bpp") ? 16 : 32; devmode.dmPelsWidth=GLPREF_width; devmode.dmPelsHeight=GLPREF_height; devmode.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; diff --git a/main/inferno.c b/main/inferno.c index 60baf894..f725952a 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -1,4 +1,4 @@ -/* $Id: inferno.c,v 1.84 2004-05-22 07:16:04 btb Exp $ */ +/* $Id: inferno.c,v 1.85 2004-05-22 22:43:56 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -1041,6 +1041,7 @@ void print_commandline_help() printf( " -gl_voodoo %s\n","force fullscreen mode only"); #endif printf( " -gl_16bittextures %s\n","attempt to use 16bit textures"); + printf(" -gl_16bpp %s\n", "attempt to use 16bit screen mode"); printf( " -gl_reticle %s\n","use OGL reticle 0=never 1=above 320x* 2=always"); printf( " -gl_intensity4_ok %s\n","FIXME: Undocumented"); printf( " -gl_luminance4_alpha4_ok %s\n","FIXME: Undocumented"); -- 2.39.2