Skip to content

Commit

Permalink
SHERLOCK: Performance tweak for resource loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 9, 2015
1 parent 13c6fea commit 6d11048
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion engines/sherlock/map.cpp
Expand Up @@ -96,7 +96,8 @@ void Map::loadData() {
// Load the list of location names
Common::SeekableReadStream *txtStream = _vm->_res->load("chess.txt");

while (txtStream->pos() < txtStream->size()) {
int streamSize = txtStream->size();
while (txtStream->pos() < streamSize) {
Common::String line;
char c;
while ((c = txtStream->readByte()) != '\0')
Expand Down
3 changes: 2 additions & 1 deletion engines/sherlock/resources.cpp
Expand Up @@ -293,7 +293,8 @@ ImageFile::~ImageFile() {
void ImageFile::load(Common::SeekableReadStream &stream, bool skipPalette, bool animImages) {
loadPalette(stream);

while (stream.pos() < stream.size()) {
int streamSize = stream.size();
while (stream.pos() < streamSize) {
ImageFrame frame;
frame._width = stream.readUint16LE() + 1;
frame._height = stream.readUint16LE() + 1;
Expand Down

0 comments on commit 6d11048

Please sign in to comment.