Split CachedThemeMetric into separate types (CString, int, float) to prevent ambiguous types when casting

This commit is contained in:
Chris Danford
2003-03-26 19:15:38 +00:00
parent 57aefba669
commit 7e1f393413
11 changed files with 92 additions and 67 deletions
+14 -14
View File
@@ -14,20 +14,20 @@
#include "ThemeManager.h" #include "ThemeManager.h"
CachedThemeMetric LABEL_X ("Combo","LabelX"); CachedThemeMetricF LABEL_X ("Combo","LabelX");
CachedThemeMetric LABEL_Y ("Combo","LabelY"); CachedThemeMetricF LABEL_Y ("Combo","LabelY");
CachedThemeMetric LABEL_HORIZ_ALIGN ("Combo","LabelHorizAlign"); CachedThemeMetricI LABEL_HORIZ_ALIGN ("Combo","LabelHorizAlign");
CachedThemeMetric LABEL_VERT_ALIGN ("Combo","LabelVertAlign"); CachedThemeMetricI LABEL_VERT_ALIGN ("Combo","LabelVertAlign");
CachedThemeMetric NUMBER_X ("Combo","NumberX"); CachedThemeMetricF NUMBER_X ("Combo","NumberX");
CachedThemeMetric NUMBER_Y ("Combo","NumberY"); CachedThemeMetricF NUMBER_Y ("Combo","NumberY");
CachedThemeMetric NUMBER_HORIZ_ALIGN ("Combo","NumberHorizAlign"); CachedThemeMetricI NUMBER_HORIZ_ALIGN ("Combo","NumberHorizAlign");
CachedThemeMetric NUMBER_VERT_ALIGN ("Combo","NumberVertAlign"); CachedThemeMetricI NUMBER_VERT_ALIGN ("Combo","NumberVertAlign");
CachedThemeMetric SHOW_COMBO_AT ("Combo","ShowComboAt"); CachedThemeMetricI SHOW_COMBO_AT ("Combo","ShowComboAt");
CachedThemeMetric NUMBER_MIN_ZOOM ("Combo","NumberMinZoom"); CachedThemeMetricF NUMBER_MIN_ZOOM ("Combo","NumberMinZoom");
CachedThemeMetric NUMBER_MAX_ZOOM ("Combo","NumberMaxZoom"); CachedThemeMetricF NUMBER_MAX_ZOOM ("Combo","NumberMaxZoom");
CachedThemeMetric NUMBER_MAX_ZOOM_AT ("Combo","NumberMaxZoomAt"); CachedThemeMetricF NUMBER_MAX_ZOOM_AT ("Combo","NumberMaxZoomAt");
CachedThemeMetric PULSE_ZOOM ("Combo","PulseZoom"); CachedThemeMetricF PULSE_ZOOM ("Combo","PulseZoom");
CachedThemeMetric C_TWEEN_SECONDS ("Combo","TweenSeconds"); CachedThemeMetricF C_TWEEN_SECONDS ("Combo","TweenSeconds");
Combo::Combo() Combo::Combo()
+9 -9
View File
@@ -16,14 +16,14 @@
#include "ThemeManager.h" #include "ThemeManager.h"
CachedThemeMetric GA_SHOW_SECONDS ("GhostArrow","ShowSeconds"); CachedThemeMetricF GA_SHOW_SECONDS ("GhostArrow","ShowSeconds");
CachedThemeMetric GA_ZOOM_START ("GhostArrow","ZoomStart"); CachedThemeMetricF GA_ZOOM_START ("GhostArrow","ZoomStart");
CachedThemeMetric GA_ZOOM_END ("GhostArrow","ZoomEnd"); CachedThemeMetricF GA_ZOOM_END ("GhostArrow","ZoomEnd");
CachedThemeMetric GA_COLOR_MARVELOUS ("GhostArrow","ColorMarvelous"); CachedThemeMetricC GA_COLOR_MARVELOUS ("GhostArrow","ColorMarvelous");
CachedThemeMetric GA_COLOR_PERFECT ("GhostArrow","ColorPerfect"); CachedThemeMetricC GA_COLOR_PERFECT ("GhostArrow","ColorPerfect");
CachedThemeMetric GA_COLOR_GREAT ("GhostArrow","ColorGreat"); CachedThemeMetricC GA_COLOR_GREAT ("GhostArrow","ColorGreat");
CachedThemeMetric GA_COLOR_GOOD ("GhostArrow","ColorGood"); CachedThemeMetricC GA_COLOR_GOOD ("GhostArrow","ColorGood");
CachedThemeMetric GA_COLOR_BOO ("GhostArrow","ColorBoo"); CachedThemeMetricC GA_COLOR_BOO ("GhostArrow","ColorBoo");
GhostArrow::GhostArrow() GhostArrow::GhostArrow()
@@ -50,7 +50,7 @@ void GhostArrow::Step( TapNoteScore score )
// HACK: set the length of each frame so the animation plays in exactly 1 pop up time. // HACK: set the length of each frame so the animation plays in exactly 1 pop up time.
// We can't do this in the constructor because the image hasn't been loaded yet // We can't do this in the constructor because the image hasn't been loaded yet
for( int i=0; i<Sprite::GetNumStates(); i++ ) for( int i=0; i<Sprite::GetNumStates(); i++ )
Sprite::m_fDelay[i] = (float)GA_SHOW_SECONDS / (float)Sprite::GetNumStates(); Sprite::m_fDelay[i] = GA_SHOW_SECONDS / Sprite::GetNumStates();
RageColor colorStart; RageColor colorStart;
switch( score ) switch( score )
+9 -9
View File
@@ -16,14 +16,14 @@
#include "ThemeManager.h" #include "ThemeManager.h"
CachedThemeMetric GAB_SHOW_SECONDS ("GhostArrowBright","ShowSeconds"); CachedThemeMetricF GAB_SHOW_SECONDS ("GhostArrowBright","ShowSeconds");
CachedThemeMetric GAB_ZOOM_START ("GhostArrowBright","ZoomStart"); CachedThemeMetricF GAB_ZOOM_START ("GhostArrowBright","ZoomStart");
CachedThemeMetric GAB_ZOOM_END ("GhostArrowBright","ZoomEnd"); CachedThemeMetricF GAB_ZOOM_END ("GhostArrowBright","ZoomEnd");
CachedThemeMetric GAB_COLOR_MARVELOUS ("GhostArrowBright","ColorMarvelous"); CachedThemeMetricC GAB_COLOR_MARVELOUS ("GhostArrowBright","ColorMarvelous");
CachedThemeMetric GAB_COLOR_PERFECT ("GhostArrowBright","ColorPerfect"); CachedThemeMetricC GAB_COLOR_PERFECT ("GhostArrowBright","ColorPerfect");
CachedThemeMetric GAB_COLOR_GREAT ("GhostArrowBright","ColorGreat"); CachedThemeMetricC GAB_COLOR_GREAT ("GhostArrowBright","ColorGreat");
CachedThemeMetric GAB_COLOR_GOOD ("GhostArrowBright","ColorGood"); CachedThemeMetricC GAB_COLOR_GOOD ("GhostArrowBright","ColorGood");
CachedThemeMetric GAB_COLOR_BOO ("GhostArrowBright","ColorBoo"); CachedThemeMetricC GAB_COLOR_BOO ("GhostArrowBright","ColorBoo");
GhostArrowBright::GhostArrowBright() GhostArrowBright::GhostArrowBright()
@@ -50,7 +50,7 @@ void GhostArrowBright::Step( TapNoteScore score )
// HACK: set the length of each frame so the animation plays in exactly 1 pop up time. // HACK: set the length of each frame so the animation plays in exactly 1 pop up time.
// We can't do this in the constructor because the image hasn't been loaded yet // We can't do this in the constructor because the image hasn't been loaded yet
for( int i=0; i<Sprite::GetNumStates(); i++ ) for( int i=0; i<Sprite::GetNumStates(); i++ )
Sprite::m_fDelay[i] = (float)GAB_SHOW_SECONDS / (float)Sprite::GetNumStates(); Sprite::m_fDelay[i] = GAB_SHOW_SECONDS / Sprite::GetNumStates();
RageColor colorStart; RageColor colorStart;
switch( score ) switch( score )
+2 -2
View File
@@ -19,8 +19,8 @@
#include "RageLog.h" #include "RageLog.h"
CachedThemeMetric GR_STEP_SECONDS ("GrayArrow","StepSeconds"); CachedThemeMetricF GR_STEP_SECONDS ("GrayArrow","StepSeconds");
CachedThemeMetric GR_STEP_ZOOM ("GrayArrow","StepZoom"); CachedThemeMetricF GR_STEP_ZOOM ("GrayArrow","StepZoom");
GrayArrow::GrayArrow() GrayArrow::GrayArrow()
+1 -1
View File
@@ -19,7 +19,7 @@
#include "ThemeManager.h" #include "ThemeManager.h"
CachedThemeMetric WARM_UP_SECONDS ("HoldGhostArrow","WarmUpSeconds"); CachedThemeMetricF WARM_UP_SECONDS ("HoldGhostArrow","WarmUpSeconds");
HoldGhostArrow::HoldGhostArrow() HoldGhostArrow::HoldGhostArrow()
+22 -24
View File
@@ -26,7 +26,7 @@
#include "ThemeManager.h" #include "ThemeManager.h"
// MusicWheel stuff #define NUM_WHEEL_ITEMS min( MAX_WHEEL_ITEMS, THEME->GetMetricI("MusicWheel","NumWheelItems") )
#define FADE_SECONDS THEME->GetMetricF("MusicWheel","FadeSeconds") #define FADE_SECONDS THEME->GetMetricF("MusicWheel","FadeSeconds")
#define SWITCH_SECONDS THEME->GetMetricF("MusicWheel","SwitchSeconds") #define SWITCH_SECONDS THEME->GetMetricF("MusicWheel","SwitchSeconds")
#define ROULETTE_SWITCH_SECONDS THEME->GetMetricF("MusicWheel","RouletteSwitchSeconds") #define ROULETTE_SWITCH_SECONDS THEME->GetMetricF("MusicWheel","RouletteSwitchSeconds")
@@ -34,8 +34,8 @@
#define LOCKED_INITIAL_VELOCITY THEME->GetMetricF("MusicWheel","LockedInitialVelocity") #define LOCKED_INITIAL_VELOCITY THEME->GetMetricF("MusicWheel","LockedInitialVelocity")
#define SCROLL_BAR_X THEME->GetMetricF("MusicWheel","ScrollBarX") #define SCROLL_BAR_X THEME->GetMetricF("MusicWheel","ScrollBarX")
#define SCROLL_BAR_HEIGHT THEME->GetMetricI("MusicWheel","ScrollBarHeight") #define SCROLL_BAR_HEIGHT THEME->GetMetricI("MusicWheel","ScrollBarHeight")
#define ITEM_CURVE_X THEME->GetMetricF("MusicWheel","ItemCurveX") CachedThemeMetricF ITEM_CURVE_X ("MusicWheel","ItemCurveX");
#define ITEM_SPACING_Y THEME->GetMetricF("MusicWheel","ItemSpacingY") CachedThemeMetricF ITEM_SPACING_Y ("MusicWheel","ItemSpacingY");
#define NUM_SECTION_COLORS THEME->GetMetricI("MusicWheel","NumSectionColors") #define NUM_SECTION_COLORS THEME->GetMetricI("MusicWheel","NumSectionColors")
#define SECTION_COLORS( i ) THEME->GetMetricC("MusicWheel",ssprintf("SectionColor%d",i+1)) #define SECTION_COLORS( i ) THEME->GetMetricC("MusicWheel",ssprintf("SectionColor%d",i+1))
#define DEFAULT_SCROLL_DIRECTION THEME->GetMetricI("Notes","DefaultScrollDirection") #define DEFAULT_SCROLL_DIRECTION THEME->GetMetricI("Notes","DefaultScrollDirection")
@@ -45,7 +45,6 @@
const int MAX_WHEEL_SOUND_SPEED = 15; const int MAX_WHEEL_SOUND_SPEED = 15;
float g_fItemSpacingY, g_fItemCurveX; // cache
static const SongSortOrder MaxSelectableSort = SORT_MOST_PLAYED; static const SongSortOrder MaxSelectableSort = SORT_MOST_PLAYED;
@@ -70,10 +69,9 @@ MusicWheel::MusicWheel()
GAMESTATE->m_PlayerOptions[i].m_fReverseScroll = 1; GAMESTATE->m_PlayerOptions[i].m_fReverseScroll = 1;
} }
// update theme metric cache // update theme metric cache
g_fItemSpacingY = ITEM_SPACING_Y; ITEM_CURVE_X.Refresh();
g_fItemCurveX = ITEM_CURVE_X; ITEM_SPACING_Y.Refresh();
// for debugging // for debugging
if( GAMESTATE->m_CurStyle == STYLE_INVALID ) if( GAMESTATE->m_CurStyle == STYLE_INVALID )
@@ -510,12 +508,12 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
float MusicWheel::GetBannerY( float fPosOffsetsFromMiddle ) float MusicWheel::GetBannerY( float fPosOffsetsFromMiddle )
{ {
return roundf( fPosOffsetsFromMiddle*g_fItemSpacingY ); return roundf( fPosOffsetsFromMiddle*ITEM_SPACING_Y );
} }
float MusicWheel::GetBannerX( float fPosOffsetsFromMiddle ) float MusicWheel::GetBannerX( float fPosOffsetsFromMiddle )
{ {
float fX = (1-cosf(fPosOffsetsFromMiddle/PI))*g_fItemCurveX; float fX = (1-cosf(fPosOffsetsFromMiddle/PI))*ITEM_CURVE_X;
return roundf( fX ); return roundf( fX );
} }
@@ -527,14 +525,14 @@ void MusicWheel::RebuildWheelItemDisplays()
if( m_iSelection > int(m_CurWheelItemData.size()-1) ) if( m_iSelection > int(m_CurWheelItemData.size()-1) )
m_iSelection = 0; m_iSelection = 0;
iIndex -= NUM_WHEEL_ITEMS_TO_DRAW/2; iIndex -= NUM_WHEEL_ITEMS/2;
ASSERT(m_CurWheelItemData.size()); ASSERT(m_CurWheelItemData.size());
while(iIndex < 0) while(iIndex < 0)
iIndex += m_CurWheelItemData.size(); iIndex += m_CurWheelItemData.size();
// iIndex is now the index of the lowest WheelItem to draw // iIndex is now the index of the lowest WheelItem to draw
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ ) for( int i=0; i<NUM_WHEEL_ITEMS; i++ )
{ {
WheelItemData *data = m_CurWheelItemData[iIndex]; WheelItemData *data = m_CurWheelItemData[iIndex];
WheelItemDisplay& display = m_WheelItemDisplays[i]; WheelItemDisplay& display = m_WheelItemDisplays[i];
@@ -551,7 +549,7 @@ void MusicWheel::RebuildWheelItemDisplays()
void MusicWheel::NotesChanged( PlayerNumber pn ) // update grade graphics and top score void MusicWheel::NotesChanged( PlayerNumber pn ) // update grade graphics and top score
{ {
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ ) for( int i=0; i<NUM_WHEEL_ITEMS; i++ )
{ {
WheelItemDisplay& display = m_WheelItemDisplays[i]; WheelItemDisplay& display = m_WheelItemDisplays[i];
display.RefreshGrades(); display.RefreshGrades();
@@ -562,7 +560,7 @@ void MusicWheel::NotesChanged( PlayerNumber pn ) // update grade graphics and to
void MusicWheel::DrawPrimitives() void MusicWheel::DrawPrimitives()
{ {
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ ) for( int i=0; i<NUM_WHEEL_ITEMS; i++ )
{ {
WheelItemDisplay& display = m_WheelItemDisplays[i]; WheelItemDisplay& display = m_WheelItemDisplays[i];
@@ -574,7 +572,7 @@ void MusicWheel::DrawPrimitives()
case STATE_RANDOM_SPINNING: case STATE_RANDOM_SPINNING:
case STATE_LOCKED: case STATE_LOCKED:
{ {
float fThisBannerPositionOffsetFromSelection = i - NUM_WHEEL_ITEMS_TO_DRAW/2 + m_fPositionOffsetFromSelection; float fThisBannerPositionOffsetFromSelection = i - NUM_WHEEL_ITEMS/2 + m_fPositionOffsetFromSelection;
float fY = GetBannerY( fThisBannerPositionOffsetFromSelection ); float fY = GetBannerY( fThisBannerPositionOffsetFromSelection );
if( fY < -SCREEN_HEIGHT/2 || fY > SCREEN_HEIGHT/2 ) if( fY < -SCREEN_HEIGHT/2 || fY > SCREEN_HEIGHT/2 )
@@ -586,7 +584,7 @@ void MusicWheel::DrawPrimitives()
break; break;
} }
if( m_WheelState == STATE_LOCKED && i != NUM_WHEEL_ITEMS_TO_DRAW/2 ) if( m_WheelState == STATE_LOCKED && i != NUM_WHEEL_ITEMS/2 )
display.m_fPercentGray = 0.5f; display.m_fPercentGray = 0.5f;
else else
display.m_fPercentGray = 0; display.m_fPercentGray = 0;
@@ -602,10 +600,10 @@ void MusicWheel::UpdateScrollbar()
int total_num_items = m_CurWheelItemData.size(); int total_num_items = m_CurWheelItemData.size();
float item_at=m_iSelection - m_fPositionOffsetFromSelection; float item_at=m_iSelection - m_fPositionOffsetFromSelection;
if(NUM_WHEEL_ITEMS_TO_DRAW > total_num_items) { if(NUM_WHEEL_ITEMS > total_num_items) {
m_ScrollBar.SetPercentage( 0, 1 ); m_ScrollBar.SetPercentage( 0, 1 );
} else { } else {
float size = float(NUM_WHEEL_ITEMS_TO_DRAW) / total_num_items; float size = float(NUM_WHEEL_ITEMS) / total_num_items;
float center = item_at / total_num_items; float center = item_at / total_num_items;
size *= 0.5f; size *= 0.5f;
@@ -618,7 +616,7 @@ void MusicWheel::Update( float fDeltaTime )
ActorFrame::Update( fDeltaTime ); ActorFrame::Update( fDeltaTime );
unsigned i; unsigned i;
for( i=0; i<int(NUM_WHEEL_ITEMS_TO_DRAW); i++ ) for( i=0; i<int(NUM_WHEEL_ITEMS); i++ )
{ {
WheelItemDisplay& display = m_WheelItemDisplays[i]; WheelItemDisplay& display = m_WheelItemDisplays[i];
@@ -1052,7 +1050,7 @@ void MusicWheel::TweenOnScreen(bool changing_sort)
m_sprSelectionOverlay.SetXY( fX+320, fY ); m_sprSelectionOverlay.SetXY( fX+320, fY );
if(changing_sort) { if(changing_sort) {
m_sprSelectionOverlay.BeginTweening( 0.04f * NUM_WHEEL_ITEMS_TO_DRAW/2 * factor ); // sleep m_sprSelectionOverlay.BeginTweening( 0.04f * NUM_WHEEL_ITEMS/2 * factor ); // sleep
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE ); m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE );
} else { } else {
m_sprSelectionOverlay.BeginTweening( 0.05f * factor ); // sleep m_sprSelectionOverlay.BeginTweening( 0.05f * factor ); // sleep
@@ -1068,10 +1066,10 @@ void MusicWheel::TweenOnScreen(bool changing_sort)
m_ScrollBar.BeginTweening( 0.2f * factor , Actor::TWEEN_ACCELERATE ); m_ScrollBar.BeginTweening( 0.2f * factor , Actor::TWEEN_ACCELERATE );
m_ScrollBar.SetTweenX( SCROLL_BAR_X ); m_ScrollBar.SetTweenX( SCROLL_BAR_X );
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ ) for( int i=0; i<NUM_WHEEL_ITEMS; i++ )
{ {
WheelItemDisplay& display = m_WheelItemDisplays[i]; WheelItemDisplay& display = m_WheelItemDisplays[i];
float fThisBannerPositionOffsetFromSelection = i - NUM_WHEEL_ITEMS_TO_DRAW/2 + m_fPositionOffsetFromSelection; float fThisBannerPositionOffsetFromSelection = i - NUM_WHEEL_ITEMS/2 + m_fPositionOffsetFromSelection;
float fX = GetBannerX(fThisBannerPositionOffsetFromSelection); float fX = GetBannerX(fThisBannerPositionOffsetFromSelection);
float fY = GetBannerY(fThisBannerPositionOffsetFromSelection); float fY = GetBannerY(fThisBannerPositionOffsetFromSelection);
@@ -1099,7 +1097,7 @@ void MusicWheel::TweenOffScreen(bool changing_sort)
if(changing_sort) { if(changing_sort) {
/* When changing sort, tween the overlay with the item in the center; /* When changing sort, tween the overlay with the item in the center;
* having it separate looks messy when we're moving fast. */ * having it separate looks messy when we're moving fast. */
m_sprSelectionOverlay.BeginTweening( 0.04f * NUM_WHEEL_ITEMS_TO_DRAW/2 * factor ); // sleep m_sprSelectionOverlay.BeginTweening( 0.04f * NUM_WHEEL_ITEMS/2 * factor ); // sleep
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_DECELERATE ); m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_DECELERATE );
} else { } else {
m_sprSelectionOverlay.BeginTweening( 0 ); // sleep m_sprSelectionOverlay.BeginTweening( 0 ); // sleep
@@ -1111,10 +1109,10 @@ void MusicWheel::TweenOffScreen(bool changing_sort)
m_ScrollBar.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE ); m_ScrollBar.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE );
m_ScrollBar.SetTweenX( SCROLL_BAR_X+30 ); m_ScrollBar.SetTweenX( SCROLL_BAR_X+30 );
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ ) for( int i=0; i<NUM_WHEEL_ITEMS; i++ )
{ {
WheelItemDisplay& display = m_WheelItemDisplays[i]; WheelItemDisplay& display = m_WheelItemDisplays[i];
float fThisBannerPositionOffsetFromSelection = i - NUM_WHEEL_ITEMS_TO_DRAW/2 + m_fPositionOffsetFromSelection; float fThisBannerPositionOffsetFromSelection = i - NUM_WHEEL_ITEMS/2 + m_fPositionOffsetFromSelection;
float fX = GetBannerX(fThisBannerPositionOffsetFromSelection); float fX = GetBannerX(fThisBannerPositionOffsetFromSelection);
float fY = GetBannerY(fThisBannerPositionOffsetFromSelection); float fY = GetBannerY(fThisBannerPositionOffsetFromSelection);
+2 -2
View File
@@ -30,7 +30,7 @@
#include "MusicWheelItem.h" #include "MusicWheelItem.h"
const int NUM_WHEEL_ITEMS_TO_DRAW = 13; const int MAX_WHEEL_ITEMS = 15;
const ScreenMessage SM_SongChanged = ScreenMessage(SM_User+47); // this should be unique! const ScreenMessage SM_SongChanged = ScreenMessage(SM_User+47); // this should be unique!
@@ -94,7 +94,7 @@ protected:
vector<WheelItemData> m_WheelItemDatas[NUM_SORT_ORDERS]; vector<WheelItemData> m_WheelItemDatas[NUM_SORT_ORDERS];
vector<WheelItemData *> m_CurWheelItemData; vector<WheelItemData *> m_CurWheelItemData;
WheelItemDisplay m_WheelItemDisplays[NUM_WHEEL_ITEMS_TO_DRAW]; WheelItemDisplay m_WheelItemDisplays[MAX_WHEEL_ITEMS];
int m_iSelection; // index into m_CurWheelItemData int m_iSelection; // index into m_CurWheelItemData
CString m_sExpandedSectionName; CString m_sExpandedSectionName;
+1 -1
View File
@@ -34,7 +34,7 @@
#define JUDGMENT_Y THEME->GetMetricF("Player","JudgmentY") #define JUDGMENT_Y THEME->GetMetricF("Player","JudgmentY")
#define COMBO_Y THEME->GetMetricF("Player","ComboY") #define COMBO_Y THEME->GetMetricF("Player","ComboY")
#define HOLD_JUDGMENT_Y THEME->GetMetricF("Player","HoldJudgmentY") #define HOLD_JUDGMENT_Y THEME->GetMetricF("Player","HoldJudgmentY")
CachedThemeMetric BRIGHT_GHOST_COMBO_THRESHOLD("Player","BrightGhostComboThreshold"); CachedThemeMetricI BRIGHT_GHOST_COMBO_THRESHOLD("Player","BrightGhostComboThreshold");
#define START_DRAWING_AT_PIXELS THEME->GetMetricI("Player","StartDrawingAtPixels") #define START_DRAWING_AT_PIXELS THEME->GetMetricI("Player","StartDrawingAtPixels")
#define STOP_DRAWING_AT_PIXELS THEME->GetMetricI("Player","StopDrawingAtPixels") #define STOP_DRAWING_AT_PIXELS THEME->GetMetricI("Player","StopDrawingAtPixels")
+1 -1
View File
@@ -74,7 +74,7 @@ const float NAMING_MENU_ITEM_X = CENTER_X-200;
const float NAMING_MENU_ITEM_START_Y = SCREEN_TOP + 24; const float NAMING_MENU_ITEM_START_Y = SCREEN_TOP + 24;
const float NAMING_MENU_ITEM_SPACING_Y = 18; const float NAMING_MENU_ITEM_SPACING_Y = 18;
CachedThemeMetric TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); CachedThemeMetricF TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
const ScreenMessage SM_BackFromMainMenu = (ScreenMessage)(SM_User+1); const ScreenMessage SM_BackFromMainMenu = (ScreenMessage)(SM_User+1);
+3 -3
View File
@@ -78,8 +78,8 @@
#define AUTOPLAY_Y THEME->GetMetricF("ScreenGameplay","AutoPlayY") #define AUTOPLAY_Y THEME->GetMetricF("ScreenGameplay","AutoPlayY")
#define SURVIVE_TIME_X THEME->GetMetricF("ScreenGameplay","SurviveTimeX") #define SURVIVE_TIME_X THEME->GetMetricF("ScreenGameplay","SurviveTimeX")
#define SURVIVE_TIME_Y THEME->GetMetricF("ScreenGameplay","SurviveTimeY") #define SURVIVE_TIME_Y THEME->GetMetricF("ScreenGameplay","SurviveTimeY")
CachedThemeMetric SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments"); CachedThemeMetricF SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments");
CachedThemeMetric G_TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); CachedThemeMetricF G_TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
const ScreenMessage SM_PlayReady = ScreenMessage(SM_User+0); const ScreenMessage SM_PlayReady = ScreenMessage(SM_User+0);
@@ -355,9 +355,9 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
switch( GAMESTATE->m_PlayMode ) switch( GAMESTATE->m_PlayMode )
{ {
case PLAY_MODE_ARCADE: case PLAY_MODE_ARCADE:
case PLAY_MODE_NONSTOP:
m_pScoreDisplay[p] = new ScoreDisplayNormal; m_pScoreDisplay[p] = new ScoreDisplayNormal;
break; break;
case PLAY_MODE_NONSTOP:
case PLAY_MODE_ONI: case PLAY_MODE_ONI:
case PLAY_MODE_ENDLESS: case PLAY_MODE_ENDLESS:
m_pScoreDisplay[p] = new ScoreDisplayOni; m_pScoreDisplay[p] = new ScoreDisplayOni;
+28 -1
View File
@@ -57,6 +57,7 @@ extern ThemeManager* THEME; // global and accessable from anywhere in our progra
class CachedThemeMetric class CachedThemeMetric
{ {
protected:
CString m_sClassName; CString m_sClassName;
CString m_sValueName; CString m_sValueName;
bool m_bInited; bool m_bInited;
@@ -87,10 +88,36 @@ public:
} }
operator const CString () const { ASSERT(m_bInited); return m_sValue; }; operator const CString () const { ASSERT(m_bInited); return m_sValue; };
operator const int () const { ASSERT(m_bInited); return m_iValue; }; };
class CachedThemeMetricF : public CachedThemeMetric
{
public:
CachedThemeMetricF( CString sClassName, CString sValueName ) : CachedThemeMetric( sClassName, sValueName ) {}
operator const float () const { ASSERT(m_bInited); return m_fValue; }; operator const float () const { ASSERT(m_bInited); return m_fValue; };
};
class CachedThemeMetricI : public CachedThemeMetric
{
public:
CachedThemeMetricI( CString sClassName, CString sValueName ) : CachedThemeMetric( sClassName, sValueName ) {}
operator const int () const { ASSERT(m_bInited); return m_iValue; };
};
class CachedThemeMetricB : public CachedThemeMetric
{
public:
CachedThemeMetricB( CString sClassName, CString sValueName ) : CachedThemeMetric( sClassName, sValueName ) {}
operator const bool () const { ASSERT(m_bInited); return m_bValue; }; operator const bool () const { ASSERT(m_bInited); return m_bValue; };
};
class CachedThemeMetricC : public CachedThemeMetric
{
public:
CachedThemeMetricC( CString sClassName, CString sValueName ) : CachedThemeMetric( sClassName, sValueName ) {}
operator const RageColor () const { ASSERT(m_bInited); return m_cValue; }; operator const RageColor () const { ASSERT(m_bInited); return m_cValue; };
}; };
#endif #endif