aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2007-02-17 20:50:50 +0000
committerNicola Mettifogo2007-02-17 20:50:50 +0000
commit33d04d5aa4dbccea22205bfb49378f1ac675281b (patch)
treeba6e6c03aef557adef8ad3f71b1cb5228467a4e0
parentb777c09ac0271f9b41e445dbc74e7f5afe400bc6 (diff)
downloadscummvm-rg350-33d04d5aa4dbccea22205bfb49378f1ac675281b.tar.gz
scummvm-rg350-33d04d5aa4dbccea22205bfb49378f1ac675281b.tar.bz2
scummvm-rg350-33d04d5aa4dbccea22205bfb49378f1ac675281b.zip
changed CNV loading code to be endian-safe
svn-id: r25663
-rw-r--r--engines/parallaction/graphics.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index acac742550..6f1ff71ff1 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -961,11 +961,9 @@ void Graphics::loadExternalCnv(const char *filename, Cnv *cnv) {
if (!stream.open(path))
errorFileNotFound(path);
- cnv->_count = cnv->_width = cnv->_height = 0;
-
- stream.read(&cnv->_count, 1);
- stream.read(&cnv->_width, 1);
- stream.read(&cnv->_height, 1);
+ cnv->_count = stream.readByte();
+ cnv->_width = stream.readByte();
+ cnv->_height = stream.readByte();
cnv->_array = (byte**)memAlloc(cnv->_count * sizeof(byte*));
@@ -1000,8 +998,8 @@ void Graphics::loadExternalStaticCnv(const char *filename, StaticCnv *cnv) {
cnv->_width = cnv->_height = 0;
stream.skip(1);
- stream.read(&cnv->_width, 1);
- stream.read(&cnv->_height, 1);
+ cnv->_width = stream.readByte();
+ cnv->_height = stream.readByte();
uint16 size = cnv->_width*cnv->_height;