From 33d04d5aa4dbccea22205bfb49378f1ac675281b Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sat, 17 Feb 2007 20:50:50 +0000 Subject: changed CNV loading code to be endian-safe svn-id: r25663 --- engines/parallaction/graphics.cpp | 12 +++++------- 1 file 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; -- cgit v1.2.3