From b4a4f779e3f45e5034f5985a5bc50d4dfb9b06f0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 17 Oct 2005 14:20:18 +0000 Subject: Fix walking in IHNM. It appeared that BG mask wasn't flipped upside down when everything else is :). svn-id: r19136 --- saga/image.cpp | 4 ++-- saga/saga.h | 2 +- saga/scene.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/saga/image.cpp b/saga/image.cpp index ed2320ef10..95b947e598 100644 --- a/saga/image.cpp +++ b/saga/image.cpp @@ -47,7 +47,7 @@ static int granulate(int value, int granularity) { } int SagaEngine::decodeBGImage(const byte *image_data, size_t image_size, - byte **output_buf, size_t *output_buf_len, int *w, int *h) { + byte **output_buf, size_t *output_buf_len, int *w, int *h, bool flip) { ImageHeader hdr; int modex_height; const byte *RLE_data_ptr; @@ -90,7 +90,7 @@ int SagaEngine::decodeBGImage(const byte *image_data, size_t image_size, unbankBGImage(out_buf, decode_buf, hdr.width, hdr.height); // For some reason bg images in IHNM are upside down - if (getGameType() == GType_IHNM) { + if (getGameType() == GType_IHNM && !flip) { flipImage(out_buf, hdr.width, hdr.height); } diff --git a/saga/saga.h b/saga/saga.h index b6a245e410..0ba789bf3c 100644 --- a/saga/saga.h +++ b/saga/saga.h @@ -632,7 +632,7 @@ private: public: int decodeBGImage(const byte *image_data, size_t image_size, - byte **output_buf, size_t *output_buf_len, int *w, int *h); + byte **output_buf, size_t *output_buf_len, int *w, int *h, bool flip = false); const byte *getImagePal(const byte *image_data, size_t image_size); void loadStrings(StringsTable &stringsTable, const byte *stringsPointer, size_t stringsLength); diff --git a/saga/scene.cpp b/saga/scene.cpp index 13bd9d929a..4e77bc02a2 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -1040,7 +1040,7 @@ void Scene::processSceneResources() { _bgMask.res_len = resourceDataLength; _bgMask.loaded = 1; _vm->decodeBGImage(_bgMask.res_buf, _bgMask.res_len, &_bgMask.buf, - &_bgMask.buf_len, &_bgMask.w, &_bgMask.h); + &_bgMask.buf_len, &_bgMask.w, &_bgMask.h, true); // At least in ITE the mask needs to be clipped. -- cgit v1.2.3