Implement hold.key and release.key opcodes

svn-id: r41255
This commit is contained in:
Eugene Sandulenko 2009-06-06 17:46:19 +00:00
parent 1a321a2064
commit c393144b19
3 changed files with 16 additions and 2 deletions

View File

@ -246,6 +246,11 @@ void AgiEngine::processEvents() {
if (key)
keyEnqueue(key);
break;
case Common::EVENT_KEYUP:
if (_egoHoldKey)
_game.viewTable[0].direction = 0;
default:
break;
}
@ -466,6 +471,8 @@ int AgiEngine::agiInit() {
loadDict();
#endif
_egoHoldKey = false;
return ec;
}

View File

@ -940,6 +940,7 @@ private:
void motionFollowEgo(VtEntry *v);
void motionMoveObj(VtEntry *v);
void checkMotion(VtEntry *v);
public:
void checkAllMotions();
void moveObj(VtEntry *);
@ -948,6 +949,8 @@ public:
void updatePosition();
int getDirection(int x0, int y0, int x, int y, int s);
bool _egoHoldKey;
// Keyboard
void initWords();
void cleanInput();

View File

@ -636,7 +636,9 @@ cmd(pop_script) {
}
cmd(hold_key) {
report("hold.key\n");
if (g_agi->getVersion() >= 0x3098) {
g_agi->_egoHoldKey = true;
}
}
cmd(discard_sound) {
@ -671,7 +673,9 @@ cmd(fence_mouse) {
}
cmd(release_key) {
report("release.key\n");
if (g_agi->getVersion() >= 0x3098) {
g_agi->_egoHoldKey = false;
}
}
cmd(adj_ego_move_to_x_y) {