From fb259c7237360c03dcb40dc0ed455994e294a649 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 27 Dec 2005 17:39:27 +0000 Subject: [PATCH] fix compile --- stepmania/src/DateTime.cpp | 1 - stepmania/src/DateTime.h | 6 +++--- stepmania/src/DateTimeLua.cpp | 4 ++-- stepmania/src/ScreenBookkeeping.cpp | 4 ++-- stepmania/src/ScreenSetTime.cpp | 12 ++++++------ 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/stepmania/src/DateTime.cpp b/stepmania/src/DateTime.cpp index 3429dec6fb..2a9a6a5ba1 100644 --- a/stepmania/src/DateTime.cpp +++ b/stepmania/src/DateTime.cpp @@ -179,7 +179,6 @@ CString HourInDayToString( int iHourInDayIndex ) return ssprintf("Hour%02d", iHourInDayIndex); } -enum Month {}; static const CString MonthNames[] = { "January", diff --git a/stepmania/src/DateTime.h b/stepmania/src/DateTime.h index 177873d354..adc920f019 100644 --- a/stepmania/src/DateTime.h +++ b/stepmania/src/DateTime.h @@ -8,7 +8,7 @@ const int NUM_LAST_WEEKS = 52; const int DAYS_IN_YEAR = 366; // maximum (leap years) const int HOURS_IN_DAY = 24; const int DAYS_IN_WEEK = 7; -const int MONTHS_IN_YEAR = 12; +enum Month { MONTHS_IN_YEAR = 12 }; CString DayInYearToString( int iDayInYearIndex ); CString LastDayToString( int iLastDayIndex ); @@ -17,8 +17,8 @@ CString DayOfWeekToString( int iDayOfWeekIndex ); CString DayOfWeekToThemedString( int iDayOfWeekIndex ); CString HourInDayToString( int iHourIndex ); CString HourInDayToThemedString( int iHourIndex ); -CString MonthToString( int iMonthIndex ); -CString MonthToThemedString( int iMonthIndex ); +const CString &MonthToString( Month month ); +const CString &MonthToThemedString( Month month ); CString LastWeekToString( int iLastWeekIndex ); CString LastWeekToThemedString( int iLastWeekIndex ); diff --git a/stepmania/src/DateTimeLua.cpp b/stepmania/src/DateTimeLua.cpp index 64d5bb00fb..5c4567e86c 100644 --- a/stepmania/src/DateTimeLua.cpp +++ b/stepmania/src/DateTimeLua.cpp @@ -3,8 +3,8 @@ #include "LuaFunctions.h" #include "RageUtil.h" -LuaFunction( MonthToString, MonthToString( IArg(1) ) ); -LuaFunction( MonthToThemedString, MonthToThemedString( IArg(1) ) ); +LuaFunction( MonthToString, MonthToString( (Month)IArg(1) ) ); +LuaFunction( MonthToThemedString, MonthToThemedString( (Month)IArg(1) ) ); LuaFunction( MonthOfYear, GetLocalTime().tm_mon ); LuaFunction( DayOfMonth, GetLocalTime().tm_mday ); LuaFunction( Hour, GetLocalTime().tm_hour ); diff --git a/stepmania/src/ScreenBookkeeping.cpp b/stepmania/src/ScreenBookkeeping.cpp index 99c8ec02ed..a72f095d02 100644 --- a/stepmania/src/ScreenBookkeeping.cpp +++ b/stepmania/src/ScreenBookkeeping.cpp @@ -139,7 +139,7 @@ void ScreenBookkeeping::ChangeView( View newView ) iTotalLast += coins[i]; } - sTitle += ALL_TIME.GetString()+"\n"; + sTitle += ALL_TIME.GetValue()+"\n"; sData += ssprintf("%i\n", iTotalLast); m_textData[0].SetText( "" ); @@ -152,7 +152,7 @@ void ScreenBookkeeping::ChangeView( View newView ) break; case VIEW_LAST_WEEKS: { - m_textTitle.SetText( ssprintf(LAST_WEEKS, NUM_LAST_WEEKS) ); + m_textTitle.SetText( ssprintf(LAST_WEEKS.GetValue(), NUM_LAST_WEEKS) ); int coins[NUM_LAST_WEEKS]; BOOKKEEPER->GetCoinsLastWeeks( coins ); diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index 432c010b94..144c1b1608 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -99,12 +99,12 @@ void ScreenSetTime::Update( float fDelta ) iPrettyHour = 12; CString sPrettyHour = ssprintf( "%d %s", iPrettyHour, now.tm_hour>=12 ? "pm" : "am" ); - m_textValue[hour].SetText( sPrettyHour ); - m_textValue[minute].SetText( ssprintf("%02d",now.tm_min) ); - m_textValue[second].SetText( ssprintf("%02d",now.tm_sec) ); - m_textValue[year].SetText( ssprintf("%02d",now.tm_year+1900) ); - m_textValue[month].SetText( MonthToString(now.tm_mon) ); - m_textValue[day].SetText( ssprintf("%02d",now.tm_mday) ); + m_textValue[hour] .SetText( sPrettyHour ); + m_textValue[minute] .SetText( ssprintf("%02d",now.tm_min) ); + m_textValue[second] .SetText( ssprintf("%02d",now.tm_sec) ); + m_textValue[year] .SetText( ssprintf("%02d",now.tm_year+1900) ); + m_textValue[month] .SetText( MonthToString((Month)now.tm_mon) ); + m_textValue[day] .SetText( ssprintf("%02d",now.tm_mday) ); } void ScreenSetTime::Input( const InputEventPlus &input )