HUGO: Fix labyrinth bug in Hugo 2 for Windows
svn-id: r52485
This commit is contained in:
parent
64313cd7f1
commit
ca74eb3e8b
5 changed files with 5 additions and 17 deletions
|
@ -523,9 +523,6 @@ void HugoEngine::processMaze() {
|
||||||
|
|
||||||
debugC(1, kDebugEngine, "processMaze");
|
debugC(1, kDebugEngine, "processMaze");
|
||||||
|
|
||||||
//actlist alnewscr = {&aheroxy,&astophero,&aherostop,&anewscr,NULL};
|
|
||||||
//actlist_pt alist = &alnewscr[0];
|
|
||||||
|
|
||||||
currImage = _hero->currImagePtr; // Get ptr to current image
|
currImage = _hero->currImagePtr; // Get ptr to current image
|
||||||
x1 = _hero->x + currImage->x1; // Left edge of object
|
x1 = _hero->x + currImage->x1; // Left edge of object
|
||||||
x2 = _hero->x + currImage->x2; // Right edge
|
x2 = _hero->x + currImage->x2; // Right edge
|
||||||
|
@ -534,41 +531,29 @@ void HugoEngine::processMaze() {
|
||||||
|
|
||||||
if (x1 < _maze.x1) {
|
if (x1 < _maze.x1) {
|
||||||
// Exit west
|
// Exit west
|
||||||
// anewscr.screen = *_screen_p - 1;
|
|
||||||
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p - 1;
|
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p - 1;
|
||||||
// aheroxy.x = _maze.x2 - SHIFT - (x2 - x1);
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.x = _maze.x2 - SHIFT - (x2 - x1);
|
_actListArr[_alNewscrIndex][0].a2.x = _maze.x2 - SHIFT - (x2 - x1);
|
||||||
// aheroxy.y = _hero_p->y;
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.y = _hero->y;
|
_actListArr[_alNewscrIndex][0].a2.y = _hero->y;
|
||||||
_status.routeIndex = -1;
|
_status.routeIndex = -1;
|
||||||
scheduler().insertActionList(_alNewscrIndex);
|
scheduler().insertActionList(_alNewscrIndex);
|
||||||
} else if (x2 > _maze.x2) {
|
} else if (x2 > _maze.x2) {
|
||||||
// Exit east
|
// Exit east
|
||||||
// anewscr.screen = *_screen_p + 1;
|
|
||||||
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p + 1;
|
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p + 1;
|
||||||
// aheroxy.x = _maze.x1 + SHIFT;
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.x = _maze.x1 + SHIFT;
|
_actListArr[_alNewscrIndex][0].a2.x = _maze.x1 + SHIFT;
|
||||||
// aheroxy.y = _hero_p->y;
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.y = _hero->y;
|
_actListArr[_alNewscrIndex][0].a2.y = _hero->y;
|
||||||
_status.routeIndex = -1;
|
_status.routeIndex = -1;
|
||||||
scheduler().insertActionList(_alNewscrIndex);
|
scheduler().insertActionList(_alNewscrIndex);
|
||||||
} else if (y1 < _maze.y1 - SHIFT) {
|
} else if (y1 < _maze.y1 - SHIFT) {
|
||||||
// Exit north
|
// Exit north
|
||||||
// anewscr.screen = *_screen_p - _maze.size;
|
|
||||||
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p - _maze.size;
|
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p - _maze.size;
|
||||||
// aheroxy.x = _maze.x3; // special offset for perspective
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.x = _maze.x3;
|
_actListArr[_alNewscrIndex][0].a2.x = _maze.x3;
|
||||||
// aheroxy.y = _maze.y2 - SHIFT - (y2 - y1);
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.y = _maze.y2 - SHIFT - (y2 - y1);
|
_actListArr[_alNewscrIndex][0].a2.y = _maze.y2 - SHIFT - (y2 - y1);
|
||||||
_status.routeIndex = -1;
|
_status.routeIndex = -1;
|
||||||
scheduler().insertActionList(_alNewscrIndex);
|
scheduler().insertActionList(_alNewscrIndex);
|
||||||
} else if (y2 > _maze.y2 - SHIFT / 2) {
|
} else if (y2 > _maze.y2 - SHIFT / 2) {
|
||||||
// Exit south
|
// Exit south
|
||||||
// anewscr.screen = *_screen_p + _maze.size;
|
|
||||||
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p + _maze.size;
|
_actListArr[_alNewscrIndex][3].a8.screenIndex = *_screen_p + _maze.size;
|
||||||
// aheroxy.x = _maze.x4; // special offset for perspective
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.x = _maze.x4;
|
_actListArr[_alNewscrIndex][0].a2.x = _maze.x4;
|
||||||
// aheroxy.y = _maze.y1 + SHIFT;
|
|
||||||
_actListArr[_alNewscrIndex][0].a2.y = _maze.y1 + SHIFT;
|
_actListArr[_alNewscrIndex][0].a2.y = _maze.y1 + SHIFT;
|
||||||
_status.routeIndex = -1;
|
_status.routeIndex = -1;
|
||||||
scheduler().insertActionList(_alNewscrIndex);
|
scheduler().insertActionList(_alNewscrIndex);
|
||||||
|
|
|
@ -848,6 +848,7 @@ bool HugoEngine::loadHugoDat() {
|
||||||
case INIT_MAZE: // 30
|
case INIT_MAZE: // 30
|
||||||
_actListArr[i][j].a30.timer = in.readSint16BE();
|
_actListArr[i][j].a30.timer = in.readSint16BE();
|
||||||
_actListArr[i][j].a30.mazeSize = in.readByte();
|
_actListArr[i][j].a30.mazeSize = in.readByte();
|
||||||
|
_actListArr[i][j].a30.x1 = in.readSint16BE();
|
||||||
_actListArr[i][j].a30.y1 = in.readSint16BE();
|
_actListArr[i][j].a30.y1 = in.readSint16BE();
|
||||||
_actListArr[i][j].a30.x2 = in.readSint16BE();
|
_actListArr[i][j].a30.x2 = in.readSint16BE();
|
||||||
_actListArr[i][j].a30.y2 = in.readSint16BE();
|
_actListArr[i][j].a30.y2 = in.readSint16BE();
|
||||||
|
@ -1130,6 +1131,7 @@ bool HugoEngine::loadHugoDat() {
|
||||||
in.readSint16BE();
|
in.readSint16BE();
|
||||||
in.readSint16BE();
|
in.readSint16BE();
|
||||||
in.readSint16BE();
|
in.readSint16BE();
|
||||||
|
in.readSint16BE();
|
||||||
in.readByte();
|
in.readByte();
|
||||||
break;
|
break;
|
||||||
case EXIT_MAZE: // 31
|
case EXIT_MAZE: // 31
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "hugo/game.h"
|
#include "hugo/game.h"
|
||||||
|
|
||||||
#define HUGO_DAT_VER_MAJ 0 // 1 byte
|
#define HUGO_DAT_VER_MAJ 0 // 1 byte
|
||||||
#define HUGO_DAT_VER_MIN 18 // 1 byte
|
#define HUGO_DAT_VER_MIN 19 // 1 byte
|
||||||
#define DATAALIGNMENT 4
|
#define DATAALIGNMENT 4
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
|
@ -1154,6 +1154,7 @@ void writeActListArray(FILE *outFile, const actList actListArr[], int nbrElem) {
|
||||||
case INIT_MAZE: // 30
|
case INIT_MAZE: // 30
|
||||||
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.timer);
|
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.timer);
|
||||||
writeByte(outFile, ((act *) actListArr[i][j])->a30.mazeSize);
|
writeByte(outFile, ((act *) actListArr[i][j])->a30.mazeSize);
|
||||||
|
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.x1);
|
||||||
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.y1);
|
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.y1);
|
||||||
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.x2);
|
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.x2);
|
||||||
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.y2);
|
writeSint16BE(outFile, ((act *) actListArr[i][j])->a30.y2);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#define DATAALIGNMENT 4
|
#define DATAALIGNMENT 4
|
||||||
|
|
||||||
#define HUGO_DAT_VER_MAJ 0 // 1 byte
|
#define HUGO_DAT_VER_MAJ 0 // 1 byte
|
||||||
#define HUGO_DAT_VER_MIN 18 // 1 byte
|
#define HUGO_DAT_VER_MIN 19 // 1 byte
|
||||||
|
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
typedef unsigned char byte;
|
typedef unsigned char byte;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue