Added MaxTextureResolution pref

This commit is contained in:
Chris Danford
2003-01-11 20:15:00 +00:00
parent 88840d9020
commit bf5c821afe
7 changed files with 38 additions and 10 deletions
+1 -1
View File
@@ -707,7 +707,7 @@ DisplayMode=Chose whether you would like StepMania to run full screen,::or to di
DisplayColor=Chose the color depth of the StepMania window.::This option may not take effect in windowed mode.
TextureColor=Chose the color depth of textures.::32 bit texture use more memory, but look nicer.
DisplayResolution=Choose the output resolution. A higher resolution::will show more detail, but requires a faster video card.
TextureResolution=Choose the maximum texture resolution. Setting this::to anything below 1024 will cause some textures to appear blurry,::but may increase your frame rate.
MaxTextureResolution=Choose the maximum texture resolution. Setting this::to anything below 1024 will cause some textures to appear blurry,::but may increase your frame rate.
RefreshRate=Controls how many times per second the screen will refresh.::This setting only has an effect when the Display Mode::is set to "full screen".
BackgroundMode=Chose what type of backgrounds you would like displayed.::"Animations" uses any random items in the BGAnimations folder.::"Visualizations" chooses a random overlay movie from the Visualization folder.::"Random Movies" cycles through movies in the RandomMovies folder.
BackgroundBrightness=Controls how bright the background will appear.::Turn this setting down if you have a hard time seeing the notes.
+3
View File
@@ -37,6 +37,7 @@ PrefsManager::PrefsManager()
m_iDisplayHeight = 480;
m_iDisplayColorDepth = 16;
m_iTextureColorDepth = 32;
m_iMaxTextureResolution = 2048;
m_iRefreshRate = REFRESH_DEFAULT;
m_bIgnoreJoyAxes = true;
m_bOnlyDedicatedMenuButtons = false;
@@ -100,6 +101,7 @@ PrefsManager::~PrefsManager()
ini.GetValueI( "Options", "DisplayHeight", m_iDisplayHeight );
ini.GetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth );
ini.GetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth );
ini.GetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution );
ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate );
ini.GetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
ini.GetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons );
@@ -159,6 +161,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.SetValueI( "Options", "DisplayHeight", m_iDisplayHeight );
ini.SetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth );
ini.SetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth );
ini.SetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution );
ini.SetValueI( "Options", "RefreshRate", m_iRefreshRate );
ini.SetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes );
ini.SetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons );
+1
View File
@@ -26,6 +26,7 @@ public:
int m_iDisplayHeight;
int m_iDisplayColorDepth;
int m_iTextureColorDepth;
int m_iMaxTextureResolution;
int m_iRefreshRate;
bool m_bShowStats;
BackgroundMode m_BackgroundMode;
+11 -5
View File
@@ -27,9 +27,9 @@ RageTextureManager* TEXTUREMAN = NULL;
//-----------------------------------------------------------------------------
// constructor/destructor
//-----------------------------------------------------------------------------
RageTextureManager::RageTextureManager( int iTextureColorDepth, int iSecondsBeforeUnload )
RageTextureManager::RageTextureManager( int iTextureColorDepth, int iSecondsBeforeUnload, int iMaxTextureResolution )
{
SetPrefs( iTextureColorDepth, iSecondsBeforeUnload );
SetPrefs( iTextureColorDepth, iSecondsBeforeUnload, iMaxTextureResolution );
}
RageTextureManager::~RageTextureManager()
@@ -87,7 +87,10 @@ RageTexture* RageTextureManager::LoadTexture( RageTextureID ID )
p++;
}
// the texture is not already loaded
// the texture is not already loaded. Load it.
ID.iColorDepth = TEXTUREMAN->GetTextureColorDepth();
ID.iMaxSize = TEXTUREMAN->GetMaxTextureResolution();
CString sDrive, sDir, sFName, sExt;
splitpath( false, ID.filename, sDrive, sDir, sFName, sExt );
@@ -212,6 +215,7 @@ void RageTextureManager::ReloadAll()
/* Update the settings that are based on preferences. */
RageTextureID ID = i->first;
ID.iColorDepth = TEXTUREMAN->GetTextureColorDepth();
ID.iMaxSize = TEXTUREMAN->GetMaxTextureResolution();
pTexture->Reload( ID );
}
@@ -233,15 +237,17 @@ void RageTextureManager::InvalidateTextures()
}
}
bool RageTextureManager::SetPrefs( int iTextureColorDepth, int iSecondsBeforeUnload )
bool RageTextureManager::SetPrefs( int iTextureColorDepth, int iSecondsBeforeUnload, int iMaxTextureResolution )
{
bool need_reload = false;
if(m_iSecondsBeforeUnload != iSecondsBeforeUnload ||
m_iTextureColorDepth != iTextureColorDepth)
m_iTextureColorDepth != iTextureColorDepth ||
m_iMaxTextureResolution != iMaxTextureResolution )
need_reload = true;
m_iSecondsBeforeUnload = iSecondsBeforeUnload;
m_iTextureColorDepth = iTextureColorDepth;
m_iMaxTextureResolution = iMaxTextureResolution;
ASSERT( m_iTextureColorDepth==16 || m_iTextureColorDepth==32 );
return need_reload;
+4 -2
View File
@@ -21,7 +21,7 @@
class RageTextureManager
{
public:
RageTextureManager( int iTextureColorDepth, int iSecsBeforeUnload );
RageTextureManager( int iTextureColorDepth, int iSecsBeforeUnload, int iMaxTextureResolution );
virtual void Update( float fDeltaTime );
~RageTextureManager();
@@ -31,8 +31,9 @@ public:
void UnloadTexture( RageTexture *t );
void ReloadAll();
bool SetPrefs( int iTextureColorDepth, int iSecsBeforeUnload );
bool SetPrefs( int iTextureColorDepth, int iSecsBeforeUnload, int iMaxTextureResolution );
int GetTextureColorDepth() { return m_iTextureColorDepth; };
int GetMaxTextureResolution() { return m_iMaxTextureResolution; };
int GetSecsBeforeUnload() { return m_iSecondsBeforeUnload; };
void InvalidateTextures();
@@ -42,6 +43,7 @@ protected:
int m_iTextureColorDepth;
int m_iSecondsBeforeUnload;
int m_iMaxTextureResolution;
std::map<RageTextureID, RageTexture*> m_mapPathToTexture;
};
+16
View File
@@ -27,6 +27,7 @@ enum {
GO_WINDOWED = 0,
GO_DISPLAY_RESOLUTION,
GO_DISPLAY_COLOR_DEPTH,
GO_MAX_TEXTURE_RESOLUTION,
GO_TEXTURE_COLOR_DEPTH,
GO_REFRESH_RATE,
GO_BGMODE,
@@ -40,6 +41,7 @@ OptionRowData g_GraphicOptionsLines[NUM_GRAPHIC_OPTIONS_LINES] = {
{ "Display\nMode", 2, {"FULLSCREEN", "WINDOWED"} },
{ "Display\nResolution", 7, {"320","400","512","640","800","1024","1280"} },
{ "Display\nColor", 2, {"16BIT","32BIT"} },
{ "Max Texture\nResolution",4, {"256","512","1024","2048"} },
{ "Texture\nColor", 2, {"16BIT","32BIT"} },
{ "Refresh\nRate", 11, {"DEFAULT","60","70","72","75","80","85","90","100","120","150"} },
{ "Background\nMode", 4, {"OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES"} },
@@ -55,6 +57,9 @@ static const int HorizRes[] = {
static const int VertRes[] = {
240, 300, 384, 480, 600, 768, 1024
};
static const int TextureRes[] = {
256, 512, 1024, 2048
};
ScreenGraphicOptions::ScreenGraphicOptions() :
ScreenOptions(
@@ -124,6 +129,15 @@ void ScreenGraphicOptions::ImportOptions()
case 32: m_iSelectedOption[0][GO_DISPLAY_COLOR_DEPTH] = 1; break;
}
switch( PREFSMAN->m_iMaxTextureResolution )
{
case 256: m_iSelectedOption[0][GO_MAX_TEXTURE_RESOLUTION] = 0; break;
case 512: m_iSelectedOption[0][GO_MAX_TEXTURE_RESOLUTION] = 1; break;
case 1024: m_iSelectedOption[0][GO_MAX_TEXTURE_RESOLUTION] = 2; break;
case 2048: m_iSelectedOption[0][GO_MAX_TEXTURE_RESOLUTION] = 3; break;
default: m_iSelectedOption[0][GO_MAX_TEXTURE_RESOLUTION] = 3; break;
}
switch( PREFSMAN->m_iTextureColorDepth )
{
case 16: m_iSelectedOption[0][GO_TEXTURE_COLOR_DEPTH] = 0; break;
@@ -166,6 +180,8 @@ void ScreenGraphicOptions::ExportOptions()
default: ASSERT(0); PREFSMAN->m_iDisplayColorDepth = 16; break;
}
PREFSMAN->m_iMaxTextureResolution = TextureRes[m_iSelectedOption[0][GO_MAX_TEXTURE_RESOLUTION]];
switch( m_iSelectedOption[0][GO_TEXTURE_COLOR_DEPTH] )
{
case 0: PREFSMAN->m_iTextureColorDepth = 16; break;
+2 -2
View File
@@ -101,7 +101,7 @@ void ApplyGraphicOptions()
PREFSMAN->m_iRefreshRate,
PREFSMAN->m_bVsync );
if(TEXTUREMAN->SetPrefs( PREFSMAN->m_iTextureColorDepth, PREFSMAN->m_iUnloadTextureDelaySeconds ))
if(TEXTUREMAN->SetPrefs( PREFSMAN->m_iTextureColorDepth, PREFSMAN->m_iUnloadTextureDelaySeconds, PREFSMAN->m_iMaxTextureResolution ))
ReloadTextures = true;
if(ReloadTextures)
@@ -235,7 +235,7 @@ int main(int argc, char* argv[])
PREFSMAN->m_iDisplayColorDepth,
PREFSMAN->m_iRefreshRate,
PREFSMAN->m_bVsync );
TEXTUREMAN = new RageTextureManager( PREFSMAN->m_iTextureColorDepth, PREFSMAN->m_iUnloadTextureDelaySeconds );
TEXTUREMAN = new RageTextureManager( PREFSMAN->m_iTextureColorDepth, PREFSMAN->m_iUnloadTextureDelaySeconds, PREFSMAN->m_iMaxTextureResolution );
/* Grab the window manager specific information */
SDL_SysWMinfo info;