diff options
author | Paul Gilbert | 2015-02-10 08:42:59 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-10 08:42:59 -0500 |
commit | 8256f7c8dfcdefe7da352fd36b42dc0931a111f8 (patch) | |
tree | 6b6116c9421503019c8deee7ed84deec32585c50 /engines/xeen/party.cpp | |
parent | a612dd686c27303bdbe6b2dba89aef79bc8db8e0 (diff) | |
download | scummvm-rg350-8256f7c8dfcdefe7da352fd36b42dc0931a111f8.tar.gz scummvm-rg350-8256f7c8dfcdefe7da352fd36b42dc0931a111f8.tar.bz2 scummvm-rg350-8256f7c8dfcdefe7da352fd36b42dc0931a111f8.zip |
XEEN: Refacored face sprites loading into Roster and Character classes
Diffstat (limited to 'engines/xeen/party.cpp')
-rw-r--r-- | engines/xeen/party.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 6bff8fd995..e0110856a6 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -32,10 +32,22 @@ namespace Xeen { -void Roster::synchronize(Common::Serializer &s) { - if (s.isLoading()) - resize(30); +Roster::Roster() { + resize(TOTAL_CHARACTERS); + + for (int idx = 0; idx < TOTAL_CHARACTERS; ++idx) { + if (idx < XEEN_TOTAL_CHARACTERS) { + // Load new character resource + Common::String name = Common::String::format("char%02d.fac", idx + 1); + _charFaces[idx].load(name); + operator[](idx)._faceSprites = &_charFaces[idx]; + } else { + operator[](idx)._faceSprites = nullptr; + } + } +} +void Roster::synchronize(Common::Serializer &s) { for (uint i = 0; i < 30; ++i) (*this)[i].synchronize(s); } |