PETKA: added SET and PLAY opcodes implementation

This commit is contained in:
Andrei Prykhodko 2019-06-30 18:48:46 +03:00 committed by Eugene Sandulenko
parent 48a8318285
commit 6f1161f9b1
4 changed files with 28 additions and 7 deletions

View File

@ -57,7 +57,7 @@ InterfaceMain::InterfaceMain() {
void InterfaceMain::start() {
g_vm->getQSystem()->update();
g_vm->getQSystem()->_field48 = 0;
g_vm->getQSystem()->_isIniting = 0;
loadRoom(g_vm->getQSystem()->findObject("Seq - INTRO0")->_id, false);
}

View File

@ -46,7 +46,7 @@ enum {
void InterfaceStartup::start() {
g_vm->getQSystem()->update();
g_vm->getQSystem()->_field48 = 0;
g_vm->getQSystem()->_isIniting = 0;
QObjectBG *bg = (QObjectBG *)g_vm->getQSystem()->findObject("STARTUP");
_objs.push_back(bg);

View File

@ -94,14 +94,35 @@ void QMessageObject::processMessage(const QMessage &msg) {
if (dynamic_cast<QObjectBG *>(this)) {
break;
}
if (g_vm->getQSystem()->_field48) {
debug("SET OPCODE %d = %d", _id, msg.arg1);
if (g_vm->getQSystem()->_isIniting) {
_resourceId = msg.arg1;
_notLoopedSound = msg.arg2 != 5;
} else {
debug("NOT IMPL");
}
_sound = g_vm->soundMgr()->addSound(g_vm->resMgr()->findSoundName(_resourceId), Audio::Mixer::kSFXSoundType);
_hasSound = _sound != nullptr;
_startSound = false;
FlicDecoder *flc = g_vm->resMgr()->loadFlic(_resourceId);
if (flc) {
g_vm->videoSystem()->addDirtyRect(Common::Point(_x, _y), *flc);
}
flc = g_vm->resMgr()->loadFlic(msg.arg1);
flc->setFrame(1);
_time = 0;
if (_notLoopedSound) {
g_vm->soundMgr()->removeSound(g_vm->resMgr()->findSoundName(_resourceId));
}
_resourceId = msg.arg1;
}
if (msg.arg2 == 1) {
FlicDecoder *flc = g_vm->resMgr()->loadFlic(_resourceId);
flc->setFrame(1);
g_vm->videoSystem()->addDirtyRect(Common::Rect(0, 0, 640, 480));
_time = 0;
} else if (msg.arg2 == 2) {
g_vm->resMgr()->loadFlic(_resourceId);
}
_notLoopedSound = msg.arg2 != 5;
break;
case kStatus:
_status = (int8)msg.arg1;

View File

@ -71,7 +71,7 @@ public:
Interface *_currInterface;
Interface *_prevInterface;
int _field48;
int _isIniting;
int _fxId;
int _musicId;
};