diff --git a/stepmania/src/Bookkeeper.cpp b/stepmania/src/Bookkeeper.cpp index b0bf25e987..ddb33cd4dc 100644 --- a/stepmania/src/Bookkeeper.cpp +++ b/stepmania/src/Bookkeeper.cpp @@ -62,8 +62,8 @@ Bookkeeper::Bookkeeper() int i, j; m_iLastSeenTime = time(NULL); - for( i=0; iAppendChild( PlayModeToString(pm), m_iNumSongsPassedByPlayMode[pm] ); } } + + { + XNode* pCaloriesByDayForLastYear = pGeneralDataNode->AppendChild("CaloriesByDayForLastYear"); + for( int i=0; iAppendChild( DayInYearToString(i), m_iCaloriesByDayForLastYear[i] ); + } + } + return pGeneralDataNode; } @@ -713,6 +726,14 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNumSongsPassedByPlayMode->GetChildValue( PlayModeToString(pm), m_iNumSongsPassedByPlayMode[pm] ); } + + { + XNode* pCaloriesByDayForLastYear = pNode->GetChild("CaloriesByDayForLastYear"); + if( pCaloriesByDayForLastYear ) + for( int i=0; iGetChildValue( DayInYearToString(i), m_iCaloriesByDayForLastYear[i] ); + + } } void Profile::AddStepTotals( int iTotalTapsAndHolds, int iTotalJumps, int iTotalHolds, int iTotalMines, int iTotalHands ) diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index fb6624fa0a..f9d16d6836 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -19,6 +19,7 @@ #include #include "XmlFile.h" #include "HighScore.h" +#include "TimeConstants.h" // @@ -106,6 +107,7 @@ public: int m_iNumSongsPlayedByMeter[MAX_METER+1]; int m_iNumSongsPassedByPlayMode[NUM_PLAY_MODES]; int m_iNumSongsPassedByGrade[NUM_GRADES]; + int m_iCaloriesByDayForLastYear[DAYS_IN_YEAR]; void AddStepTotals( int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands ); diff --git a/stepmania/src/ProfileHtml.cpp b/stepmania/src/ProfileHtml.cpp index 9ada899cdc..0412fdbdb8 100644 --- a/stepmania/src/ProfileHtml.cpp +++ b/stepmania/src/ProfileHtml.cpp @@ -872,7 +872,7 @@ void PrintBookkeeping( RageFile &f, const Profile *pProfile, CString sTitle, vec BEGIN_TABLE(4); for( int i=0; iGetCoinsByHour( 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); - for( int i=0; iGetCoinsByHour( coins ); int i; CString sTitle1, sData1; - for( i=0; i -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 60000 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 @@ -62,10 +62,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool IntDir=.\../Debug6 -TargetDir=\temp\stepmania\Program +TargetDir=\stepmania\stepmania\Program TargetName=StepMania-debug 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)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -82,23 +82,27 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # PROP Intermediate_Dir "../Debug_Xbox" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -XBCP=xbecopy.exe -# ADD BASE XBCP /NOLOGO -# ADD XBCP /NOLOGO -XBE=imagebld.exe -# ADD BASE XBE /nologo /stack:0x10000 /debug -# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c +# 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 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo 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 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 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c -# 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 +# ADD BASE XBE /nologo /stack:0x10000 /debug +# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe" +XBCP=xbecopy.exe +# ADD BASE XBCP /NOLOGO +# ADD XBCP /NOLOGO # 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 # End Special Build Tool @@ -135,10 +139,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /pdb:none /debug # Begin Special Build Tool IntDir=.\../Release6 -TargetDir=\temp\stepmania\Program +TargetDir=\stepmania\stepmania\Program TargetName=StepMania 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)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -156,24 +160,28 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # PROP Intermediate_Dir "../Release_Xbox" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -XBCP=xbecopy.exe -# ADD BASE XBCP /NOLOGO -# ADD XBCP /NOLOGO -XBE=imagebld.exe -# ADD BASE XBE /nologo /stack:0x10000 /debug -# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe" +CPP=cl.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 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 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo 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" # 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 # SUBTRACT LINK32 /pdb:none /debug -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -CPP=cl.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 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 +# ADD BASE XBE /nologo /stack:0x10000 /debug +# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe" +XBCP=xbecopy.exe +# ADD BASE XBCP /NOLOGO +# ADD XBCP /NOLOGO # 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 # End Special Build Tool @@ -1161,25 +1169,6 @@ SOURCE=.\Course.h # End 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 !IF "$(CFG)" == "StepMania - Win32 Debug" @@ -1918,6 +1907,25 @@ SOURCE=.\StyleInput.h # End 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 !IF "$(CFG)" == "StepMania - Win32 Debug" diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 95d104706f..0b1816fe27 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -803,6 +803,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + diff --git a/stepmania/src/TimeConstants.cpp b/stepmania/src/TimeConstants.cpp new file mode 100644 index 0000000000..bed7a46ce7 --- /dev/null +++ b/stepmania/src/TimeConstants.cpp @@ -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); +} + diff --git a/stepmania/src/TimeConstants.h b/stepmania/src/TimeConstants.h new file mode 100644 index 0000000000..928caecfee --- /dev/null +++ b/stepmania/src/TimeConstants.h @@ -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