Remove (faulty/outdated) video ram detection

This commit is contained in:
Andre d 2012-07-04 14:58:15 -04:00 committed by dhewg
parent 3706f8fb85
commit 7a5b8b1ec0
8 changed files with 8 additions and 76 deletions

View file

@ -97,7 +97,6 @@ idCVar com_timestampPrints( "com_timestampPrints", "0", CVAR_SYSTEM, "print time
idCVar com_timescale( "timescale", "1", CVAR_SYSTEM | CVAR_FLOAT, "scales the time", 0.1f, 10.0f );
idCVar com_makingBuild( "com_makingBuild", "0", CVAR_BOOL | CVAR_SYSTEM, "1 when making a build" );
idCVar com_updateLoadSize( "com_updateLoadSize", "0", CVAR_BOOL | CVAR_SYSTEM | CVAR_NOCHEAT, "update the load size after loading a map" );
idCVar com_videoRam( "com_videoRam", "64", CVAR_INTEGER | CVAR_SYSTEM | CVAR_NOCHEAT | CVAR_ARCHIVE, "holds the last amount of detected video ram" );
idCVar com_product_lang_ext( "com_product_lang_ext", "1", CVAR_INTEGER | CVAR_SYSTEM | CVAR_ARCHIVE, "Extension to use when creating language files." );
@ -1455,29 +1454,8 @@ void Com_ExecMachineSpec_f( const idCmdArgs &args ) {
cvarSystem->SetCVarInteger( "r_multiSamples", 0, CVAR_ARCHIVE );
}
if ( Sys_GetVideoRam() < 128 ) {
cvarSystem->SetCVarBool( "image_ignoreHighQuality", true, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSize", 1, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeLimit", 256, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeSpecular", 1, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeSpecularLimit", 64, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeBump", 1, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeBumpLimit", 256, CVAR_ARCHIVE );
}
if ( Sys_GetSystemRam() < 512 ) {
cvarSystem->SetCVarBool( "image_ignoreHighQuality", true, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "s_maxSoundsPerShader", 1, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSize", 1, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeLimit", 256, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeSpecular", 1, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_downSizeSpecularLimit", 64, CVAR_ARCHIVE );
cvarSystem->SetCVarBool( "com_purgeAll", true, CVAR_ARCHIVE );
cvarSystem->SetCVarBool( "r_forceLoadImages", true, CVAR_ARCHIVE );
} else {
cvarSystem->SetCVarBool( "com_purgeAll", false, CVAR_ARCHIVE );
cvarSystem->SetCVarBool( "r_forceLoadImages", false, CVAR_ARCHIVE );
}
cvarSystem->SetCVarBool( "com_purgeAll", false, CVAR_ARCHIVE );
cvarSystem->SetCVarBool( "r_forceLoadImages", false, CVAR_ARCHIVE );
bool oldCard = false;
bool nv10or20 = false;
@ -1504,7 +1482,7 @@ void Com_ExecMachineSpec_f( const idCmdArgs &args ) {
OSX_GetVideoCard( vendorId, deviceId );
OSX_GetCPUIdentification( cpuId, oldArch );
bool isFX5200 = vendorId == 0x10DE && ( deviceId & 0x0FF0 ) == 0x0320;
if ( ( oldArch || ( isFX5200 && Sys_GetVideoRam() < 128 ) ) && com_machineSpec.GetInteger() == 0 ) {
if ( oldArch && ( com_machineSpec.GetInteger() == 0 ) ) {
cvarSystem->SetCVarBool( "r_shadows", false, CVAR_ARCHIVE );
} else {
cvarSystem->SetCVarBool( "r_shadows", true, CVAR_ARCHIVE );
@ -2724,32 +2702,27 @@ idCommonLocal::SetMachineSpec
=================
*/
void idCommonLocal::SetMachineSpec( void ) {
int vidRam = Sys_GetVideoRam();
int sysRam = Sys_GetSystemRam();
bool oldCard = false;
bool nv10or20 = false;
renderSystem->GetCardCaps( oldCard, nv10or20 );
if (oldCard)
Printf( "Detected\n\t%i MB of System memory\n\t%i MB of Video memory on a less than optimal video architecture\n\n", sysRam, vidRam );
else
Printf( "Detected\n\t%i MB of System memory\n\t%i MB of Video memory on an optimal video architecture\n\n", sysRam, vidRam );
Printf( "Detected\n\t%i MB of System memory\n\n", sysRam );
if ( vidRam >= 512 && sysRam >= 1024 && !oldCard ) {
if ( sysRam >= 1024 && !oldCard ) {
Printf( "This system qualifies for Ultra quality!\n" );
com_machineSpec.SetInteger( 3 );
} else if ( vidRam >= 256 && sysRam >= 512 && !oldCard ) {
} else if ( sysRam >= 512 && !oldCard ) {
Printf( "This system qualifies for High quality!\n" );
com_machineSpec.SetInteger( 2 );
} else if ( vidRam >= 128 && sysRam >= 384 ) {
} else if ( sysRam >= 384 ) {
Printf( "This system qualifies for Medium quality.\n" );
com_machineSpec.SetInteger( 1 );
} else {
Printf( "This system qualifies for Low quality.\n" );
com_machineSpec.SetInteger( 0 );
}
com_videoRam.SetInteger( vidRam );
}
static unsigned int AsyncTimer(unsigned int interval, void *) {

View file

@ -73,7 +73,6 @@ extern idCVar com_showAsyncStats;
extern idCVar com_showSoundDecoders;
extern idCVar com_makingBuild;
extern idCVar com_updateLoadSize;
extern idCVar com_videoRam;
extern int time_gameFrame; // game logic time
extern int time_gameDraw; // game present time

View file

@ -1351,7 +1351,7 @@ bool idImage::CheckPrecompressedImage( bool fullLoad ) {
}
// god i love last minute hacks :-)
if ( com_machineSpec.GetInteger() >= 1 && com_videoRam.GetInteger() >= 128 && imgName.Icmpn( "lights/", 7 ) == 0 ) {
if ( com_machineSpec.GetInteger() >= 1 && imgName.Icmpn( "lights/", 7 ) == 0 ) {
return false;
}

View file

@ -39,8 +39,6 @@ If you have questions concerning this license or the applicable additional terms
#include "sys/win32/win_local.h"
#endif
idCVar sys_videoRam("sys_videoRam", "0", CVAR_SYSTEM | CVAR_ARCHIVE | CVAR_INTEGER, "Texture memory on the video card (in megabytes) - 0: autodetect", 0, 512);
/*
===================
GLimp_Init
@ -262,24 +260,3 @@ GLExtension_t GLimp_ExtensionPointer(const char *name) {
return (GLExtension_t)SDL_GL_GetProcAddress(name);
}
/*
================
Sys_GetVideoRam
================
*/
int Sys_GetVideoRam() {
assert(SDL_WasInit(SDL_INIT_VIDEO));
if (sys_videoRam.GetInteger())
return sys_videoRam.GetInteger();
common->Printf("guessing video ram (use +set sys_videoRam to force)\n");
Uint32 vram = SDL_GetVideoInfo()->video_mem;
if (!vram)
vram = 64;
return vram;
}

View file

@ -29,13 +29,3 @@ If you have questions concerning this license or the applicable additional terms
#include "sys/platform.h"
#include "renderer/tr_local.h"
#include "sys/posix/posix_public.h"
/*
================
Sys_GetVideoRam
returns in megabytes
================
*/
int Sys_GetVideoRam( void ) {
return 64;
}

View file

@ -384,9 +384,6 @@ void Posix_LateInit( void ) {
com_pid.SetInteger( getpid() );
common->Printf( "pid: %d\n", com_pid.GetInteger() );
common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() );
#ifndef ID_DEDICATED
common->Printf( "%d MB Video Memory\n", Sys_GetVideoRam() );
#endif
}
/*

View file

@ -179,9 +179,6 @@ void Sys_FPU_SetDAZ( bool enable );
// returns amount of system ram
int Sys_GetSystemRam( void );
// returns amount of video ram
int Sys_GetVideoRam( void );
// returns amount of drive space in path
int Sys_GetDriveFreeSpace( const char *path );

View file

@ -526,7 +526,6 @@ void Sys_Init( void ) {
}
common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() );
common->Printf( "%d MB Video Memory\n", Sys_GetVideoRam() );
}
/*