Fix walking in IHNM. It appeared that BG mask wasn't flipped upside down

when everything else is :).

svn-id: r19136
This commit is contained in:
Eugene Sandulenko 2005-10-17 14:20:18 +00:00
parent f3c387f328
commit b4a4f779e3
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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.