MADS: Completely remove synchronizeString in favour of syncString

This commit is contained in:
Paul Gilbert 2014-05-20 21:22:01 -04:00
parent df23dff517
commit 6bfc9ce8f2
5 changed files with 3 additions and 27 deletions

View File

@ -678,7 +678,7 @@ void MADSAction::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(_statusTextIndex);
s.syncAsSint16LE(_hotspotId);
_savedFields.synchronize(s);
synchronizeString(s, _sentence);
s.syncString(_sentence);
s.syncAsSint16LE(_verbType);
s.syncAsSint16LE(_prepType);

View File

@ -457,7 +457,7 @@ void Game::synchronize(Common::Serializer &s, bool phase1) {
s.syncAsSint16LE(_trigger);
s.syncAsUint16LE(_triggerSetupMode);
s.syncAsUint16LE(_triggerMode);
synchronizeString(s, _aaName);
s.syncString(_aaName);
s.syncAsSint16LE(_lastSave);
_scene.synchronize(s);

View File

@ -755,7 +755,7 @@ void Player::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(_totalDistance);
s.syncAsSint16LE(_velocity);
s.syncAsUint16LE(_frameCount);
synchronizeString(s, _spritesPrefix);
s.syncString(_spritesPrefix);
s.syncAsUint32LE(_priorTimer);
s.syncAsByte(_loadsFirst);
s.syncAsByte(_loadedFirst);

View File

@ -413,23 +413,4 @@ void SynchronizedList::synchronize(Common::Serializer &s) {
}
}
/*------------------------------------------------------------------------*/
void synchronizeString(Common::Serializer &s, Common::String &str) {
int len = str.size();
s.syncAsUint16LE(len);
if (s.isSaving()) {
s.syncBytes((byte *)str.c_str(), len);
} else {
str.clear();
char c;
for (int i = 0; i < len; ++i) {
s.syncAsByte(c);
str += c;
}
}
}
} // End of namespace MADS

View File

@ -84,11 +84,6 @@ public:
void synchronize(Common::Serializer &s);
};
/**
* Synchronize string support method
*/
void synchronizeString(Common::Serializer &s, Common::String &str);
} // End of namespace MADS
#endif /* MADS_RESOURCES_H */