aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/gfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/gfx.cpp')
-rw-r--r--engines/fullpipe/gfx.cpp72
1 files changed, 37 insertions, 35 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 42846850ca..eba5d442d5 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -58,7 +58,7 @@ Background::~Background() {
}
bool Background::load(MfcArchive &file) {
- debug(5, "Background::load()");
+ debugC(5, kDebugLoading, "Background::load()");
_bgname = file.readPascalString();
int count = file.readUint16LE();
@@ -80,7 +80,7 @@ bool Background::load(MfcArchive &file) {
_bigPictureArray = (BigPicture ***)calloc(_bigPictureArray1Count, sizeof(BigPicture **));
- debug(6, "bigPictureArray[%d][%d]", _bigPictureArray1Count, _bigPictureArray2Count);
+ debugC(6, kDebugLoading, "bigPictureArray[%d][%d]", _bigPictureArray1Count, _bigPictureArray2Count);
for (int i = 0; i < _bigPictureArray1Count; i++) {
_bigPictureArray[i] = (BigPicture **)calloc(_bigPictureArray2Count, sizeof(BigPicture *));
@@ -137,7 +137,7 @@ PictureObject::PictureObject(PictureObject *src) : GameObject(src) {
}
bool PictureObject::load(MfcArchive &file, bool bigPicture) {
- debug(5, "PictureObject::load()");
+ debugC(5, kDebugLoading, "PictureObject::load()");
GameObject::load(file);
if (bigPicture)
@@ -282,7 +282,7 @@ GameObject::~GameObject() {
}
bool GameObject::load(MfcArchive &file) {
- debug(5, "GameObject::load()");
+ debugC(5, kDebugLoading, "GameObject::load()");
_okeyCode = 0;
_flags = 0;
_field_20 = 0;
@@ -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;
}
@@ -464,7 +463,7 @@ Picture::~Picture() {
}
void Picture::freePicture() {
- debug(5, "Picture::freePicture(): file: %s", _memfilename);
+ debugC(5, kDebugMemory, "Picture::freePicture(): file: %s", _memfilename);
if (_bitmap) {
if (testFlags() && !_field_54) {
@@ -492,11 +491,11 @@ void Picture::freePixelData() {
}
bool Picture::load(MfcArchive &file) {
- debug(5, "Picture::load()");
+ 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);
@@ -526,7 +525,7 @@ bool Picture::load(MfcArchive &file) {
getData();
- debug(5, "Picture::load: loaded <%s>", _memfilename);
+ debugC(5, kDebugLoading, "Picture::load: loaded <%s>", _memfilename);
return true;
}
@@ -546,7 +545,7 @@ void Picture::setAOIDs() {
}
void Picture::init() {
- debug(5, "Picture::init(), %s", _memfilename);
+ debugC(5, kDebugLoading, "Picture::init(), %s", _memfilename);
MemoryObject::getData();
@@ -567,7 +566,7 @@ Common::Point *Picture::getDimensions(Common::Point *p) {
void Picture::getDibInfo() {
int off = _dataSize & ~0xf;
- debug(9, "Picture::getDibInfo: _dataSize: %d", _dataSize);
+ debugC(9, kDebugLoading, "Picture::getDibInfo: _dataSize: %d", _dataSize);
if (!_dataSize) {
warning("Picture::getDibInfo(): Empty data size");
@@ -605,7 +604,7 @@ void Picture::draw(int x, int y, int style, int angle) {
int x1 = x;
int y1 = y;
- debug(7, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
+ debugC(7, kDebugDrawing, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
if (x != -1)
x1 = x;
@@ -620,7 +619,7 @@ void Picture::draw(int x, int y, int style, int angle) {
return;
if ((_alpha & 0xff) < 0xff) {
- debug(7, "Picture:draw: alpha = %0x", _alpha);
+ debugC(7, kDebugDrawing, "Picture:draw: alpha = %0x", _alpha);
}
byte *pal = _paletteData;
@@ -784,10 +783,10 @@ Bitmap::~Bitmap() {
}
void Bitmap::load(Common::ReadStream *s) {
- debug(5, "Bitmap::load()");
+ 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
@@ -795,8 +794,8 @@ void Bitmap::load(Common::ReadStream *s) {
_dataSize = s->readUint32LE();
_flags = s->readUint32LE();
- debug(8, "Bitmap: x: %d y: %d w: %d h: %d dataSize: 0x%x", _x, _y, _width, _height, _dataSize);
- debug(8, "Bitmap: type: %s (0x%04x) flags: 0x%x", Common::tag2string(_type).c_str(), _type, _flags);
+ debugC(8, kDebugLoading, "Bitmap: x: %d y: %d w: %d h: %d dataSize: 0x%x", _x, _y, _width, _height, _dataSize);
+ debugC(8, kDebugLoading, "Bitmap: type: %s (0x%04x) flags: 0x%x", Common::tag2string(_type).c_str(), _type, _flags);
}
bool Bitmap::isPixelHitAtPos(int x, int y) {
@@ -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) {
@@ -821,7 +820,7 @@ void Bitmap::decode(int32 *palette) {
}
void Bitmap::putDib(int x, int y, int32 *palette, int alpha) {
- debug(7, "Bitmap::putDib(%d, %d)", x, y);
+ debugC(7, kDebugDrawing, "Bitmap::putDib(%d, %d)", x, y);
int x1 = x - g_fp->_sceneRect.left;
int y1 = y - g_fp->_sceneRect.top;
@@ -868,11 +867,11 @@ bool Bitmap::putDibRB(int32 *palette) {
uint16 *srcPtr;
if (!palette) {
- debug(2, "Bitmap::putDibRB(): Both global and local palettes are empty");
+ debugC(2, kDebugDrawing, "Bitmap::putDibRB(): Both global and local palettes are empty");
return false;
}
- debug(8, "Bitmap::putDibRB()");
+ debugC(8, kDebugDrawing, "Bitmap::putDibRB()");
endy = _height - 1;
@@ -1122,34 +1121,37 @@ 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);
}
bool BigPicture::load(MfcArchive &file) {
- debug(5, "BigPicture::load()");
+ debugC(5, kDebugLoading, "BigPicture::load()");
Picture::load(file);
return true;
@@ -1190,7 +1192,7 @@ Shadows::Shadows() {
}
bool Shadows::load(MfcArchive &file) {
- debug(5, "Shadows::load()");
+ debugC(5, kDebugLoading, "Shadows::load()");
_sceneId = file.readUint32LE();
_staticAniObjectId = file.readUint32LE();
_movementId = file.readUint32LE();