Multiple warning fixes dealing with casts.

Yes, I am using static_casts. Generally safer.
This commit is contained in:
Jason Felds
2011-03-14 02:09:58 -04:00
parent 1dfb1c6143
commit 650653b4d2
10 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -445,7 +445,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
{
// find the middle, and split based on iColNum
// it's unknown if this will work for routine.
const int iMiddleColumn = floor(pStyle->m_iColsPerPlayer/2.0f);
const int iMiddleColumn = static_cast<int>(floor(pStyle->m_iColsPerPlayer/2.0f));
if( iColNum > iMiddleColumn-1 )
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset);
else
+1 -1
View File
@@ -464,7 +464,7 @@ void EditCourseUtil::PrepareForPlay()
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_GoalType = GoalType_Time;
Course *pCourse = GAMESTATE->m_pCurCourse;
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = pCourse->m_fGoalSeconds;
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = static_cast<int>(pCourse->m_fGoalSeconds);
}
void EditCourseUtil::GetAllEditCourses( vector<Course*> &vpCoursesOut )
+4 -4
View File
@@ -53,12 +53,12 @@ void OptionsCursor::Load( const RString &sMetricsGroup, bool bLoadCanGos )
}
#undef LOAD_SPR
m_iOriginalLeftX = m_sprLeft->GetX();
m_iOriginalRightX = m_sprRight->GetX();
m_iOriginalLeftX = static_cast<int>(m_sprLeft->GetX());
m_iOriginalRightX = static_cast<int>(m_sprRight->GetX());
if( bLoadCanGos )
{
m_iOriginalCanGoLeftX = m_sprCanGoLeft->GetX();
m_iOriginalCanGoRightX = m_sprCanGoRight->GetX();
m_iOriginalCanGoLeftX = static_cast<int>(m_sprCanGoLeft->GetX());
m_iOriginalCanGoRightX = static_cast<int>(m_sprCanGoRight->GetX());
}
SetCanGo( false, false );
+1 -1
View File
@@ -3193,7 +3193,7 @@ void Player::SetCombo( int iCombo, int iMisses )
if( GAMESTATE->IsCourseMode() )
{
int iSongIndexStartColoring = GAMESTATE->m_pCurCourse->GetEstimatedNumStages();
iSongIndexStartColoring = floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO);
iSongIndexStartColoring = static_cast<int>(floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO));
bPastBeginning = GAMESTATE->GetCourseSongIndex() >= iSongIndexStartColoring;
}
else
+1 -1
View File
@@ -760,7 +760,7 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
int iHeight = 480;
// This used to be lrintf. However, lrintf causes odd resolutions like
// 639x480 (4:3) and 853x480 (16:9). ceilf gives correct values. -aj
int iWidth = ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio );
int iWidth = static_cast<int>(ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio ));
timer.Touch();
RageSurfaceUtils::Zoom( surface, iWidth, iHeight );
// LOG->Trace( "%ix%i -> %ix%i (%.3f) in %f seconds", surface->w, surface->h, iWidth, iHeight, GetActualVideoModeParams().fDisplayAspectRatio, timer.GetDeltaTime() );
+1 -1
View File
@@ -488,7 +488,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
p += m_CustomComboBonusValue;
}
p += m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier;
p += static_cast<int>(m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier);
if( m_iNumNotesHitThisRow == 2 )
p = (int)(p * m_DoubleNoteMultiplier);
+1 -1
View File
@@ -261,7 +261,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
{
case EditCourseRow_Minutes:
row.SetOneSharedSelection( 0 );
row.SetOneSharedSelectionIfPresent( MakeMinutesString(GAMESTATE->m_pCurCourse->m_fGoalSeconds/60) );
row.SetOneSharedSelectionIfPresent( MakeMinutesString(static_cast<int>(GAMESTATE->m_pCurCourse->m_fGoalSeconds)/60) );
break;
default:
{
+1 -1
View File
@@ -46,7 +46,7 @@ void ScrollBar::SetPercentage( float fCenterPercent, float fSizePercent )
{
wrap( fCenterPercent, 1.0f );
const int iBarContentHeight = m_sprMiddle->GetZoomedHeight();
const int iBarContentHeight = static_cast<int>(m_sprMiddle->GetZoomedHeight());
ASSERT( iBarContentHeight != 0 );
/* Set tick thumb */
+2 -2
View File
@@ -103,7 +103,7 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams &paramsOut )
{
//float fRatio = PREFSMAN->m_iDisplayWidth / PREFSMAN->m_iDisplayHeight;
//iWidth = PREFSMAN->m_iDisplayHeight * fRatio;
iWidth = ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio);
iWidth = static_cast<int>(ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio));
}
// todo: allow for PRODUCT_ID + "-" + CommonMetrics::WINDOW_TITLE as
@@ -917,7 +917,7 @@ static void WriteLogHeader()
#endif
// this code should only be enabled in distributed builds
//LOG->Info("sm-ssc is Copyright ©2009 the spinal shark collective, all rights reserved. Commercial use of this binary is prohibited by law and will be prosecuted to the fullest extent of the law.");
//LOG->Info("sm-ssc is Copyright �2009 the spinal shark collective, all rights reserved. Commercial use of this binary is prohibited by law and will be prosecuted to the fullest extent of the law.");
// end limited code
time_t cur_time;
+1 -1
View File
@@ -31,7 +31,7 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
m_transformPill.SetFromReference( THEME->GetMetricR(sMetricsGroup,"PillTransformFunction") );
float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX");
int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills");
int iNumPills = static_cast<int>(THEME->GetMetricF(sMetricsGroup,"NumPills"));
m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar");
FOREACH_ENUM( StreamType, st )