add prefs: ForceMipMaps, AnisotropicFiltering
This commit is contained in:
@@ -226,7 +226,8 @@ void PrefsManager::Init()
|
||||
m_bHideDefaultNoteSkin = false;
|
||||
m_iMaxHighScoresPerList = 10;
|
||||
m_fPadStickSeconds = 0;
|
||||
m_bHalveTextureHeight = false;
|
||||
m_bForceMipMaps = false;
|
||||
m_bAnisotropicFiltering = false;
|
||||
g_bAutoRestart = false;
|
||||
m_bSignProfileData = false;
|
||||
|
||||
@@ -521,7 +522,8 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
|
||||
ini.GetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin );
|
||||
ini.GetValue( "Options", "MaxHighScoresPerList", m_iMaxHighScoresPerList );
|
||||
ini.GetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
|
||||
ini.GetValue( "Options", "HalveTextureHeight", m_bHalveTextureHeight );
|
||||
ini.GetValue( "Options", "ForceMipMaps", m_bForceMipMaps );
|
||||
ini.GetValue( "Options", "AnisotropicFiltering", m_bAnisotropicFiltering );
|
||||
ini.GetValue( "Options", "AutoRestart", g_bAutoRestart );
|
||||
ini.GetValue( "Options", "SignProfileData", m_bSignProfileData );
|
||||
|
||||
@@ -742,7 +744,8 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
||||
ini.SetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin );
|
||||
ini.SetValue( "Options", "MaxHighScoresPerList", m_iMaxHighScoresPerList );
|
||||
ini.SetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
|
||||
ini.SetValue( "Options", "HalveTextureHeight", m_bHalveTextureHeight );
|
||||
ini.SetValue( "Options", "ForceMipMaps", m_bForceMipMaps );
|
||||
ini.SetValue( "Options", "AnisotropicFiltering", m_bAnisotropicFiltering );
|
||||
ini.SetValue( "Options", "AutoRestart", g_bAutoRestart );
|
||||
ini.SetValue( "Options", "SignProfileData", m_bSignProfileData );
|
||||
|
||||
|
||||
@@ -201,10 +201,10 @@ public:
|
||||
// after pressed.
|
||||
float m_fPadStickSeconds;
|
||||
|
||||
// For 8:3 displays (640x240 arcade monitors), every odd line of texels
|
||||
// doesn't get drawn. This makes text look really ugly. So, squash all
|
||||
// textures to half height to match the aspect ratio of the display.
|
||||
bool m_bHalveTextureHeight;
|
||||
// Useful for non 4:3 displays and resolutions < 640x480 where texels don't
|
||||
// map directly to pixels.
|
||||
bool m_bForceMipMaps;
|
||||
bool m_bAnisotropicFiltering; // has no effect without mipmaps on
|
||||
|
||||
// If true, then signatures created when writing profile data
|
||||
// and verified when reading profile data. Leave this false if
|
||||
|
||||
@@ -119,6 +119,9 @@ void RageBitmapTexture::Create()
|
||||
if( actualID.iGrayscaleBits != -1 && img->format->BitsPerPixel == 8 )
|
||||
actualID.iGrayscaleBits = -1;
|
||||
|
||||
if( PREFSMAN->m_bForceMipMaps )
|
||||
actualID.bMipMaps = true;
|
||||
|
||||
/* Cap the max texture size to the hardware max. */
|
||||
actualID.iMaxSize = min( actualID.iMaxSize, DISPLAY->GetMaxTextureSize() );
|
||||
|
||||
@@ -130,9 +133,6 @@ void RageBitmapTexture::Create()
|
||||
m_iImageWidth = min( m_iSourceWidth, actualID.iMaxSize );
|
||||
m_iImageHeight = min( m_iSourceHeight, actualID.iMaxSize );
|
||||
|
||||
if( PREFSMAN->m_bHalveTextureHeight )
|
||||
m_iImageHeight /= 2;
|
||||
|
||||
/* Texture dimensions need to be a power of two; jump to the next. */
|
||||
m_iTextureWidth = power_of_two(m_iImageWidth);
|
||||
m_iTextureHeight = power_of_two(m_iImageHeight);
|
||||
|
||||
@@ -108,6 +108,7 @@ public:
|
||||
bool vsync_,
|
||||
bool interlaced_,
|
||||
bool bSmoothLines_,
|
||||
bool bAnisotropicFiltering_,
|
||||
CString sWindowTitle_,
|
||||
CString sIconFile_
|
||||
#ifdef _XBOX
|
||||
@@ -123,6 +124,7 @@ public:
|
||||
vsync = vsync_;
|
||||
interlaced = interlaced_;
|
||||
bSmoothLines = bSmoothLines_;
|
||||
bAnisotropicFiltering = bAnisotropicFiltering_;
|
||||
sWindowTitle = sWindowTitle_;
|
||||
sIconFile = sIconFile_;
|
||||
#ifdef _XBOX
|
||||
@@ -138,6 +140,7 @@ public:
|
||||
int rate;
|
||||
bool vsync;
|
||||
bool bSmoothLines;
|
||||
bool bAnisotropicFiltering;
|
||||
bool interlaced;
|
||||
#ifdef _XBOX
|
||||
bool PAL;
|
||||
|
||||
@@ -1678,6 +1678,15 @@ unsigned RageDisplay_OGL::CreateTexture(
|
||||
glBindTexture( GL_TEXTURE_2D, uTexHandle );
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, bGenerateMipMaps ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR);
|
||||
|
||||
if( wind->GetVideoModeParams().bAnisotropicFiltering &&
|
||||
HasExtension("GL_EXT_texture_filter_anisotropic") )
|
||||
{
|
||||
GLfloat largest_supported_anisotropy;
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy);
|
||||
}
|
||||
|
||||
SetTextureWrapping( false );
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, img->pitch / img->format->BytesPerPixel);
|
||||
|
||||
@@ -115,6 +115,7 @@ static RageDisplay::VideoModeParams GetCurVideoModeParams()
|
||||
PREFSMAN->m_bVsync,
|
||||
PREFSMAN->m_bInterlaced,
|
||||
PREFSMAN->m_bSmoothLines,
|
||||
PREFSMAN->m_bAnisotropicFiltering,
|
||||
THEME->GetMetric("Common","WindowTitle"),
|
||||
THEME->GetPathToG("Common window icon")
|
||||
#ifdef _XBOX
|
||||
|
||||
Reference in New Issue
Block a user