experimental 'HighResolutionTextures' pref to control behavior of doubleres textures

This commit is contained in:
Chris Danford
2009-04-04 20:34:57 +00:00
parent 008c4454ce
commit 6a07a691df
9 changed files with 119 additions and 22 deletions
@@ -335,6 +335,7 @@ LifeDifficulty=Increase this value to cause your life meter to drain faster and
LifeType=LifeType
Advanced Options=Change advanced options such as scoring, timing window, and life meter settings.
MasterVolume=
HighResolutionTextures=Choose whether high resolution textures will be loaded. High resolution textures will only work if supported by the current theme.
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.
MenuTimer=When &oq;OFF&cq;, the time limit in menus is disabled.
Mines=Mines
@@ -540,6 +541,8 @@ Flat=Flat
Flip=Flip
Floored=Floored
Free Play=Free Play
Force Off=Force Off
Force On=Force On
Full Screen=Full Screen
Global BGAnimation=Global BGAnimation
Global Movie=Global Movie
@@ -779,6 +782,7 @@ Hands=Hands
HiddenSongs=Hidden Songs
Hide=Hide
High Meter=High Meter
HighResolutionTextures=High Resolution Textures
Holds=Holds
Insert=Insert
Insert Credit=Insert Credit
@@ -796,6 +800,7 @@ Advanced Options=Advanced Options
Main title=Main title
Main title transliteration=Main title transliteration
MaxTextureResolution=Texture Resolution
HighResolutoinTextures=High Resolution Textures
MenuTimer=Menu Timer
Meter=Meter
Mines=Mines
+16 -15
View File
@@ -2743,25 +2743,26 @@ Line30="conf,FastLoad"
[ScreenOptionsGraphicsSound]
Fallback="ScreenOptionsServiceChild"
LineNames="1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18"
LineNames="1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19"
Line1="conf,Windowed"
Line2="conf,DisplayResolution"
Line3="conf,DisplayAspectRatio"
Line4="conf,DisplayColorDepth"
Line5="conf,MaxTextureResolution"
Line6="conf,TextureColorDepth"
Line7="conf,MovieColorDepth"
Line8="conf,SmoothLines"
Line9="conf,CelShadeModels"
Line10="conf,DelayedTextureDelete"
Line11="conf,RefreshRate"
Line12="conf,Vsync"
Line13="conf,ShowStats"
Line14="conf,ShowBanners"
Line15="conf,AttractSoundFrequency"
Line16="conf,SoundVolume"
Line17="conf,EnableAttackSounds"
Line18="conf,EnableMineHitSound"
Line5="conf,HighResolutionTextures"
Line6="conf,MaxTextureResolution"
Line7="conf,TextureColorDepth"
Line8="conf,MovieColorDepth"
Line9="conf,SmoothLines"
Line10="conf,CelShadeModels"
Line11="conf,DelayedTextureDelete"
Line12="conf,RefreshRate"
Line13="conf,Vsync"
Line14="conf,ShowStats"
Line15="conf,ShowBanners"
Line16="conf,AttractSoundFrequency"
Line17="conf,SoundVolume"
Line18="conf,EnableAttackSounds"
Line19="conf,EnableMineHitSound"
[ScreenAppearanceOptions]
Fallback="ScreenOptionsServiceChild"
+10
View File
@@ -83,6 +83,15 @@ XToString( BannerCacheMode );
StringToX( BannerCacheMode );
LuaXType( BannerCacheMode );
static const char *HighResolutionTexturesNames[] = {
"Auto",
"ForceOff",
"ForceOn",
};
XToString( HighResolutionTextures );
StringToX( HighResolutionTextures );
LuaXType( HighResolutionTextures );
static const char *AttractSoundFrequencyNames[] = {
"Never",
"EveryTime",
@@ -147,6 +156,7 @@ PrefsManager::PrefsManager() :
m_iDisplayColorDepth ( "DisplayColorDepth", 16 ),
m_iTextureColorDepth ( "TextureColorDepth", 16 ),
m_iMovieColorDepth ( "MovieColorDepth", 16 ),
m_HighResolutionTextures ( "HighResolutionTextures", HighResolutionTextures_Auto ),
m_iMaxTextureResolution ( "MaxTextureResolution", 2048 ),
m_iRefreshRate ( "RefreshRate", REFRESH_DEFAULT ),
m_bAllowMultitexture ( "AllowMultitexture", true ),
+41 -5
View File
@@ -9,11 +9,38 @@ class IniFile;
const int MAX_SONGS_PER_PLAY = 7;
enum MusicWheelUsesSections { MusicWheelUsesSections_NEVER, MusicWheelUsesSections_ALWAYS, MusicWheelUsesSections_ABC_ONLY, NUM_MusicWheelUsesSections, MusicWheelUsesSections_Invalid };
enum AllowW1 { ALLOW_W1_NEVER, ALLOW_W1_COURSES_ONLY, ALLOW_W1_EVERYWHERE, NUM_AllowW1, AllowW1_Invalid };
enum Maybe { Maybe_ASK, Maybe_NO, Maybe_YES, NUM_Maybe, Maybe_Invalid };
enum GetRankingName { RANKING_OFF, RANKING_ON, RANKING_LIST, NUM_GetRankingName, GetRankingName_Invalid };
enum MusicWheelUsesSections
{
MusicWheelUsesSections_NEVER,
MusicWheelUsesSections_ALWAYS,
MusicWheelUsesSections_ABC_ONLY,
NUM_MusicWheelUsesSections,
MusicWheelUsesSections_Invalid
};
enum AllowW1
{
ALLOW_W1_NEVER,
ALLOW_W1_COURSES_ONLY,
ALLOW_W1_EVERYWHERE,
NUM_AllowW1,
AllowW1_Invalid
};
enum Maybe
{
Maybe_ASK,
Maybe_NO,
Maybe_YES,
NUM_Maybe,
Maybe_Invalid
};
enum GetRankingName
{
RANKING_OFF,
RANKING_ON,
RANKING_LIST,
NUM_GetRankingName,
GetRankingName_Invalid
};
enum RandomBackgroundMode
{
BGMODE_OFF,
@@ -39,6 +66,14 @@ enum BannerCacheMode
NUM_BannerCacheMode,
BannerCacheMode_Invalid
};
enum HighResolutionTextures
{
HighResolutionTextures_Auto,
HighResolutionTextures_ForceOff,
HighResolutionTextures_ForceOn,
NUM_HighResolutionTextures,
HighResolutionTextures_Invalid,
};
enum AttractSoundFrequency
{
ASF_NEVER,
@@ -109,6 +144,7 @@ public:
Preference<int> m_iDisplayColorDepth;
Preference<int> m_iTextureColorDepth;
Preference<int> m_iMovieColorDepth;
Preference<HighResolutionTextures> m_HighResolutionTextures;
Preference<int> m_iMaxTextureResolution;
Preference<int> m_iRefreshRate;
Preference<bool> m_bAllowMultitexture;
+20 -2
View File
@@ -11,6 +11,7 @@
#include "RageSurfaceUtils_Dither.h"
#include "RageSurface_Load.h"
#include "arch/Dialog/Dialog.h"
#include "StepMania.h"
static void GetResolutionFromFileName( RString sPath, int &iWidth, int &iHeight )
{
@@ -122,9 +123,23 @@ void RageBitmapTexture::Create()
m_iSourceWidth = pImg->w;
m_iSourceHeight = pImg->h;
/* in-game imsage dimensions are the same as the source graphic */
m_iImageWidth = m_iSourceWidth;
m_iImageHeight = m_iSourceHeight;
/* if "doubleres" (high resolution) and we're not allowing high res textures, then image dimensions are half of the source */
if( sHintString.find("doubleres") != string::npos )
{
if( !StepMania::GetHighResolutionTextures() )
{
m_iImageWidth = m_iImageWidth / 2;
m_iImageHeight = m_iImageHeight / 2;
}
}
/* image size cannot exceed max size */
m_iImageWidth = min( m_iSourceWidth, actualID.iMaxSize );
m_iImageHeight = min( m_iSourceHeight, actualID.iMaxSize );
m_iImageWidth = min( m_iImageWidth, actualID.iMaxSize );
m_iImageHeight = min( m_iImageHeight, actualID.iMaxSize );
/* Texture dimensions need to be a power of two; jump to the next. */
m_iTextureWidth = power_of_two(m_iImageWidth);
@@ -293,6 +308,9 @@ void RageBitmapTexture::Create()
/* Check for hints that override the apparent "size". */
GetResolutionFromFileName( actualID.filename, m_iSourceWidth, m_iSourceHeight );
/* if "doubleres" (high resolution) then we want the image to appear in-game with dimensions 1/2 of the source.
* So, cut down the source dimension here after everythign above is finished operating with the real image
* source dimensions. */
if( sHintString.find("doubleres") != string::npos )
{
m_iSourceWidth = m_iSourceWidth / 2;
+5
View File
@@ -11,6 +11,7 @@ struct RageTextureManagerPrefs
int m_iMovieColorDepth;
bool m_bDelayedDelete;
int m_iMaxTextureResolution;
bool m_bHighResolutionTextures;
bool m_bMipMaps;
RageTextureManagerPrefs()
@@ -19,6 +20,7 @@ struct RageTextureManagerPrefs
m_iMovieColorDepth = 16;
m_iTextureColorDepth = 16;
m_iMaxTextureResolution = 1024;
m_bHighResolutionTextures = true;
m_bMipMaps = false;
}
RageTextureManagerPrefs(
@@ -26,12 +28,14 @@ struct RageTextureManagerPrefs
int iMovieColorDepth,
bool bDelayedDelete,
int iMaxTextureResolution,
bool bHighResolutionTextures,
bool bMipMaps )
{
m_bDelayedDelete = bDelayedDelete;
m_iMovieColorDepth = iMovieColorDepth;
m_iTextureColorDepth = iTextureColorDepth;
m_iMaxTextureResolution = iMaxTextureResolution;
m_bHighResolutionTextures = bHighResolutionTextures;
m_bMipMaps = bMipMaps;
}
@@ -42,6 +46,7 @@ struct RageTextureManagerPrefs
m_iMovieColorDepth != rhs.m_iMovieColorDepth ||
m_bDelayedDelete != rhs.m_bDelayedDelete ||
m_iMaxTextureResolution != rhs.m_iMaxTextureResolution ||
m_bHighResolutionTextures != rhs.m_bHighResolutionTextures ||
m_bMipMaps != rhs.m_bMipMaps;
}
};
@@ -710,6 +710,8 @@ static void InitializeConfOptions()
g_ConfOptions.back().m_iEffects = OPT_APPLY_ASPECT_RATIO;
ADD( ConfOption( "DisplayColorDepth", DisplayColorDepth, "16bit","32bit" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "HighResolutionTextures", MovePref<HighResolutionTextures>, "Auto","Force Off","Force On" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "MaxTextureResolution", MaxTextureResolution, "|256","|512","|1024","|2048" ) );
g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS;
ADD( ConfOption( "TextureColorDepth", TextureColorDepth, "16bit","32bit" ) );
+19
View File
@@ -146,6 +146,23 @@ static void StoreActualGraphicOptions()
static RageDisplay *CreateDisplay();
bool StepMania::GetHighResolutionTextures()
{
switch( PREFSMAN->m_HighResolutionTextures )
{
default:
case HighResolutionTextures_Auto:
{
const VideoModeParams &params = DISPLAY->GetActualVideoModeParams();
return params.height > 800;
}
case HighResolutionTextures_ForceOn:
return true;
case HighResolutionTextures_ForceOff:
return false;
}
}
static void StartDisplay()
{
if( DISPLAY != NULL )
@@ -167,6 +184,7 @@ static void StartDisplay()
PREFSMAN->m_iMovieColorDepth,
PREFSMAN->m_bDelayedTextureDelete,
PREFSMAN->m_iMaxTextureResolution,
StepMania::GetHighResolutionTextures(),
PREFSMAN->m_bForceMipMaps
)
);
@@ -201,6 +219,7 @@ void StepMania::ApplyGraphicOptions()
PREFSMAN->m_iMovieColorDepth,
PREFSMAN->m_bDelayedTextureDelete,
PREFSMAN->m_iMaxTextureResolution,
StepMania::GetHighResolutionTextures(),
PREFSMAN->m_bForceMipMaps
)
);
+1
View File
@@ -23,6 +23,7 @@ namespace StepMania
void ClearCredits();
void GetPreferredVideoModeParams( VideoModeParams &paramsOut );
bool GetHighResolutionTextures();
}
#endif