Move common time routines to TimeConstants*
add calorie tracking by day of year
This commit is contained in:
@@ -62,8 +62,8 @@ Bookkeeper::Bookkeeper()
|
|||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
m_iLastSeenTime = time(NULL);
|
m_iLastSeenTime = time(NULL);
|
||||||
for( i=0; i<DAYS_PER_YEAR; i++ )
|
for( i=0; i<DAYS_IN_YEAR; i++ )
|
||||||
for( j=0; j<HOURS_PER_DAY; j++ )
|
for( j=0; j<HOURS_IN_DAY; j++ )
|
||||||
m_iCoinsByHourForYear[i][j] = 0;
|
m_iCoinsByHourForYear[i][j] = 0;
|
||||||
|
|
||||||
ReadFromDisk();
|
ReadFromDisk();
|
||||||
@@ -96,9 +96,9 @@ void Bookkeeper::ReadFromDisk()
|
|||||||
if( !FileRead(f, m_iLastSeenTime) )
|
if( !FileRead(f, m_iLastSeenTime) )
|
||||||
WARN_AND_RETURN;
|
WARN_AND_RETURN;
|
||||||
|
|
||||||
for (int i=0; i<DAYS_PER_YEAR; ++i)
|
for (int i=0; i<DAYS_IN_YEAR; ++i)
|
||||||
{
|
{
|
||||||
for (int j=0; j<HOURS_PER_DAY; ++j)
|
for (int j=0; j<HOURS_IN_DAY; ++j)
|
||||||
{
|
{
|
||||||
int iCoins;
|
int iCoins;
|
||||||
if( !FileRead(f, iCoins) )
|
if( !FileRead(f, iCoins) )
|
||||||
@@ -123,8 +123,8 @@ void Bookkeeper::WriteToDisk()
|
|||||||
|
|
||||||
FileWrite(f, m_iLastSeenTime);
|
FileWrite(f, m_iLastSeenTime);
|
||||||
|
|
||||||
for (int i=0; i<DAYS_PER_YEAR; ++i)
|
for (int i=0; i<DAYS_IN_YEAR; ++i)
|
||||||
for (int j=0; j<HOURS_PER_DAY; ++j)
|
for (int j=0; j<HOURS_IN_DAY; ++j)
|
||||||
FileWrite( f, m_iCoinsByHourForYear[i][j] );
|
FileWrite( f, m_iCoinsByHourForYear[i][j] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,12 +154,12 @@ void Bookkeeper::UpdateLastSeenTime()
|
|||||||
tOld.tm_hour != tNew.tm_hour )
|
tOld.tm_hour != tNew.tm_hour )
|
||||||
{
|
{
|
||||||
tOld.tm_hour++;
|
tOld.tm_hour++;
|
||||||
if( tOld.tm_hour == HOURS_PER_DAY )
|
if( tOld.tm_hour == HOURS_IN_DAY )
|
||||||
{
|
{
|
||||||
tOld.tm_hour = 0;
|
tOld.tm_hour = 0;
|
||||||
tOld.tm_yday++;
|
tOld.tm_yday++;
|
||||||
}
|
}
|
||||||
if( tOld.tm_yday == DAYS_PER_YEAR )
|
if( tOld.tm_yday == DAYS_IN_YEAR )
|
||||||
{
|
{
|
||||||
tOld.tm_yday = 0;
|
tOld.tm_yday = 0;
|
||||||
tOld.tm_year++;
|
tOld.tm_year++;
|
||||||
@@ -185,7 +185,7 @@ void Bookkeeper::CoinInserted()
|
|||||||
int Bookkeeper::GetCoinsForDay( int iDayOfYear )
|
int Bookkeeper::GetCoinsForDay( int iDayOfYear )
|
||||||
{
|
{
|
||||||
int iCoins = 0;
|
int iCoins = 0;
|
||||||
for( int i=0; i<HOURS_PER_DAY; i++ )
|
for( int i=0; i<HOURS_IN_DAY; i++ )
|
||||||
iCoins += m_iCoinsByHourForYear[iDayOfYear][i];
|
iCoins += m_iCoinsByHourForYear[iDayOfYear][i];
|
||||||
return iCoins;
|
return iCoins;
|
||||||
}
|
}
|
||||||
@@ -241,27 +241,22 @@ void Bookkeeper::GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] )
|
|||||||
tm time;
|
tm time;
|
||||||
localtime_r( &lOldTime, &time );
|
localtime_r( &lOldTime, &time );
|
||||||
|
|
||||||
for( int d=0; d<DAYS_PER_YEAR; d++ )
|
for( int d=0; d<DAYS_IN_YEAR; d++ )
|
||||||
{
|
{
|
||||||
coins[GetDayOfWeek(time)] += GetCoinsForDay( time.tm_yday );
|
coins[GetDayOfWeek(time)] += GetCoinsForDay( time.tm_yday );
|
||||||
time = GetYesterday( time );
|
time = GetYesterday( time );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bookkeeper::GetCoinsByHour( int coins[HOURS_PER_DAY] )
|
void Bookkeeper::GetCoinsByHour( int coins[HOURS_IN_DAY] )
|
||||||
{
|
{
|
||||||
UpdateLastSeenTime();
|
UpdateLastSeenTime();
|
||||||
|
|
||||||
for( int h=0; h<HOURS_PER_DAY; h++ )
|
for( int h=0; h<HOURS_IN_DAY; h++ )
|
||||||
{
|
{
|
||||||
coins[h] = 0;
|
coins[h] = 0;
|
||||||
|
|
||||||
for( int d=0; d<DAYS_PER_YEAR; d++ )
|
for( int d=0; d<DAYS_IN_YEAR; d++ )
|
||||||
coins[h] += m_iCoinsByHourForYear[d][h];
|
coins[h] += m_iCoinsByHourForYear[d][h];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CString HourToString( int iHourIndex )
|
|
||||||
{
|
|
||||||
return ssprintf("%02d:00", iHourIndex);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -13,36 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
#include "TimeConstants.h"
|
||||||
const int NUM_LAST_DAYS = 7;
|
|
||||||
const int NUM_LAST_WEEKS = 52;
|
|
||||||
const int DAYS_PER_YEAR = 365;
|
|
||||||
const int HOURS_PER_DAY = 24;
|
|
||||||
const int DAYS_IN_WEEK = 7;
|
|
||||||
|
|
||||||
const CString LAST_DAYS_NAME[NUM_LAST_DAYS] =
|
|
||||||
{
|
|
||||||
"Yesterday",
|
|
||||||
"2 Days Ago",
|
|
||||||
"3 Days Ago",
|
|
||||||
"4 Days Ago",
|
|
||||||
"5 Days Ago",
|
|
||||||
"6 Days Ago",
|
|
||||||
"7 Days Ago",
|
|
||||||
};
|
|
||||||
|
|
||||||
const CString DAY_OF_WEEK_TO_NAME[DAYS_IN_WEEK] =
|
|
||||||
{
|
|
||||||
"Sunday",
|
|
||||||
"Monday",
|
|
||||||
"Tuesday",
|
|
||||||
"Wednesday",
|
|
||||||
"Thursday",
|
|
||||||
"Friday",
|
|
||||||
"Saturday",
|
|
||||||
};
|
|
||||||
|
|
||||||
CString HourToString( int iHourIndex );
|
|
||||||
|
|
||||||
|
|
||||||
class Bookkeeper
|
class Bookkeeper
|
||||||
@@ -57,7 +28,7 @@ public:
|
|||||||
void GetCoinsLastDays( int coins[NUM_LAST_DAYS] );
|
void GetCoinsLastDays( int coins[NUM_LAST_DAYS] );
|
||||||
void GetCoinsLastWeeks( int coins[NUM_LAST_WEEKS] );
|
void GetCoinsLastWeeks( int coins[NUM_LAST_WEEKS] );
|
||||||
void GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] );
|
void GetCoinsByDayOfWeek( int coins[DAYS_IN_WEEK] );
|
||||||
void GetCoinsByHour( int coins[HOURS_PER_DAY] );
|
void GetCoinsByHour( int coins[HOURS_IN_DAY] );
|
||||||
|
|
||||||
void ReadFromDisk();
|
void ReadFromDisk();
|
||||||
void WriteToDisk();
|
void WriteToDisk();
|
||||||
@@ -67,7 +38,7 @@ private:
|
|||||||
int GetCoinsForDay( int iDayOfYear );
|
int GetCoinsForDay( int iDayOfYear );
|
||||||
|
|
||||||
int m_iLastSeenTime;
|
int m_iLastSeenTime;
|
||||||
int m_iCoinsByHourForYear[DAYS_PER_YEAR][HOURS_PER_DAY];
|
int m_iCoinsByHourForYear[DAYS_IN_YEAR][HOURS_IN_DAY];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ NotesLoaderSM.cpp NotesLoaderSM.h NotesWriterDWI.cpp NotesWriterDWI.h NotesWrite
|
|||||||
PlayerAI.cpp PlayerAI.h PlayerNumber.cpp PlayerNumber.h PlayerOptions.cpp PlayerOptions.h Profile.cpp Profile.h ProfileHtml.cpp ProfileHtml.h RandomSample.cpp RandomSample.h \
|
PlayerAI.cpp PlayerAI.h PlayerNumber.cpp PlayerNumber.h PlayerOptions.cpp PlayerOptions.h Profile.cpp Profile.h ProfileHtml.cpp ProfileHtml.h RandomSample.cpp RandomSample.h \
|
||||||
ScoreKeeper.h ScoreKeeperMAX2.cpp ScoreKeeperMAX2.h ScoreKeeperRave.cpp ScoreKeeperRave.h \
|
ScoreKeeper.h ScoreKeeperMAX2.cpp ScoreKeeperMAX2.h ScoreKeeperRave.cpp ScoreKeeperRave.h \
|
||||||
Song.cpp song.h SongCacheIndex.cpp SongCacheIndex.h SongOptions.cpp SongOptions.h StageStats.cpp StageStats.h Steps.cpp Steps.h \
|
Song.cpp song.h SongCacheIndex.cpp SongCacheIndex.h SongOptions.cpp SongOptions.h StageStats.cpp StageStats.h Steps.cpp Steps.h \
|
||||||
Style.h StyleDef.cpp StyleDef.h StyleInput.h TimingData.cpp TimingData.h TitleSubstitution.cpp TitleSubstitution.h \
|
Style.h StyleDef.cpp StyleDef.h StyleInput.h Time.cpp Time.h TimingData.cpp TimingData.h TitleSubstitution.cpp TitleSubstitution.h \
|
||||||
LuaHelpers.cpp LuaHelpers.h LuaFunctions.h
|
LuaHelpers.cpp LuaHelpers.h LuaFunctions.h
|
||||||
|
|
||||||
FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h XmlFile.cpp XmlFile.h
|
FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h XmlFile.cpp XmlFile.h
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ void Profile::InitGeneralData()
|
|||||||
m_iNumSongsPlayedByMeter[i] = 0;
|
m_iNumSongsPlayedByMeter[i] = 0;
|
||||||
ZERO( m_iNumSongsPassedByPlayMode );
|
ZERO( m_iNumSongsPassedByPlayMode );
|
||||||
ZERO( m_iNumSongsPassedByGrade );
|
ZERO( m_iNumSongsPassedByGrade );
|
||||||
|
ZERO( m_iCaloriesByDayForLastYear );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::InitSongScores()
|
void Profile::InitSongScores()
|
||||||
@@ -583,6 +584,18 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
|||||||
pNumSongsPassedByPlayMode->AppendChild( PlayModeToString(pm), m_iNumSongsPassedByPlayMode[pm] );
|
pNumSongsPassedByPlayMode->AppendChild( PlayModeToString(pm), m_iNumSongsPassedByPlayMode[pm] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
XNode* pCaloriesByDayForLastYear = pGeneralDataNode->AppendChild("CaloriesByDayForLastYear");
|
||||||
|
for( int i=0; i<DAYS_IN_YEAR; i++ )
|
||||||
|
{
|
||||||
|
/* Don't save empty. */
|
||||||
|
if( m_iCaloriesByDayForLastYear[i]==0 )
|
||||||
|
continue;
|
||||||
|
pCaloriesByDayForLastYear->AppendChild( DayInYearToString(i), m_iCaloriesByDayForLastYear[i] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pGeneralDataNode;
|
return pGeneralDataNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,6 +726,14 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
|||||||
pNumSongsPassedByPlayMode->GetChildValue( PlayModeToString(pm), m_iNumSongsPassedByPlayMode[pm] );
|
pNumSongsPassedByPlayMode->GetChildValue( PlayModeToString(pm), m_iNumSongsPassedByPlayMode[pm] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
XNode* pCaloriesByDayForLastYear = pNode->GetChild("CaloriesByDayForLastYear");
|
||||||
|
if( pCaloriesByDayForLastYear )
|
||||||
|
for( int i=0; i<DAYS_IN_YEAR; i++ )
|
||||||
|
pCaloriesByDayForLastYear->GetChildValue( DayInYearToString(i), m_iCaloriesByDayForLastYear[i] );
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::AddStepTotals( int iTotalTapsAndHolds, int iTotalJumps, int iTotalHolds, int iTotalMines, int iTotalHands )
|
void Profile::AddStepTotals( int iTotalTapsAndHolds, int iTotalJumps, int iTotalHolds, int iTotalMines, int iTotalHands )
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include "XmlFile.h"
|
#include "XmlFile.h"
|
||||||
#include "HighScore.h"
|
#include "HighScore.h"
|
||||||
|
#include "TimeConstants.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -106,6 +107,7 @@ public:
|
|||||||
int m_iNumSongsPlayedByMeter[MAX_METER+1];
|
int m_iNumSongsPlayedByMeter[MAX_METER+1];
|
||||||
int m_iNumSongsPassedByPlayMode[NUM_PLAY_MODES];
|
int m_iNumSongsPassedByPlayMode[NUM_PLAY_MODES];
|
||||||
int m_iNumSongsPassedByGrade[NUM_GRADES];
|
int m_iNumSongsPassedByGrade[NUM_GRADES];
|
||||||
|
int m_iCaloriesByDayForLastYear[DAYS_IN_YEAR];
|
||||||
|
|
||||||
void AddStepTotals( int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands );
|
void AddStepTotals( int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands );
|
||||||
|
|
||||||
|
|||||||
@@ -872,7 +872,7 @@ void PrintBookkeeping( RageFile &f, const Profile *pProfile, CString sTitle, vec
|
|||||||
BEGIN_TABLE(4);
|
BEGIN_TABLE(4);
|
||||||
for( int i=0; i<DAYS_IN_WEEK; i++ )
|
for( int i=0; i<DAYS_IN_WEEK; i++ )
|
||||||
{
|
{
|
||||||
CString sDay = DAY_OF_WEEK_TO_NAME[i];
|
CString sDay = DayOfWeekToString(i);
|
||||||
TABLE_LINE2( sDay, coins[i] );
|
TABLE_LINE2( sDay, coins[i] );
|
||||||
}
|
}
|
||||||
END_TABLE;
|
END_TABLE;
|
||||||
@@ -882,12 +882,12 @@ void PrintBookkeeping( RageFile &f, const Profile *pProfile, CString sTitle, vec
|
|||||||
|
|
||||||
// GetCoinsByHour
|
// GetCoinsByHour
|
||||||
{
|
{
|
||||||
int coins[HOURS_PER_DAY];
|
int coins[HOURS_IN_DAY];
|
||||||
BOOKKEEPER->GetCoinsByHour( coins );
|
BOOKKEEPER->GetCoinsByHour( coins );
|
||||||
PRINT_OPEN(f, ssprintf("Coins for Last %d Hours",HOURS_PER_DAY), true );
|
PRINT_OPEN(f, ssprintf("Coins for Last %d Hours",HOURS_IN_DAY), true );
|
||||||
{
|
{
|
||||||
BEGIN_TABLE(4);
|
BEGIN_TABLE(4);
|
||||||
for( int i=0; i<HOURS_PER_DAY; i++ )
|
for( int i=0; i<HOURS_IN_DAY; i++ )
|
||||||
{
|
{
|
||||||
CString sHour = ssprintf("hour %d",i);
|
CString sHour = ssprintf("hour %d",i);
|
||||||
TABLE_LINE2( sHour, coins[i] );
|
TABLE_LINE2( sHour, coins[i] );
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ void ScreenBookkeeping::ChangeView( View newView )
|
|||||||
CString sTitle, sData;
|
CString sTitle, sData;
|
||||||
for( int i=0; i<NUM_LAST_DAYS; i++ )
|
for( int i=0; i<NUM_LAST_DAYS; i++ )
|
||||||
{
|
{
|
||||||
sTitle += LAST_DAYS_NAME[i] + "\n";
|
sTitle += LastDayToString(i) + "\n";
|
||||||
sData += ssprintf("%d",coins[i]) + "\n";
|
sData += ssprintf("%d",coins[i]) + "\n";
|
||||||
iTotalLast += coins[i];
|
iTotalLast += coins[i];
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ void ScreenBookkeeping::ChangeView( View newView )
|
|||||||
CString sTitle, sData;
|
CString sTitle, sData;
|
||||||
for( int i=0; i<DAYS_IN_WEEK; i++ )
|
for( int i=0; i<DAYS_IN_WEEK; i++ )
|
||||||
{
|
{
|
||||||
sTitle += DAY_OF_WEEK_TO_NAME[i] + "\n";
|
sTitle += DayOfWeekToString(i) + "\n";
|
||||||
sData += ssprintf("%d",coins[i]) + "\n";
|
sData += ssprintf("%d",coins[i]) + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,22 +203,22 @@ void ScreenBookkeeping::ChangeView( View newView )
|
|||||||
{
|
{
|
||||||
m_textTitle.SetText( "Hour of day" );
|
m_textTitle.SetText( "Hour of day" );
|
||||||
|
|
||||||
int coins[HOURS_PER_DAY];
|
int coins[HOURS_IN_DAY];
|
||||||
BOOKKEEPER->GetCoinsByHour( coins );
|
BOOKKEEPER->GetCoinsByHour( coins );
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
CString sTitle1, sData1;
|
CString sTitle1, sData1;
|
||||||
for( i=0; i<HOURS_PER_DAY/2; i++ )
|
for( i=0; i<HOURS_IN_DAY/2; i++ )
|
||||||
{
|
{
|
||||||
sTitle1 += HourToString(i) + "\n";
|
sTitle1 += HourInDayToString(i) + "\n";
|
||||||
sData1 += ssprintf("%d",coins[i]) + "\n";
|
sData1 += ssprintf("%d",coins[i]) + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
CString sTitle2, sData2;
|
CString sTitle2, sData2;
|
||||||
for( i=(HOURS_PER_DAY/2); i<HOURS_PER_DAY; i++ )
|
for( i=(HOURS_IN_DAY/2); i<HOURS_IN_DAY; i++ )
|
||||||
{
|
{
|
||||||
sTitle2 += HourToString(i) + "\n";
|
sTitle2 += HourInDayToString(i) + "\n";
|
||||||
sData2 += ssprintf("%d",coins[i]) + "\n";
|
sData2 += ssprintf("%d",coins[i]) + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+54
-46
@@ -1,5 +1,5 @@
|
|||||||
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
# Microsoft Developer Studio Generated Build File, Format Version 60000
|
||||||
# ** DO NOT EDIT **
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
@@ -62,7 +62,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Debug6
|
IntDir=.\../Debug6
|
||||||
TargetDir=\temp\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -82,23 +82,27 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania
|
|||||||
# PROP Intermediate_Dir "../Debug_Xbox"
|
# PROP Intermediate_Dir "../Debug_Xbox"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
XBCP=xbecopy.exe
|
CPP=cl.exe
|
||||||
# ADD BASE XBCP /NOLOGO
|
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c
|
||||||
# ADD XBCP /NOLOGO
|
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "_DEBUG" /D "_XBOX" /D "OGG_ONLY" /D "DEBUG" /FR /YX"global.h" /FD /G6 /Ztmp /c
|
||||||
XBE=imagebld.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe"
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /subsystem:xbox /fixed:no /TMP
|
# ADD BASE LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /subsystem:xbox /fixed:no /TMP
|
||||||
# ADD LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /map /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"../StepManiaXbox-debug.exe" /subsystem:xbox /fixed:no /TMP
|
# ADD LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /map /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"../StepManiaXbox-debug.exe" /subsystem:xbox /fixed:no /TMP
|
||||||
# SUBTRACT LINK32 /incremental:no
|
# SUBTRACT LINK32 /incremental:no
|
||||||
BSC32=bscmake.exe
|
XBE=imagebld.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||||
# ADD BSC32 /nologo
|
# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe"
|
||||||
CPP=cl.exe
|
XBCP=xbecopy.exe
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c
|
# ADD BASE XBCP /NOLOGO
|
||||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "_DEBUG" /D "_XBOX" /D "OGG_ONLY" /D "DEBUG" /FR /YX"global.h" /FD /G6 /Ztmp /c
|
# ADD XBCP /NOLOGO
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
|
IntDir=.\../Debug_Xbox
|
||||||
|
TargetDir=\stepmania\stepmania
|
||||||
|
TargetName=default
|
||||||
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -135,7 +139,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /pdb:none /debug
|
# SUBTRACT LINK32 /verbose /pdb:none /debug
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Release6
|
IntDir=.\../Release6
|
||||||
TargetDir=\temp\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -156,24 +160,28 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania
|
|||||||
# PROP Intermediate_Dir "../Release_Xbox"
|
# PROP Intermediate_Dir "../Release_Xbox"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
XBCP=xbecopy.exe
|
CPP=cl.exe
|
||||||
# ADD BASE XBCP /NOLOGO
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
||||||
# ADD XBCP /NOLOGO
|
# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "NDEBUG" /D "_XBOX" /FR /YX /FD /c
|
||||||
XBE=imagebld.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe"
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
# ADD BASE LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
||||||
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# ADD LINK32 $(intdir)\verstub.obj xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xnet.lib xboxkrnl.lib libcmt.lib /nologo /incremental:no /map /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"../StepManiaXbox.exe" /subsystem:xbox /fixed:no /TMP /OPT:REF
|
# ADD LINK32 $(intdir)\verstub.obj xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xnet.lib xboxkrnl.lib libcmt.lib /nologo /incremental:no /map /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"../StepManiaXbox.exe" /subsystem:xbox /fixed:no /TMP /OPT:REF
|
||||||
# SUBTRACT LINK32 /pdb:none /debug
|
# SUBTRACT LINK32 /pdb:none /debug
|
||||||
BSC32=bscmake.exe
|
XBE=imagebld.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||||
# ADD BSC32 /nologo
|
# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe"
|
||||||
CPP=cl.exe
|
XBCP=xbecopy.exe
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
# ADD BASE XBCP /NOLOGO
|
||||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "NDEBUG" /D "_XBOX" /FR /YX /FD /c
|
# ADD XBCP /NOLOGO
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
|
IntDir=.\../Release_Xbox
|
||||||
|
TargetDir=\stepmania\stepmania
|
||||||
|
TargetName=default
|
||||||
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -1161,25 +1169,6 @@ SOURCE=.\Course.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\CryptHelpers.cpp
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\CryptHelpers.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Font.cpp
|
SOURCE=.\Font.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
@@ -1918,6 +1907,25 @@ SOURCE=.\StyleInput.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\TimeConstants.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\TimeConstants.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\TimingData.cpp
|
SOURCE=.\TimingData.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|||||||
@@ -803,6 +803,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="StyleInput.h">
|
RelativePath="StyleInput.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="TimeConstants.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="TimeConstants.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="TimingData.cpp">
|
RelativePath="TimingData.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
#include "global.h"
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Class: TimeConstants
|
||||||
|
|
||||||
|
Desc:
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "TimeConstants.h"
|
||||||
|
#include "RageUtil.h"
|
||||||
|
|
||||||
|
CString DayInYearToString( int iDayInYear )
|
||||||
|
{
|
||||||
|
return ssprintf("DayInYear%03d",iDayInYear);
|
||||||
|
}
|
||||||
|
|
||||||
|
int StringToDayInYear( CString sDayInYear )
|
||||||
|
{
|
||||||
|
int iDayInYear;
|
||||||
|
if( sscanf( sDayInYear, "DayInYear%d", &iDayInYear ) != 1 )
|
||||||
|
return -1;
|
||||||
|
return iDayInYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const CString LAST_DAYS_NAME[NUM_LAST_DAYS] =
|
||||||
|
{
|
||||||
|
"Yesterday",
|
||||||
|
"2 Days Ago",
|
||||||
|
"3 Days Ago",
|
||||||
|
"4 Days Ago",
|
||||||
|
"5 Days Ago",
|
||||||
|
"6 Days Ago",
|
||||||
|
"7 Days Ago",
|
||||||
|
};
|
||||||
|
|
||||||
|
CString LastDayToString( int iLastDayIndex )
|
||||||
|
{
|
||||||
|
return LAST_DAYS_NAME[iLastDayIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
static const CString DAY_OF_WEEK_TO_NAME[DAYS_IN_WEEK] =
|
||||||
|
{
|
||||||
|
"Sunday",
|
||||||
|
"Monday",
|
||||||
|
"Tuesday",
|
||||||
|
"Wednesday",
|
||||||
|
"Thursday",
|
||||||
|
"Friday",
|
||||||
|
"Saturday",
|
||||||
|
};
|
||||||
|
|
||||||
|
CString DayOfWeekToString( int iDayOfWeekIndex )
|
||||||
|
{
|
||||||
|
return DAY_OF_WEEK_TO_NAME[iDayOfWeekIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
CString HourInDayToString( int iHourInDayIndex )
|
||||||
|
{
|
||||||
|
return ssprintf("%02d:00", iHourInDayIndex);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef TimeConstants_H
|
||||||
|
#define TimeConstants_H
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Class: TimeConstants
|
||||||
|
|
||||||
|
Desc:
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
const int NUM_LAST_DAYS = 7;
|
||||||
|
const int NUM_LAST_WEEKS = 52;
|
||||||
|
const int DAYS_IN_YEAR = 365;
|
||||||
|
const int HOURS_IN_DAY = 24;
|
||||||
|
const int DAYS_IN_WEEK = 7;
|
||||||
|
|
||||||
|
CString DayInYearToString( int iDayInYearIndex );
|
||||||
|
CString LastDayToString( int iLastDayIndex );
|
||||||
|
CString DayOfWeekToString( int iDayOfWeekIndex );
|
||||||
|
CString HourInDayToString( int iHourIndex );
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user