PRINCE: showHero() update
This commit is contained in:
parent
dfddfbbd79
commit
f4a35de7eb
6 changed files with 206 additions and 97 deletions
|
@ -28,17 +28,20 @@
|
||||||
#include "prince/resource.h"
|
#include "prince/resource.h"
|
||||||
#include "prince/prince.h"
|
#include "prince/prince.h"
|
||||||
#include "prince/graphics.h"
|
#include "prince/graphics.h"
|
||||||
|
#include "prince/flags.h"
|
||||||
|
#include "prince/script.h"
|
||||||
|
|
||||||
namespace Prince {
|
namespace Prince {
|
||||||
|
|
||||||
Hero::Hero(PrinceEngine *vm, GraphicsMan *graph) : _vm(vm), _graph(graph)
|
Hero::Hero(PrinceEngine *vm, GraphicsMan *graph) : _vm(vm), _graph(graph)
|
||||||
, _number(0), _visible(false), _state(MOVE), _middleX(0), _middleY(0)
|
, _number(0), _visible(false), _state(MOVE), _middleX(0), _middleY(0)
|
||||||
, _boreNum(1), _currHeight(0), _moveDelay(0), _shadMinus(0), _moveSetType(0)
|
, _boreNum(1), _currHeight(0), _moveDelay(0), _shadMinus(0), _moveSetType(0)
|
||||||
, _lastDirection(DOWN), _destDirection(DOWN), _talkTime(0), _boredomTime(0), _phase(0)
|
, _lastDirection(kHeroDirDown), _destDirection(kHeroDirDown), _talkTime(0), _boredomTime(0), _phase(0)
|
||||||
, _specAnim(0), _drawX(0), _drawY(0), _drawZ(0), _zoomFactor(0), _scaleValue(0)
|
, _specAnim(0), _drawX(0), _drawY(0), _drawZ(0), _zoomFactor(0), _scaleValue(0)
|
||||||
, _shadZoomFactor(0), _shadScaleValue(0), _shadLineLen(0), _shadDrawX(0), _shadDrawY(0)
|
, _shadZoomFactor(0), _shadScaleValue(0), _shadLineLen(0), _shadDrawX(0), _shadDrawY(0)
|
||||||
, _frameXSize(0), _frameYSize(0), _scaledFrameXSize(0), _scaledFrameYSize(0), _color(0)
|
, _frameXSize(0), _frameYSize(0), _scaledFrameXSize(0), _scaledFrameYSize(0), _color(0)
|
||||||
, _coords(nullptr), _dirTab(nullptr), _currCoords(nullptr), _currDirTab(nullptr), _step(0)
|
, _coords(nullptr), _dirTab(nullptr), _currCoords(nullptr), _currDirTab(nullptr), _step(0)
|
||||||
|
, _maxBoredom(200), _turnAnim(0), _leftRightMainDir(0), _upDownMainDir(0)
|
||||||
{
|
{
|
||||||
_zoomBitmap = (byte *)malloc(kZoomBitmapLen);
|
_zoomBitmap = (byte *)malloc(kZoomBitmapLen);
|
||||||
_shadowBitmap = (byte *)malloc(2 * kShadowBitmapSize);
|
_shadowBitmap = (byte *)malloc(2 * kShadowBitmapSize);
|
||||||
|
@ -588,71 +591,60 @@ void Hero::setShadowScale(int32 shadowScale) {
|
||||||
void Hero::specialAnim() {
|
void Hero::specialAnim() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hero::rotateHero() {
|
int Hero::rotateHero(int oldDirection, int newDirection) {
|
||||||
switch (_lastDirection) {
|
switch (oldDirection) {
|
||||||
case LEFT:
|
case kHeroDirLeft:
|
||||||
switch (_destDirection) {
|
switch (newDirection) {
|
||||||
case RIGHT:
|
case kHeroDirRight:
|
||||||
_moveSetType = kMove_MLR;
|
return kMove_MLR;
|
||||||
break;
|
case kHeroDirUp:
|
||||||
case UP:
|
return kMove_MLU;
|
||||||
_moveSetType = kMove_MLU;
|
case kHeroDirDown:
|
||||||
break;
|
return kMove_MLD;
|
||||||
case DOWN:
|
|
||||||
_moveSetType = kMove_MLD;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case kHeroDirRight:
|
||||||
switch (_destDirection) {
|
switch (newDirection) {
|
||||||
case LEFT:
|
case kHeroDirLeft:
|
||||||
_moveSetType = kMove_MRL;
|
return kMove_MRL;
|
||||||
break;
|
case kHeroDirUp:
|
||||||
case UP:
|
return kMove_MRU;
|
||||||
_moveSetType = kMove_MRU;
|
case kHeroDirDown:
|
||||||
break;
|
return kMove_MRD;
|
||||||
case DOWN:
|
|
||||||
_moveSetType = kMove_MRD;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UP:
|
case kHeroDirUp:
|
||||||
switch (_destDirection) {
|
switch (newDirection) {
|
||||||
case LEFT:
|
case kHeroDirLeft:
|
||||||
_moveSetType = kMove_MUL;
|
return kMove_MUL;
|
||||||
break;
|
case kHeroDirRight:
|
||||||
case RIGHT:
|
return kMove_MUR;
|
||||||
_moveSetType = kMove_MUR;
|
case kHeroDirDown:
|
||||||
break;
|
return kMove_MUD;
|
||||||
case DOWN:
|
|
||||||
_moveSetType = kMove_MUD;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DOWN:
|
case kHeroDirDown:
|
||||||
switch (_destDirection) {
|
switch (newDirection) {
|
||||||
case LEFT:
|
case kHeroDirLeft:
|
||||||
_moveSetType = kMove_MDL;
|
return kMove_MDL;
|
||||||
break;
|
case kHeroDirRight:
|
||||||
case RIGHT:
|
return kMove_MDR;
|
||||||
_moveSetType = kMove_MDR;
|
case kHeroDirUp:
|
||||||
break;
|
return kMove_MDU;
|
||||||
case UP:
|
|
||||||
_moveSetType = kMove_MDU;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hero::showHero() {
|
void Hero::showHero() {
|
||||||
if (_visible) {
|
if (_visible) {
|
||||||
|
//cmp w FLAGI+NOHEROATALL,ax
|
||||||
|
//jnz @@no_hero_visible
|
||||||
if (_talkTime != 0) {
|
if (_talkTime != 0) {
|
||||||
_talkTime--;
|
_talkTime--;
|
||||||
//if (_talkTime == 0) {
|
|
||||||
//_state = STAY; // test this
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scale of hero
|
// Scale of hero
|
||||||
selectZoom();
|
selectZoom();
|
||||||
|
|
||||||
|
@ -662,24 +654,26 @@ void Hero::showHero() {
|
||||||
|
|
||||||
switch (_state) {
|
switch (_state) {
|
||||||
case STAY:
|
case STAY:
|
||||||
//if(OptionsFlag == false) {
|
if (!_vm->_optionsFlag && !_vm->_interpreter->getLastOPCode()) {
|
||||||
//if(OpcodePC == null) {
|
_boredomTime++;
|
||||||
_boredomTime++;
|
if (_boredomTime == _maxBoredom) {
|
||||||
if (_boredomTime == 200) { // 140 for second hero
|
_boredomTime = 0;
|
||||||
|
_state = BORE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
_boredomTime = 0;
|
_boredomTime = 0;
|
||||||
_state = BORE;
|
|
||||||
}
|
}
|
||||||
switch (_lastDirection) {
|
switch (_lastDirection) {
|
||||||
case LEFT:
|
case kHeroDirLeft:
|
||||||
_moveSetType = kMove_SL;
|
_moveSetType = kMove_SL;
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case kHeroDirRight:
|
||||||
_moveSetType = kMove_SR;
|
_moveSetType = kMove_SR;
|
||||||
break;
|
break;
|
||||||
case UP:
|
case kHeroDirUp:
|
||||||
_moveSetType = kMove_SU;
|
_moveSetType = kMove_SU;
|
||||||
break;
|
break;
|
||||||
case DOWN:
|
case kHeroDirDown:
|
||||||
_moveSetType = kMove_SD;
|
_moveSetType = kMove_SD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -696,17 +690,98 @@ void Hero::showHero() {
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case MOVE:
|
case MOVE:
|
||||||
switch (_lastDirection) {
|
int x, y, dir, oldMiddleX, oldMiddleY, dX, dY;
|
||||||
case LEFT:
|
//go_for_it:
|
||||||
|
while (1) {
|
||||||
|
if (_currCoords != nullptr) {
|
||||||
|
if (READ_UINT32(_currCoords) != 0xFFFFFFFF) {
|
||||||
|
x = READ_UINT16(_currCoords);
|
||||||
|
y = READ_UINT16(_currCoords + 2);
|
||||||
|
_currCoords += 4;
|
||||||
|
dir = *_currDirTab;
|
||||||
|
_currDirTab++;
|
||||||
|
if (_lastDirection != dir) {
|
||||||
|
_phase = 0;
|
||||||
|
int rotateDir = rotateHero(_lastDirection, dir);
|
||||||
|
_lastDirection = dir;
|
||||||
|
if (!rotateDir) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
_turnAnim = rotateDir;
|
||||||
|
_state = MVAN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//no_need_direction_change
|
||||||
|
if (dir == kHeroDirLeft) {
|
||||||
|
if (_middleX - x >= _step) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (dir == kHeroDirRight) {
|
||||||
|
if (x - _middleX >= _step) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (dir == kHeroDirUp) {
|
||||||
|
if (_middleY - y >= _step) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (dir == kHeroDirDown) {
|
||||||
|
if (y - _middleY >= _step) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//finito
|
||||||
|
_middleX = READ_UINT16(_currCoords - 4);
|
||||||
|
_middleY = READ_UINT16(_currCoords - 2);
|
||||||
|
selectZoom();
|
||||||
|
free(_coords);
|
||||||
|
free(_dirTab);
|
||||||
|
_boredomTime = 0;
|
||||||
|
_coords = nullptr;
|
||||||
|
_dirTab = nullptr;
|
||||||
|
_currCoords = nullptr;
|
||||||
|
_currDirTab = nullptr;
|
||||||
|
_phase = 0;
|
||||||
|
_state = TURN;
|
||||||
|
//_destDir = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
oldMiddleX = _middleX;
|
||||||
|
oldMiddleY = _middleY;
|
||||||
|
_middleX = x;
|
||||||
|
_middleY = y;
|
||||||
|
selectZoom();
|
||||||
|
|
||||||
|
// TODO - useful or not?
|
||||||
|
dX = oldMiddleX - _middleX;
|
||||||
|
dY = oldMiddleY - _middleY;
|
||||||
|
if (dX) {
|
||||||
|
_leftRightMainDir = kHeroDirLeft;
|
||||||
|
if (dX >= 0) {
|
||||||
|
_leftRightMainDir = kHeroDirRight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dY) {
|
||||||
|
_upDownMainDir = kHeroDirUp;
|
||||||
|
if (dY >= 0) {
|
||||||
|
_upDownMainDir = kHeroDirDown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (dir) {
|
||||||
|
case kHeroDirLeft:
|
||||||
_moveSetType = kMove_ML;
|
_moveSetType = kMove_ML;
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case kHeroDirRight:
|
||||||
_moveSetType = kMove_MR;
|
_moveSetType = kMove_MR;
|
||||||
break;
|
break;
|
||||||
case UP:
|
case kHeroDirUp:
|
||||||
_moveSetType = kMove_MU;
|
_moveSetType = kMove_MU;
|
||||||
break;
|
break;
|
||||||
case DOWN:
|
case kHeroDirDown:
|
||||||
_moveSetType = kMove_MD;
|
_moveSetType = kMove_MD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -721,9 +796,9 @@ void Hero::showHero() {
|
||||||
_moveSetType = kMove_BORED2;
|
_moveSetType = kMove_BORED2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (_phase == _moveSet[_moveSetType]->getFrameCount() - 1) {
|
if (_phase == _moveSet[_moveSetType]->getPhaseCount() - 1) {
|
||||||
_boreNum = _vm->_randomSource.getRandomNumber(1); // rand one of two 'bored' animation
|
_boreNum = _vm->_randomSource.getRandomNumber(1); // rand one of two 'bored' animation
|
||||||
_lastDirection = DOWN;
|
_lastDirection = kHeroDirDown;
|
||||||
_state = STAY;
|
_state = STAY;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -731,26 +806,54 @@ void Hero::showHero() {
|
||||||
//specialAnim();
|
//specialAnim();
|
||||||
break;
|
break;
|
||||||
case TALK:
|
case TALK:
|
||||||
|
if (!_talkTime) {
|
||||||
|
_state = STAY;
|
||||||
|
}
|
||||||
switch (_lastDirection) {
|
switch (_lastDirection) {
|
||||||
case LEFT:
|
case kHeroDirLeft:
|
||||||
_moveSetType = kMove_TL;
|
_moveSetType = kMove_TL;
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case kHeroDirRight:
|
||||||
_moveSetType = kMove_TR;
|
_moveSetType = kMove_TR;
|
||||||
break;
|
break;
|
||||||
case UP:
|
case kHeroDirUp:
|
||||||
_moveSetType = kMove_TU;
|
_moveSetType = kMove_TU;
|
||||||
break;
|
break;
|
||||||
case DOWN:
|
case kHeroDirDown:
|
||||||
_moveSetType = kMove_TD;
|
_moveSetType = kMove_TD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MVAN:
|
||||||
case TRAN:
|
case TRAN:
|
||||||
|
if (_turnAnim) {
|
||||||
|
if (_phase < _moveSet[_moveSetType]->getPhaseCount() - 1) {
|
||||||
|
//TODO - not here?
|
||||||
|
_phase += 2; //?
|
||||||
|
} else {
|
||||||
|
//turn_anim_koniec
|
||||||
|
if (_state == MVAN) {
|
||||||
|
_state = MOVE;
|
||||||
|
} else {
|
||||||
|
_state = STAY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//turn_anim_koniec
|
||||||
|
if (_state == MVAN) {
|
||||||
|
_state = MOVE;
|
||||||
|
} else {
|
||||||
|
_state = STAY;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RUN:
|
case RUN:
|
||||||
break;
|
break;
|
||||||
case DMOVE:
|
case DMOVE:
|
||||||
|
_moveDelay--;
|
||||||
|
if (!_moveDelay) {
|
||||||
|
_state = MOVE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
showHeroAnimFrame();
|
showHeroAnimFrame();
|
||||||
|
|
|
@ -64,10 +64,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Direction {
|
enum Direction {
|
||||||
LEFT = 1,
|
kHeroDirLeft = 1,
|
||||||
RIGHT = 2,
|
kHeroDirRight = 2,
|
||||||
UP = 3,
|
kHeroDirUp = 3,
|
||||||
DOWN = 4
|
kHeroDirDown = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MoveSet {
|
enum MoveSet {
|
||||||
|
@ -118,7 +118,7 @@ public:
|
||||||
|
|
||||||
void showHero();
|
void showHero();
|
||||||
void moveHero();
|
void moveHero();
|
||||||
void rotateHero();
|
int rotateHero(int oldDirection, int newDirection);
|
||||||
void scrollHero();
|
void scrollHero();
|
||||||
void setScale(int8 zoomBitmapValue);
|
void setScale(int8 zoomBitmapValue);
|
||||||
int getScaledValue(int size);
|
int getScaledValue(int size);
|
||||||
|
@ -169,11 +169,11 @@ public:
|
||||||
byte *_currDirTab; // current direction
|
byte *_currDirTab; // current direction
|
||||||
int16 _lastDirection; // previous move direction
|
int16 _lastDirection; // previous move direction
|
||||||
int16 _destDirection;
|
int16 _destDirection;
|
||||||
// LeftRight previous left/right direction
|
int16 _leftRightMainDir; // left or right - dominant direction
|
||||||
// UpDown previous up/down direction
|
int16 _upDownMainDir; // up or down - dominant direction
|
||||||
int32 _phase; // Phase animation phase
|
int32 _phase; // Phase animation phase
|
||||||
int16 _step; // Step x/y step size depends on direction
|
int16 _step; // Step x/y step size depends on direction
|
||||||
// MaxBoredom stand still timeout
|
int16 _maxBoredom; // stand still timeout
|
||||||
int16 _boredomTime; // Boredom current boredom time in frames
|
int16 _boredomTime; // Boredom current boredom time in frames
|
||||||
uint16 _boreNum; // Bore anim frame
|
uint16 _boreNum; // Bore anim frame
|
||||||
int16 _talkTime; // TalkTime time of talk anim
|
int16 _talkTime; // TalkTime time of talk anim
|
||||||
|
@ -187,7 +187,7 @@ public:
|
||||||
int _color; // Color Subtitles color
|
int _color; // Color Subtitles color
|
||||||
// AnimSet number of animation set
|
// AnimSet number of animation set
|
||||||
Common::Array<Animation *> _moveSet; // MoveAnims MoveSet
|
Common::Array<Animation *> _moveSet; // MoveAnims MoveSet
|
||||||
// TurnAnim ??
|
int16 _turnAnim;
|
||||||
byte *_zoomBitmap;
|
byte *_zoomBitmap;
|
||||||
byte *_shadowBitmap;
|
byte *_shadowBitmap;
|
||||||
byte *_shadowLine;
|
byte *_shadowLine;
|
||||||
|
|
|
@ -297,6 +297,7 @@ void PrinceEngine::init() {
|
||||||
|
|
||||||
_mainHero = new Hero(this, _graph);
|
_mainHero = new Hero(this, _graph);
|
||||||
_secondHero = new Hero(this, _graph);
|
_secondHero = new Hero(this, _graph);
|
||||||
|
_secondHero->_maxBoredom = 140;
|
||||||
|
|
||||||
_mainHero->loadAnimSet(1);
|
_mainHero->loadAnimSet(1);
|
||||||
_secondHero->loadAnimSet(3);
|
_secondHero->loadAnimSet(3);
|
||||||
|
@ -827,19 +828,19 @@ void PrinceEngine::keyHandler(Common::Event event) {
|
||||||
debugEngine("%d", _mainHero->_phase);
|
debugEngine("%d", _mainHero->_phase);
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_w:
|
case Common::KEYCODE_w:
|
||||||
_mainHero->_lastDirection = _mainHero->UP;
|
_mainHero->_lastDirection = _mainHero->kHeroDirUp;
|
||||||
debugEngine("UP");
|
debugEngine("UP");
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_s:
|
case Common::KEYCODE_s:
|
||||||
_mainHero->_lastDirection = _mainHero->DOWN;
|
_mainHero->_lastDirection = _mainHero->kHeroDirDown;
|
||||||
debugEngine("DOWN");
|
debugEngine("DOWN");
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_a:
|
case Common::KEYCODE_a:
|
||||||
_mainHero->_lastDirection = _mainHero->LEFT;
|
_mainHero->_lastDirection = _mainHero->kHeroDirLeft;
|
||||||
debugEngine("LEFT");
|
debugEngine("LEFT");
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_f:
|
case Common::KEYCODE_f:
|
||||||
_mainHero->_lastDirection = _mainHero->RIGHT;
|
_mainHero->_lastDirection = _mainHero->kHeroDirRight;
|
||||||
debugEngine("RIGHT");
|
debugEngine("RIGHT");
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_1:
|
case Common::KEYCODE_1:
|
||||||
|
@ -3946,14 +3947,14 @@ int PrinceEngine::scanDirectionsFindNext(byte *tempCoordsBuf, int xDiff, int yDi
|
||||||
|
|
||||||
int tempX, tempY, direction, dX, dY, againPointX1, againPointY1;
|
int tempX, tempY, direction, dX, dY, againPointX1, againPointY1;
|
||||||
|
|
||||||
tempX = Hero::LEFT;
|
tempX = Hero::kHeroDirLeft;
|
||||||
if (xDiff < 0) {
|
if (xDiff < 0) {
|
||||||
tempX = Hero::RIGHT;
|
tempX = Hero::kHeroDirRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempY = Hero::UP;
|
tempY = Hero::kHeroDirUp;
|
||||||
if (yDiff < 0) {
|
if (yDiff < 0) {
|
||||||
tempY = Hero::DOWN;
|
tempY = Hero::kHeroDirDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -4010,15 +4011,15 @@ void PrinceEngine::scanDirections() {
|
||||||
if (yDiff) {
|
if (yDiff) {
|
||||||
if (lastDirection != -1) {
|
if (lastDirection != -1) {
|
||||||
direction = lastDirection;
|
direction = lastDirection;
|
||||||
if (direction == Hero::LEFT) {
|
if (direction == Hero::kHeroDirLeft) {
|
||||||
if (xDiff < 0) {
|
if (xDiff < 0) {
|
||||||
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
||||||
}
|
}
|
||||||
} else if (direction == Hero::RIGHT) {
|
} else if (direction == Hero::kHeroDirRight) {
|
||||||
if (xDiff >= 0) {
|
if (xDiff >= 0) {
|
||||||
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
||||||
}
|
}
|
||||||
} else if (direction == Hero::UP) {
|
} else if (direction == Hero::kHeroDirUp) {
|
||||||
if (yDiff < 0) {
|
if (yDiff < 0) {
|
||||||
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
||||||
}
|
}
|
||||||
|
@ -4031,16 +4032,16 @@ void PrinceEngine::scanDirections() {
|
||||||
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
direction = scanDirectionsFindNext(tempCoordsBuf, xDiff, yDiff);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
direction = Hero::LEFT;
|
direction = Hero::kHeroDirLeft;
|
||||||
if (xDiff < 0) {
|
if (xDiff < 0) {
|
||||||
direction = Hero::RIGHT;
|
direction = Hero::kHeroDirRight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (yDiff) {
|
if (yDiff) {
|
||||||
direction = Hero::UP;
|
direction = Hero::kHeroDirUp;
|
||||||
if (yDiff < 0) {
|
if (yDiff < 0) {
|
||||||
direction = Hero::DOWN;
|
direction = Hero::kHeroDirDown;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
direction = lastDirection;
|
direction = lastDirection;
|
||||||
|
|
|
@ -299,6 +299,8 @@ public:
|
||||||
MhwanhDecoder *_suitcaseBmp;
|
MhwanhDecoder *_suitcaseBmp;
|
||||||
Room *_room;
|
Room *_room;
|
||||||
Script *_script;
|
Script *_script;
|
||||||
|
InterpreterFlags *_flags;
|
||||||
|
Interpreter *_interpreter;
|
||||||
|
|
||||||
static const int kMaxNormAnims = 64;
|
static const int kMaxNormAnims = 64;
|
||||||
static const int kMaxBackAnims = 64;
|
static const int kMaxBackAnims = 64;
|
||||||
|
@ -568,8 +570,6 @@ private:
|
||||||
Cursor *_cursor3;
|
Cursor *_cursor3;
|
||||||
Debugger *_debugger;
|
Debugger *_debugger;
|
||||||
GraphicsMan *_graph;
|
GraphicsMan *_graph;
|
||||||
InterpreterFlags *_flags;
|
|
||||||
Interpreter *_interpreter;
|
|
||||||
Font *_font;
|
Font *_font;
|
||||||
MusicPlayer *_midiPlayer;
|
MusicPlayer *_midiPlayer;
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,10 @@ void Interpreter::storeNewPC(int opcodePC) {
|
||||||
_fgOpcodePC = opcodePC;
|
_fgOpcodePC = opcodePC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Interpreter::getLastOPCode() {
|
||||||
|
return _lastOpcode;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 Interpreter::getCurrentString() {
|
uint32 Interpreter::getCurrentString() {
|
||||||
return _currentString;
|
return _currentString;
|
||||||
}
|
}
|
||||||
|
@ -508,7 +512,7 @@ void Interpreter::O_WAITFOREVER() {
|
||||||
_vm->changeCursor(_vm->_currentPointerNumber);
|
_vm->changeCursor(_vm->_currentPointerNumber);
|
||||||
_opcodeNF = 1;
|
_opcodeNF = 1;
|
||||||
_currentInstruction -= 2;
|
_currentInstruction -= 2;
|
||||||
//debugInterpreter("O_WAITFOREVER");
|
debugInterpreter("O_WAITFOREVER");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::O_BLACKPALETTE() {
|
void Interpreter::O_BLACKPALETTE() {
|
||||||
|
|
|
@ -185,6 +185,7 @@ public:
|
||||||
|
|
||||||
void step();
|
void step();
|
||||||
void storeNewPC(int opcodePC);
|
void storeNewPC(int opcodePC);
|
||||||
|
int getLastOPCode();
|
||||||
|
|
||||||
uint32 getCurrentString();
|
uint32 getCurrentString();
|
||||||
void setCurrentString(uint32 value);
|
void setCurrentString(uint32 value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue