Skip to content

Commit

Permalink
PINK: removed readCount function
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent c75e048 commit e979dda
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
11 changes: 0 additions & 11 deletions engines/pink/archive.cpp
Expand Up @@ -228,17 +228,6 @@ void Archive::mapObject(Object *obj) {
_objectIdMap.push_back(0);
}

int Archive::readCount() {
int count = _readStream->readUint16LE();

if (count == 0xffff) {
assert(0);
count = _readStream->readUint32LE();
}

return count;
}

Object *Archive::readObject() {
bool isCopyReturned;
Object *res = parseObject(isCopyReturned);
Expand Down
1 change: 0 additions & 1 deletion engines/pink/archive.h
Expand Up @@ -44,7 +44,6 @@ class Archive {

void mapObject(Object *obj);

int readCount();
byte readByte() { return _readStream->readByte(); }
uint32 readDWORD() { return _readStream->readUint32LE(); }
uint16 readWORD() { return _readStream->readUint16LE(); }
Expand Down
4 changes: 2 additions & 2 deletions engines/pink/utils.h
Expand Up @@ -31,7 +31,7 @@ template <typename T>
class Array : public Common::Array<T>, public Object {
public:
void deserialize(Archive &archive) {
uint size = archive.readCount();
uint size = archive.readWORD();
this->resize(size);
for (uint i = 0; i < size; ++i) {
this->data()[i] = reinterpret_cast<T>(archive.readObject()); // dynamic_cast needs to know complete type
Expand All @@ -42,7 +42,7 @@ class Array : public Common::Array<T>, public Object {
class StringArray : public Common::StringArray {
public:
void deserialize(Archive &archive) {
uint32 size = archive.readCount();
uint32 size = archive.readWORD();
this->resize(size);
for (uint i = 0; i < size; ++i) {
this->data()[i] = archive.readString();
Expand Down

0 comments on commit e979dda

Please sign in to comment.