Add flObject lock/unlock support for HE games.

svn-id: r17474
This commit is contained in:
Travis Howell 2005-04-09 09:57:54 +00:00
parent 866e0c8613
commit db43946f05
2 changed files with 18 additions and 9 deletions

View File

@ -510,10 +510,11 @@ void ScummEngine_v70he::o70_getActorRoom() {
}
void ScummEngine_v70he::o70_resourceRoutines() {
int resid, op;
op = fetchScriptByte();
int objidx, resid, subOp;
switch (op) {
subOp = fetchScriptByte();
switch (subOp) {
case 100: // SO_LOAD_SCRIPT
resid = pop();
ensureResourceLoaded(rtScript, resid);
@ -607,7 +608,7 @@ void ScummEngine_v70he::o70_resourceRoutines() {
case 122:
case 123:
case 203:
debug(5,"stub queueload (%d) resource %d", op, pop());
debug(5,"stub queueload (%d) resource %d", subOp, pop());
break;
case 159:
resid = pop();
@ -627,17 +628,25 @@ void ScummEngine_v70he::o70_resourceRoutines() {
break;
case 233:
resid = pop();
debug(5,"stub o70_resourceRoutines lock object %d", resid);
objidx = getObjectIndex(resid);
if (objidx == -1)
break;
res.lock(rtFlObject, _objs[objidx].fl_object_index);
debug(0,"stub o70_resourceRoutines lock object %d", resid);
break;
case 235:
resid = pop();
debug(5,"stub o70_resourceRoutines unlock object %d", resid);
objidx = getObjectIndex(resid);
if (objidx == -1)
break;
res.unlock(rtFlObject, _objs[objidx].fl_object_index);
debug(0,"stub o70_resourceRoutines unlock object %d", resid);
break;
case 239:
// Used in airport
break;
default:
debug(1,"o70_resourceRoutines: default case %d", op);
debug(1,"o70_resourceRoutines: default case %d", subOp);
}
}

View File

@ -1214,13 +1214,13 @@ void ScummEngine_v8::o8_kernelSetFunctions() {
case 11: { // lockObject
int objidx = getObjectIndex(args[1]);
assert(objidx != -1);
res.lock(rtFlObject, objidx);
res.lock(rtFlObject, _objs[objidx].fl_object_index);
break;
}
case 12: { // unlockObject
int objidx = getObjectIndex(args[1]);
assert(objidx != -1);
res.unlock(rtFlObject, objidx);
res.unlock(rtFlObject, _objs[objidx].fl_object_index);
break;
}
case 13: // remapCostume