diff options
Diffstat (limited to 'engines/fullpipe/gfx.cpp')
-rw-r--r-- | engines/fullpipe/gfx.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index dcd5c33740..eba5d442d5 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -290,8 +290,8 @@ bool GameObject::load(MfcArchive &file) { _id = file.readUint16LE(); _objectName = file.readPascalString(); - _ox = file.readUint32LE(); - _oy = file.readUint32LE(); + _ox = file.readSint32LE(); + _oy = file.readSint32LE(); _priority = file.readUint16LE(); if (g_fp->_gameProjectVersion >= 11) { @@ -353,7 +353,6 @@ bool GameObject::getPicAniInfo(PicAniInfo *info) { info->ox = _ox; info->oy = _oy; info->priority = _priority; - warning("Yep %d", _id); return true; } @@ -495,8 +494,8 @@ bool Picture::load(MfcArchive &file) { debugC(5, kDebugLoading, "Picture::load()"); MemoryObject::load(file); - _x = file.readUint32LE(); - _y = file.readUint32LE(); + _x = file.readSint32LE(); + _y = file.readSint32LE(); _field_44 = file.readUint16LE(); assert(g_fp->_gameProjectVersion >= 2); @@ -786,8 +785,8 @@ Bitmap::~Bitmap() { void Bitmap::load(Common::ReadStream *s) { debugC(5, kDebugLoading, "Bitmap::load()"); - _x = s->readUint32LE(); - _y = s->readUint32LE(); + _x = s->readSint32LE(); + _y = s->readSint32LE(); _width = s->readUint32LE(); _height = s->readUint32LE(); s->readUint32LE(); // pixels @@ -806,7 +805,7 @@ bool Bitmap::isPixelHitAtPos(int x, int y) { if (!_surface) return false; - return ((*((int32 *)_surface->getBasePtr(x, y)) & 0xff000000) != 0); + return ((*((int32 *)_surface->getBasePtr(x - _x, y - _y)) & 0xff) != 0); } void Bitmap::decode(int32 *palette) { @@ -1122,28 +1121,31 @@ void Bitmap::copier(uint32 *dest, byte *src, int len, int32 *palette, bool cb05_ } Bitmap *Bitmap::reverseImage(bool flip) { + Bitmap *b = new Bitmap(this); + if (flip) - _flipping = Graphics::FLIP_H; - else - _flipping = Graphics::FLIP_NONE; + b->_flipping ^= Graphics::FLIP_H; - return this; + return b; } Bitmap *Bitmap::flipVertical() { - _flipping = Graphics::FLIP_V; + Bitmap *b = new Bitmap(this); + + b->_flipping ^= Graphics::FLIP_V; - return this; + return b; } void Bitmap::drawShaded(int type, int x, int y, byte *palette, int alpha) { - warning("STUB: Bitmap::drawShaded(%d, %d, %d)", type, x, y); + if (alpha != 255) + warning("STUB: Bitmap::drawShaded(%d, %d, %d, %d)", type, x, y, alpha); putDib(x, y, (int32 *)palette, alpha); } void Bitmap::drawRotated(int x, int y, int angle, byte *palette, int alpha) { - warning("STUB: Bitmap::drawShaded(%d, %d, %d)", x, y, angle); + warning("STUB: Bitmap::drawRotated(%d, %d, %d, %d)", x, y, angle, alpha); putDib(x, y, (int32 *)palette, alpha); } |