diff options
author | Paul Gilbert | 2017-01-03 00:44:52 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-03 00:44:52 -0500 |
commit | 96c783899c9c05f0e32da1668ae990d50f46b7f1 (patch) | |
tree | c743e19cafb86c8df53d2210eb6c91ea381d749d /engines | |
parent | da0857e10f8b6ae28267af3fd1a6ef86888a6ca5 (diff) | |
download | scummvm-rg350-96c783899c9c05f0e32da1668ae990d50f46b7f1.tar.gz scummvm-rg350-96c783899c9c05f0e32da1668ae990d50f46b7f1.tar.bz2 scummvm-rg350-96c783899c9c05f0e32da1668ae990d50f46b7f1.zip |
TITANIC: Fixes and cleanup for Arboretum seasonal noises
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/sound/season_noises.cpp | 19 | ||||
-rw-r--r-- | engines/titanic/sound/season_noises.h | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/engines/titanic/sound/season_noises.cpp b/engines/titanic/sound/season_noises.cpp index 14689d5337..5f139e728f 100644 --- a/engines/titanic/sound/season_noises.cpp +++ b/engines/titanic/sound/season_noises.cpp @@ -31,7 +31,7 @@ BEGIN_MESSAGE_MAP(CSeasonNoises, CViewAutoSoundPlayer) ON_MESSAGE(LoadSuccessMsg) END_MESSAGE_MAP() -CSeasonNoises::CSeasonNoises() : CViewAutoSoundPlayer(), _seasonNumber(0), +CSeasonNoises::CSeasonNoises() : CViewAutoSoundPlayer(), _seasonNumber(SEASON_SUMMER), _springName("NULL"), _summerName("NULL"), _autumnName("NULL"), _winterName("NULL") { } @@ -48,7 +48,7 @@ void CSeasonNoises::save(SimpleFile *file, int indent) { void CSeasonNoises::load(SimpleFile *file) { file->readNumber(); - _seasonNumber = file->readNumber(); + _seasonNumber = (Season)file->readNumber(); _springName = file->readString(); _summerName = file->readString(); _autumnName = file->readString(); @@ -58,7 +58,7 @@ void CSeasonNoises::load(SimpleFile *file) { } bool CSeasonNoises::ChangeSeasonMsg(CChangeSeasonMsg *msg) { - _seasonNumber = (_seasonNumber + 1) % 4; + _seasonNumber = (Season)(((int)_seasonNumber + 1) % 4); CActMsg actMsg("Update"); actMsg.execute(this); @@ -67,6 +67,7 @@ bool CSeasonNoises::ChangeSeasonMsg(CChangeSeasonMsg *msg) { bool CSeasonNoises::EnterViewMsg(CEnterViewMsg *msg) { CActMsg actMsg("Update"); + actMsg.execute(this); return true; } @@ -74,18 +75,18 @@ bool CSeasonNoises::ActMsg(CActMsg *msg) { msg->_action = "Update"; switch (_seasonNumber) { - case 0: - _filename = _springName; - break; - case 1: + case SEASON_SUMMER: _filename = _summerName; break; - case 2: + case SEASON_AUTUMN: _filename = _autumnName; break; - case 3: + case SEASON_WINTER: _filename = _winterName; break; + case SEASON_SPRING: + _filename = _springName; + break; default: break; } diff --git a/engines/titanic/sound/season_noises.h b/engines/titanic/sound/season_noises.h index 796628d10d..cab8d5907f 100644 --- a/engines/titanic/sound/season_noises.h +++ b/engines/titanic/sound/season_noises.h @@ -34,7 +34,7 @@ class CSeasonNoises : public CViewAutoSoundPlayer { bool ActMsg(CActMsg *msg); bool LoadSuccessMsg(CLoadSuccessMsg *msg); private: - int _seasonNumber; + Season _seasonNumber; CString _springName; CString _summerName; CString _autumnName; |