Index: src/game_config.h =================================================================== --- src/game_config.h (revision 197) +++ src/game_config.h (working copy) @@ -198,6 +198,8 @@ PROTO_PARAM_BOOL( disable_background ); +PROTO_PARAM_INT( max_texture_size ); + PROTO_PARAM_STRING( ui_language ); Index: src/game_config.cpp =================================================================== --- src/game_config.cpp (revision 197) +++ src/game_config.cpp (working copy) @@ -472,6 +472,7 @@ struct param ui_language; struct param disable_videomode_autodetection; struct param disable_background; + struct param max_texture_size; }; static struct params Params; @@ -831,6 +832,16 @@ disable_background, false, "# Set this to completely remove the background (skybox)\n" "# This option would improve the performance." ); + + INIT_PARAM_INT( + max_texture_size, 0, + "# Maximum texture size, larger textures will be scaled down\n" + "# to this size. This may improve performance if you are limited\n" + "# by graphics memory capacity or bandwidth, at the expense of\n" + "# lower image quality.\n" + "# Values must be powers of 2, e.g. 512 or 256.\n" + "# The default value of 0 means the graphics card maximum\n" + "# texture size will be the limit." ); INIT_PARAM_STRING( ui_language, "en_GB" , @@ -921,6 +932,7 @@ FN_PARAM_BOOL( disable_collision_detection ) FN_PARAM_BOOL( disable_videomode_autodetection ) FN_PARAM_BOOL( disable_background ) +FN_PARAM_INT( max_texture_size ) FN_PARAM_STRING( ui_language ) Index: src/textures.cpp =================================================================== --- src/textures.cpp (revision 197) +++ src/textures.cpp (working copy) @@ -120,6 +120,12 @@ /* Check if we need to scale image */ glGetIntegerv( GL_MAX_TEXTURE_SIZE, (GLint*) &max_texture_size ); + + if ( getparam_max_texture_size() > 0 ) + { + max_texture_size = std::min( max_texture_size, getparam_max_texture_size() ); + } + if ( texImage->width > max_texture_size || texImage->height > max_texture_size ) { @@ -129,9 +135,13 @@ check_assertion( newdata != NULL, "out of memory" ); - print_debug( DEBUG_TEXTURE, "Texture `%s' too large -- scaling to " - "maximum allowed size", - filename ); + print_debug( DEBUG_TEXTURE, "Texture `%s' %dx%d -- scaling to " + "%dx%d", + filename, + texImage->width, + texImage->height, + max_texture_size, + max_texture_size ); /* In the case of large- or small-aspect ratio textures, this could end up using *more* space... oh well. */