aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/object.cpp
diff options
context:
space:
mode:
authorlukaslw2014-05-17 23:25:31 +0200
committerlukaslw2014-06-22 20:08:08 +0200
commit3d590627eda86a56080bbb55f5b51c19b55cd3a1 (patch)
treefdce82a04131f38d3de79dff14f0e07a2f1b9567 /engines/prince/object.cpp
parentd5f2b97c3e291832317e950773997e3f206b8975 (diff)
downloadscummvm-rg350-3d590627eda86a56080bbb55f5b51c19b55cd3a1.tar.gz
scummvm-rg350-3d590627eda86a56080bbb55f5b51c19b55cd3a1.tar.bz2
scummvm-rg350-3d590627eda86a56080bbb55f5b51c19b55cd3a1.zip
PRINCE: Room struct implementation and objects drawing fix
Diffstat (limited to 'engines/prince/object.cpp')
-rw-r--r--engines/prince/object.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/prince/object.cpp b/engines/prince/object.cpp
index 4148cdf854..9386eaa496 100644
--- a/engines/prince/object.cpp
+++ b/engines/prince/object.cpp
@@ -32,7 +32,7 @@
namespace Prince {
-Object::Object() : _surface(NULL), _x(0), _y(0), _z(0) {
+Object::Object() : _surface(NULL), _x(0), _y(0), _z(0), _overlay(0) {
}
Object::~Object() {
@@ -45,9 +45,11 @@ Object::~Object() {
void Object::loadSurface(Common::SeekableReadStream &stream) {
stream.skip(4);
-
+ int width = stream.readUint16LE();
+ int height = stream.readUint16LE();
_surface = new Graphics::Surface();
- _surface->create(stream.readUint16LE(), stream.readUint16LE(), Graphics::PixelFormat::createFormatCLUT8());
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
for (int h = 0; h < _surface->h; ++h) {
stream.read(_surface->getBasePtr(0, h), _surface->w);
}
@@ -71,11 +73,12 @@ bool Object::loadFromStream(Common::SeekableReadStream &stream) {
loadSurface(*obStream);
delete obStream;
+ _overlay = stream.readUint16LE();
_z = stream.readUint16LE();
stream.seek(pos + 16);
- debug("Object x %d, y %d, z %d", _x, _y, _z);
+ debug("Object x %d, y %d, z %d overlay %d", _x, _y, _z, _overlay);
return true;
}