aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent/surface.cpp
diff options
context:
space:
mode:
authorChristoph Mallon2011-08-06 13:21:38 +0200
committerChristoph Mallon2011-08-07 15:19:08 +0200
commita5675c3dbe799acf6ced70ba9e83cdd88252bce9 (patch)
treefada35dbb2738e21bb4140c3588266cf024263a5 /engines/teenagent/surface.cpp
parent0e6751372a80716cadddd926eeb6965ae6c00a44 (diff)
downloadscummvm-rg350-a5675c3dbe799acf6ced70ba9e83cdd88252bce9.tar.gz
scummvm-rg350-a5675c3dbe799acf6ced70ba9e83cdd88252bce9.tar.bz2
scummvm-rg350-a5675c3dbe799acf6ced70ba9e83cdd88252bce9.zip
TEENAGENT: Pass streams as references.
Diffstat (limited to 'engines/teenagent/surface.cpp')
-rw-r--r--engines/teenagent/surface.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp
index 2e23c7a8ed..e8b5a8ad59 100644
--- a/engines/teenagent/surface.cpp
+++ b/engines/teenagent/surface.cpp
@@ -33,26 +33,26 @@ Surface::~Surface() {
free();
}
-void Surface::load(Common::SeekableReadStream *stream, Type type) {
+void Surface::load(Common::SeekableReadStream &stream, Type type) {
//debug(0, "load()");
free();
x = y = 0;
- uint16 w_ = stream->readUint16LE();
- uint16 h_ = stream->readUint16LE();
+ uint16 w_ = stream.readUint16LE();
+ uint16 h_ = stream.readUint16LE();
if (type != kTypeLan) {
- uint16 pos = stream->readUint16LE();
+ uint16 pos = stream.readUint16LE();
x = pos % 320;
y = pos / 320;
}
//debug(0, "declared info: %ux%u (%04xx%04x) -> %u,%u", w_, h_, w_, h_, x, y);
- if (stream->eos() || w_ == 0)
+ if (stream.eos() || w_ == 0)
return;
- if (w_ * h_ > stream->size()) {
+ if (w_ * h_ > stream.size()) {
debug(0, "invalid surface %ux%u -> %u,%u", w_, h_, x, y);
return;
}
@@ -60,7 +60,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) {
//debug(0, "creating surface %ux%u -> %u,%u", w_, h_, x, y);
create(w_, h_, Graphics::PixelFormat::createFormatCLUT8());
- stream->read(pixels, w_ * h_);
+ stream.read(pixels, w_ * h_);
}
Common::Rect Surface::render(Graphics::Surface *surface, int dx, int dy, bool mirror, Common::Rect src_rect, uint zoom) const {