diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-09-09 19:37:36 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-09-09 19:37:36 +0200 |
commit | f0ccbcb281adbf7f5c13a7611682ff9f1006cf24 (patch) | |
tree | 07556930ef64979cf9a896450236156ed9e31218 /src/core | |
parent | cMusicManager, cDMAudio, radio position save/load, a few commands implemented (diff) | |
download | re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.tar re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.tar.gz re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.tar.bz2 re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.tar.lz re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.tar.xz re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.tar.zst re3-f0ccbcb281adbf7f5c13a7611682ff9f1006cf24.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Stats.cpp | 17 | ||||
-rw-r--r-- | src/core/Stats.h | 1 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index 9aff2758..9a5066ce 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -4,6 +4,7 @@ #include "Text.h" #include "World.h" #include "Pad.h" +#include "DMAudio.h" #include <climits> @@ -102,7 +103,7 @@ float CStats::LongestWheelieDist; float CStats::LongestStoppieDist; float CStats::Longest2WheelDist; -// --MIAMI: functions below are done except TODOs, but there are some to be moved from Frontend +// --MIAMI: functions below are done, but there are some to be moved from Frontend void CStats::Init() { @@ -198,9 +199,7 @@ void CStats::Init() NoMoreHurricanes = 0; ShowChaseStatOnScreen = 0; abSonyCDs[0] = 0; - // TODO(Miami): Change this with PopulateFavoriteRadioStationList(); !! - for (int i = 0; i < NUM_RADIOS; i++) - FavoriteRadioStationList[i] = 0.0f; + PopulateFavoriteRadioStationList(); NumPropertyOwned = 0; for (int i = 0; i < TOTAL_PROPERTIES; i++) @@ -633,7 +632,7 @@ void CStats::SaveStats(uint8 *buf, uint32 *size) CopyToBuf(buf, TotalLegitimateKills); CopyToBuf(buf, LastMissionPassedName); CopyToBuf(buf, CheatedCount); - // TODO(Miami): Set favourite radio stations!! + PopulateFavoriteRadioStationList(); CopyToBuf(buf, FavoriteRadioStationList); assert(buf - buf_start == *size); @@ -738,3 +737,11 @@ void CStats::LoadStats(uint8 *buf, uint32 size) assert(buf - buf_start == size); #undef CopyFromBuf } + +void +CStats::PopulateFavoriteRadioStationList() +{ + float* pListenTimeArray = DMAudio.GetListenTimeArray(); + for (int i = 0; i < NUM_RADIOS; i++) + FavoriteRadioStationList[i] = pListenTimeArray[i]; +}
\ No newline at end of file diff --git a/src/core/Stats.h b/src/core/Stats.h index aac54af5..21cb67ef 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -144,5 +144,6 @@ public: static void LongestTimeInBloodRing(int32); static void AddPropertyAsOwned(int32); + static void PopulateFavoriteRadioStationList(); static float GetFavoriteRadioStationList(int32); }; |