From 9934b70733f3322e1136d805f927fb0f628d1dfc Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 16 Oct 2009 07:37:12 +0000 Subject: [PATCH] removed MemoryReadStreamEndian, used regular memory stream classes. svn-id: r45150 --- engines/teenagent/objects.cpp | 28 ++++++++++++++-------------- engines/teenagent/objects.h | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index f42a5f31408..0ddcbf54fea 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -31,20 +31,20 @@ namespace TeenAgent { void Rect::load(byte * src) { _base = src; - Common::MemoryReadStreamEndian ins(src, 8); - left = ins.readUint16(); - top = ins.readUint16(); - right = ins.readUint16(); - bottom = ins.readUint16(); + Common::MemoryReadStream ins(src, 8); + left = ins.readUint16LE(); + top = ins.readUint16LE(); + right = ins.readUint16LE(); + bottom = ins.readUint16LE(); } void Rect::save() { assert(_base != NULL); - //Common::MemoryWriteStreamEndian out(_base, 8); //FIXME: maybe add this class to common? - WRITE_LE_UINT16(_base + 0, left); - WRITE_LE_UINT16(_base + 2, top); - WRITE_LE_UINT16(_base + 4, right); - WRITE_LE_UINT16(_base + 6, bottom); + Common::MemoryWriteStream outs(_base, 8); + outs.writeUint16LE(left); + outs.writeUint16LE(top); + outs.writeUint16LE(right); + outs.writeUint16LE(bottom); } void Rect::render(Graphics::Surface *surface, uint8 color) const { @@ -131,13 +131,13 @@ void InventoryObject::load(byte *src) { } void UseHotspot::load(byte *src) { - Common::MemoryReadStreamEndian in(src, 9); + Common::MemoryReadStream in(src, 9); inventory_id = in.readByte(); object_id = in.readByte(); unk02 = in.readByte(); - x = in.readUint16(); - y = in.readUint16(); - callback = in.readUint16(); + x = in.readUint16LE(); + y = in.readUint16LE(); + callback = in.readUint16LE(); } void Walkbox::dump() { diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h index 60b5d5ad2cf..ecd1dd71e98 100644 --- a/engines/teenagent/objects.h +++ b/engines/teenagent/objects.h @@ -27,7 +27,6 @@ #define TEENAGENT_OBJECTS_H #include "common/rect.h" -#include "common/stream.h" #include "graphics/surface.h" namespace TeenAgent {