2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2004-09-06 00:58:40 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-09-06 00:58:40 +00:00
|
|
|
*
|
2006-02-11 09:55:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2004-09-06 00:58:40 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-08-12 00:53:35 +00:00
|
|
|
#ifdef ENABLE_HE
|
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
#include "scumm/actor.h"
|
|
|
|
#include "scumm/charset.h"
|
2006-05-08 10:21:17 +00:00
|
|
|
#include "scumm/he/animation_he.h"
|
2006-02-15 00:57:50 +00:00
|
|
|
#include "scumm/he/intern_he.h"
|
|
|
|
#include "scumm/he/logic_he.h"
|
2004-09-06 00:58:40 +00:00
|
|
|
#include "scumm/object.h"
|
|
|
|
#include "scumm/resource.h"
|
2006-02-15 18:48:49 +00:00
|
|
|
#include "scumm/he/resource_he.h"
|
2004-09-06 00:58:40 +00:00
|
|
|
#include "scumm/scumm.h"
|
|
|
|
#include "scumm/sound.h"
|
2006-02-15 00:57:50 +00:00
|
|
|
#include "scumm/he/sprite_he.h"
|
2005-04-10 12:59:17 +00:00
|
|
|
#include "scumm/util.h"
|
2004-09-06 00:58:40 +00:00
|
|
|
|
|
|
|
namespace Scumm {
|
|
|
|
|
2009-04-16 09:26:37 +00:00
|
|
|
#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v90he, x)
|
2004-09-06 00:58:40 +00:00
|
|
|
|
|
|
|
void ScummEngine_v90he::setupOpcodes() {
|
2009-04-16 09:27:22 +00:00
|
|
|
ScummEngine_v80he::setupOpcodes();
|
|
|
|
|
2009-04-16 09:26:37 +00:00
|
|
|
OPCODE(0x0a, o90_dup_n);
|
2009-04-16 09:27:22 +00:00
|
|
|
|
2009-04-16 09:26:37 +00:00
|
|
|
/* 1C */
|
|
|
|
OPCODE(0x1c, o90_wizImageOps);
|
|
|
|
OPCODE(0x1d, o90_min);
|
|
|
|
OPCODE(0x1e, o90_max);
|
|
|
|
OPCODE(0x1f, o90_sin);
|
|
|
|
/* 20 */
|
|
|
|
OPCODE(0x20, o90_cos);
|
|
|
|
OPCODE(0x21, o90_sqrt);
|
|
|
|
OPCODE(0x22, o90_atan2);
|
|
|
|
OPCODE(0x23, o90_getSegmentAngle);
|
|
|
|
/* 24 */
|
|
|
|
OPCODE(0x24, o90_getDistanceBetweenPoints);
|
|
|
|
OPCODE(0x25, o90_getSpriteInfo);
|
|
|
|
OPCODE(0x26, o90_setSpriteInfo);
|
|
|
|
OPCODE(0x27, o90_getSpriteGroupInfo);
|
|
|
|
/* 28 */
|
|
|
|
OPCODE(0x28, o90_setSpriteGroupInfo);
|
|
|
|
OPCODE(0x29, o90_getWizData);
|
|
|
|
OPCODE(0x2a, o90_getActorData);
|
|
|
|
OPCODE(0x2b, o90_startScriptUnk);
|
|
|
|
/* 2C */
|
|
|
|
OPCODE(0x2c, o90_jumpToScriptUnk);
|
|
|
|
OPCODE(0x2d, o90_videoOps);
|
|
|
|
OPCODE(0x2e, o90_getVideoData);
|
|
|
|
OPCODE(0x2f, o90_floodFill);
|
|
|
|
/* 30 */
|
|
|
|
OPCODE(0x30, o90_mod);
|
|
|
|
OPCODE(0x31, o90_shl);
|
|
|
|
OPCODE(0x32, o90_shr);
|
|
|
|
OPCODE(0x33, o90_xor);
|
|
|
|
/* 34 */
|
|
|
|
OPCODE(0x34, o90_findAllObjectsWithClassOf);
|
|
|
|
OPCODE(0x35, o90_getPolygonOverlap);
|
|
|
|
OPCODE(0x36, o90_cond);
|
|
|
|
OPCODE(0x37, o90_dim2dim2Array);
|
|
|
|
/* 38 */
|
|
|
|
OPCODE(0x38, o90_redim2dimArray);
|
|
|
|
OPCODE(0x39, o90_getLinesIntersectionPoint);
|
|
|
|
OPCODE(0x3a, o90_sortArray);
|
2009-04-16 09:27:22 +00:00
|
|
|
|
2009-04-16 09:26:37 +00:00
|
|
|
OPCODE(0x44, o90_getObjectData);
|
2009-04-16 09:27:22 +00:00
|
|
|
|
2009-04-16 09:26:37 +00:00
|
|
|
OPCODE(0x94, o90_getPaletteData);
|
|
|
|
OPCODE(0x9e, o90_paletteOps);
|
|
|
|
OPCODE(0xa5, o90_fontUnk);
|
|
|
|
OPCODE(0xab, o90_getActorAnimProgress);
|
|
|
|
OPCODE(0xc8, o90_kernelGetFunctions);
|
|
|
|
OPCODE(0xc9, o90_kernelSetFunctions);
|
2004-09-06 00:58:40 +00:00
|
|
|
}
|
|
|
|
|
2005-03-07 06:06:22 +00:00
|
|
|
void ScummEngine_v90he::o90_dup_n() {
|
|
|
|
int num;
|
|
|
|
int args[16];
|
2004-09-23 09:11:52 +00:00
|
|
|
|
2005-03-07 06:06:22 +00:00
|
|
|
push(fetchScriptWord());
|
|
|
|
num = getStackList(args, ARRAYSIZE(args));
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
|
|
for (int j = 0; j < num; j++)
|
|
|
|
push(args[j]);
|
2004-09-23 09:11:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-02 01:08:31 +00:00
|
|
|
void ScummEngine_v90he::o90_wizImageOps() {
|
2004-09-26 15:29:58 +00:00
|
|
|
int a, b;
|
2006-02-05 00:40:48 +00:00
|
|
|
|
2004-10-10 11:09:23 +00:00
|
|
|
int subOp = fetchScriptByte();
|
2004-09-06 00:58:40 +00:00
|
|
|
|
2004-09-06 08:53:19 +00:00
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 32: // HE99+
|
2005-02-27 02:55:13 +00:00
|
|
|
_wizParams.processFlags |= kWPFUseDefImgWidth;
|
2005-03-04 05:31:22 +00:00
|
|
|
_wizParams.resDefImgW = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 33: // HE99+
|
2005-02-27 02:55:13 +00:00
|
|
|
_wizParams.processFlags |= kWPFUseDefImgHeight;
|
2005-03-04 05:31:22 +00:00
|
|
|
_wizParams.resDefImgH = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 46:
|
2005-03-04 05:31:22 +00:00
|
|
|
// Dummy case
|
2004-09-18 21:44:00 +00:00
|
|
|
pop();
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 47:
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.box.bottom = pop();
|
|
|
|
_wizParams.box.right = pop();
|
|
|
|
_wizParams.box.top = pop();
|
|
|
|
_wizParams.box.left = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 48:
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 1;
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 49:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFUseFile;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 3;
|
2005-04-13 10:34:47 +00:00
|
|
|
copyScriptString(_wizParams.filename, sizeof(_wizParams.filename));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 50:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFUseFile;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 4;
|
2005-04-13 10:34:47 +00:00
|
|
|
copyScriptString(_wizParams.filename, sizeof(_wizParams.filename));
|
2005-03-26 06:00:58 +00:00
|
|
|
_wizParams.fileWriteMode = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 51:
|
2005-03-26 06:00:58 +00:00
|
|
|
_wizParams.processFlags |= kWPFClipBox | 0x100;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 2;
|
2006-06-16 13:14:55 +00:00
|
|
|
_wizParams.box.bottom = pop();
|
|
|
|
_wizParams.box.right = pop();
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.box.top = pop();
|
|
|
|
_wizParams.box.left = pop();
|
2004-10-17 04:35:36 +00:00
|
|
|
_wizParams.compType = pop();
|
2006-06-16 13:14:55 +00:00
|
|
|
adjustRect(_wizParams.box);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 52:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFNewState;
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.img.state = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 53:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFRotate;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.angle = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 54:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFNewFlags;
|
2005-06-04 02:26:51 +00:00
|
|
|
_wizParams.img.flags |= pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 56:
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.img.flags = pop();
|
|
|
|
_wizParams.img.state = pop();
|
|
|
|
_wizParams.img.y1 = pop();
|
|
|
|
_wizParams.img.x1 = pop();
|
|
|
|
_wizParams.img.resNum = pop();
|
2005-05-23 03:33:08 +00:00
|
|
|
_wiz->displayWizImage(&_wizParams.img);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 57:
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.img.resNum = pop();
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 0;
|
|
|
|
_wizParams.processFlags = 0;
|
2004-10-17 04:35:36 +00:00
|
|
|
_wizParams.remapNum = 0;
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.img.flags = 0;
|
2009-06-03 06:52:39 +00:00
|
|
|
_wizParams.params1 = 0;
|
|
|
|
_wizParams.params2 = 0;
|
2005-05-29 12:14:31 +00:00
|
|
|
_wizParams.spriteId = 0;
|
2005-06-05 08:02:50 +00:00
|
|
|
_wizParams.spriteGroup = 0;
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 62: // HE99+
|
2005-04-19 17:55:09 +00:00
|
|
|
_wizParams.processFlags |= kWPFMaskImg;
|
2005-06-05 08:02:50 +00:00
|
|
|
_wizParams.sourceImage = pop();
|
2004-10-04 01:19:05 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 65:
|
|
|
|
case 154:
|
2005-03-24 03:59:00 +00:00
|
|
|
_wizParams.processFlags |= kWPFSetPos;
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.img.y1 = pop();
|
|
|
|
_wizParams.img.x1 = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 66:
|
|
|
|
case 249: // HE98+
|
2004-09-26 15:29:58 +00:00
|
|
|
b = pop();
|
|
|
|
a = pop();
|
2005-03-24 03:59:00 +00:00
|
|
|
_wizParams.processFlags |= kWPFRemapPalette;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 6;
|
2004-10-17 04:35:36 +00:00
|
|
|
if (_wizParams.remapNum == 0) {
|
|
|
|
memset(_wizParams.remapIndex, 0, sizeof(_wizParams.remapIndex));
|
2004-09-26 15:29:58 +00:00
|
|
|
}
|
2006-04-01 06:38:47 +00:00
|
|
|
assert(_wizParams.remapNum < ARRAYSIZE(_wizParams.remapIndex));
|
|
|
|
_wizParams.remapIndex[_wizParams.remapNum] = a;
|
|
|
|
_wizParams.remapColor[a] = b;
|
|
|
|
_wizParams.remapNum++;
|
2004-09-22 02:29:47 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 67:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFClipBox;
|
2004-09-26 15:29:58 +00:00
|
|
|
_wizParams.box.bottom = pop();
|
|
|
|
_wizParams.box.right = pop();
|
|
|
|
_wizParams.box.top = pop();
|
|
|
|
_wizParams.box.left = pop();
|
2006-07-06 12:22:33 +00:00
|
|
|
adjustRect(_wizParams.box);
|
2004-09-21 01:00:30 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 86: // HE99+
|
2005-03-31 22:51:54 +00:00
|
|
|
_wizParams.processFlags |= kWPFPaletteNum;
|
2005-06-05 08:02:50 +00:00
|
|
|
_wizParams.img.palette = pop();
|
2004-09-22 09:48:40 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 92:
|
2005-06-05 08:02:50 +00:00
|
|
|
_wizParams.processFlags |= kWPFScaled;
|
|
|
|
_wizParams.scale = pop();
|
2004-09-26 15:29:58 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 98:
|
2005-06-05 08:02:50 +00:00
|
|
|
_wizParams.processFlags |= kWPFShadow;
|
2005-06-05 08:15:30 +00:00
|
|
|
_wizParams.img.shadow = pop();
|
2004-09-26 15:29:58 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 131: // HE99+
|
2005-03-26 06:00:58 +00:00
|
|
|
_wizParams.processFlags |= 0x1000 | 0x100 | 0x2;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 7;
|
2006-03-31 13:06:23 +00:00
|
|
|
_wizParams.polygonId2 = pop();
|
|
|
|
_wizParams.polygonId1 = pop();
|
2004-10-17 08:02:42 +00:00
|
|
|
_wizParams.compType = pop();
|
2004-10-04 01:19:05 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 133: // HE99+
|
2005-03-24 03:59:00 +00:00
|
|
|
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 9;
|
2005-03-04 05:31:22 +00:00
|
|
|
_wizParams.fillColor = pop();
|
|
|
|
_wizParams.box2.bottom = pop();
|
|
|
|
_wizParams.box2.right = pop();
|
|
|
|
_wizParams.box2.top = pop();
|
|
|
|
_wizParams.box2.left = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 134: // HE99+
|
2005-03-24 03:59:00 +00:00
|
|
|
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 10;
|
2005-03-04 05:31:22 +00:00
|
|
|
_wizParams.fillColor = pop();
|
|
|
|
_wizParams.box2.bottom = pop();
|
|
|
|
_wizParams.box2.right = pop();
|
|
|
|
_wizParams.box2.top = pop();
|
|
|
|
_wizParams.box2.left = pop();
|
2004-10-04 01:19:05 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 135: // HE99+
|
2005-03-24 03:59:00 +00:00
|
|
|
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 11;
|
2005-03-04 05:31:22 +00:00
|
|
|
_wizParams.fillColor = pop();
|
|
|
|
_wizParams.box2.top = _wizParams.box2.bottom = pop();
|
|
|
|
_wizParams.box2.left = _wizParams.box2.right = pop();
|
2004-10-04 01:19:05 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 136: // HE99+
|
2005-03-24 03:59:00 +00:00
|
|
|
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 12;
|
2005-03-04 05:31:22 +00:00
|
|
|
_wizParams.fillColor = pop();
|
|
|
|
_wizParams.box2.top = _wizParams.box2.bottom = pop();
|
|
|
|
_wizParams.box2.left = _wizParams.box2.right = pop();
|
2004-10-04 01:19:05 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 137: // HE99+
|
2005-04-01 08:51:13 +00:00
|
|
|
_wizParams.processFlags |= kWPFDstResNum;
|
|
|
|
_wizParams.dstResNum = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 139: // HE99+
|
2009-06-03 06:52:39 +00:00
|
|
|
_wizParams.processFlags |= kWPFParams;
|
|
|
|
_wizParams.params1 = pop();
|
|
|
|
_wizParams.params2 = pop();
|
2005-05-07 11:07:45 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 141: // HE99+
|
2005-05-07 11:07:45 +00:00
|
|
|
_wizParams.processMode = 13;
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 142: // HE99+
|
2005-05-07 11:07:45 +00:00
|
|
|
_wizParams.field_239D = pop();
|
|
|
|
_wizParams.field_2399 = pop();
|
|
|
|
_wizParams.field_23A5 = pop();
|
|
|
|
_wizParams.field_23A1 = pop();
|
|
|
|
copyScriptString(_wizParams.string2, sizeof(_wizParams.string2));
|
|
|
|
_wizParams.processMode = 15;
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 143: // HE99+
|
2005-05-07 11:07:45 +00:00
|
|
|
_wizParams.processMode = 16;
|
|
|
|
_wizParams.field_23AD = pop();
|
|
|
|
_wizParams.field_23A9 = pop();
|
|
|
|
copyScriptString(_wizParams.string1, sizeof(_wizParams.string1));
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 189: // HE99+
|
2005-05-08 10:59:32 +00:00
|
|
|
_wizParams.processMode = 17;
|
|
|
|
_wizParams.field_23CD = pop();
|
|
|
|
_wizParams.field_23C9 = pop();
|
|
|
|
_wizParams.field_23C5 = pop();
|
|
|
|
_wizParams.field_23C1 = pop();
|
|
|
|
_wizParams.field_23BD = pop();
|
|
|
|
_wizParams.field_23B9 = pop();
|
|
|
|
_wizParams.field_23B5 = pop();
|
|
|
|
_wizParams.field_23B1 = pop();
|
2004-09-26 15:29:58 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 196: // HE99+
|
2005-05-07 11:07:45 +00:00
|
|
|
_wizParams.processMode = 14;
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 217: // HE99+
|
2004-10-08 22:58:49 +00:00
|
|
|
_wizParams.processMode = 8;
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 246:
|
2005-02-24 20:20:35 +00:00
|
|
|
_wizParams.processFlags |= kWPFNewFlags | kWPFSetPos | 2;
|
|
|
|
_wizParams.img.flags |= kWIFIsPolygon;
|
2006-03-31 13:06:23 +00:00
|
|
|
_wizParams.polygonId1 = _wizParams.img.y1 = _wizParams.img.x1 = pop();
|
2004-09-20 09:16:49 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 255:
|
2005-03-04 05:34:56 +00:00
|
|
|
if (_wizParams.img.resNum)
|
2005-05-23 03:33:08 +00:00
|
|
|
_wiz->processWizImage(&_wizParams);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-10-02 01:08:31 +00:00
|
|
|
error("o90_wizImageOps: unhandled case %d", subOp);
|
2004-09-06 00:58:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-06 06:21:04 +00:00
|
|
|
void ScummEngine_v90he::o90_min() {
|
|
|
|
int a = pop();
|
|
|
|
int b = pop();
|
|
|
|
|
|
|
|
if (b < a) {
|
|
|
|
push(b);
|
|
|
|
} else {
|
|
|
|
push(a);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_max() {
|
|
|
|
int a = pop();
|
|
|
|
int b = pop();
|
|
|
|
|
|
|
|
if (b > a) {
|
|
|
|
push(b);
|
|
|
|
} else {
|
|
|
|
push(a);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_sin() {
|
|
|
|
double a = pop() * PI / 180.;
|
|
|
|
push((int)(sin(a) * 100000));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_cos() {
|
|
|
|
double a = pop() * PI / 180.;
|
|
|
|
push((int)(cos(a) * 100000));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_sqrt() {
|
|
|
|
int i = pop();
|
|
|
|
if (i < 2) {
|
|
|
|
push(i);
|
|
|
|
} else {
|
|
|
|
push((int)sqrt((double)(i + 1)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_atan2() {
|
|
|
|
int y = pop();
|
|
|
|
int x = pop();
|
|
|
|
int a = (int)(atan2((double)y, (double)x) * 180. / PI);
|
|
|
|
if (a < 0) {
|
|
|
|
a += 360;
|
|
|
|
}
|
|
|
|
push(a);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_getSegmentAngle() {
|
|
|
|
int y1 = pop();
|
|
|
|
int x1 = pop();
|
|
|
|
int dy = y1 - pop();
|
|
|
|
int dx = x1 - pop();
|
|
|
|
int a = (int)(atan2((double)dy, (double)dx) * 180. / PI);
|
|
|
|
if (a < 0) {
|
|
|
|
a += 360;
|
|
|
|
}
|
|
|
|
push(a);
|
|
|
|
}
|
|
|
|
|
2004-11-21 20:55:56 +00:00
|
|
|
void ScummEngine_v90he::o90_getDistanceBetweenPoints() {
|
|
|
|
int x1, y1, z1, x2, y2, z2, dx, dy, dz, d;
|
2004-10-10 06:32:02 +00:00
|
|
|
|
2006-02-05 00:40:48 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
|
|
|
|
2004-10-10 06:32:02 +00:00
|
|
|
switch (subOp) {
|
2005-03-08 03:52:02 +00:00
|
|
|
case 23: // HE100
|
2004-10-10 06:32:02 +00:00
|
|
|
case 28:
|
2004-11-21 20:55:56 +00:00
|
|
|
y2 = pop();
|
|
|
|
x2 = pop();
|
|
|
|
y1 = pop();
|
|
|
|
x1 = pop();
|
|
|
|
dx = x2 - x1;
|
|
|
|
dy = y2 - y1;
|
|
|
|
d = dx * dx + dy * dy;
|
|
|
|
if (d < 2) {
|
|
|
|
push(d);
|
|
|
|
} else {
|
|
|
|
push((int)sqrt((double)(d + 1)));
|
|
|
|
}
|
2004-10-10 06:32:02 +00:00
|
|
|
break;
|
2005-03-08 03:52:02 +00:00
|
|
|
case 24: // HE100
|
2004-10-10 06:32:02 +00:00
|
|
|
case 29:
|
2004-11-21 20:55:56 +00:00
|
|
|
z2 = pop();
|
|
|
|
y2 = pop();
|
|
|
|
x2 = pop();
|
|
|
|
z1 = pop();
|
|
|
|
y1 = pop();
|
|
|
|
x1 = pop();
|
|
|
|
dx = x2 - x1;
|
|
|
|
dy = y2 - y1;
|
|
|
|
dz = z2 - z1;
|
|
|
|
d = dx * dx + dy * dy + dz * dz;
|
|
|
|
if (d < 2) {
|
|
|
|
push(d);
|
|
|
|
} else {
|
|
|
|
push((int)sqrt((double)(d + 1)));
|
2005-07-30 21:11:48 +00:00
|
|
|
}
|
2004-10-10 06:32:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-11-21 20:55:56 +00:00
|
|
|
error("o90_getDistanceBetweenPoints: Unknown case %d", subOp);
|
2004-10-10 06:32:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-20 11:14:50 +00:00
|
|
|
void ScummEngine_v90he::o90_getSpriteInfo() {
|
2004-09-06 01:19:38 +00:00
|
|
|
int args[16];
|
2005-06-05 08:02:50 +00:00
|
|
|
int spriteId, flags, groupId, type;
|
|
|
|
int32 x, y;
|
2005-02-22 01:25:53 +00:00
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-12 00:48:16 +00:00
|
|
|
|
2004-09-06 01:19:38 +00:00
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 30:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpritePosition(spriteId, x, y);
|
|
|
|
push(x);
|
2005-02-21 00:25:30 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2005-02-21 00:38:13 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 31:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpritePosition(spriteId, x, y);
|
|
|
|
push(y);
|
2005-02-21 00:25:30 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2005-02-21 00:38:13 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 32:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpriteImageDim(spriteId, x, y);
|
|
|
|
push(x);
|
2005-02-20 23:55:11 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 33:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpriteImageDim(spriteId, x, y);
|
|
|
|
push(y);
|
2005-02-20 23:55:11 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 34:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpriteDist(spriteId, x, y);
|
|
|
|
push(x);
|
2005-02-21 00:25:30 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 35:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpriteDist(spriteId, x, y);
|
|
|
|
push(y);
|
2005-02-21 00:25:30 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 36:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteImageStateCount(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 37:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteGroup(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 38:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteDisplayX(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 39:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteDisplayY(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 42:
|
2005-02-21 00:34:00 +00:00
|
|
|
flags = pop();
|
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2006-07-14 13:33:58 +00:00
|
|
|
switch (flags) {
|
2005-02-20 13:26:30 +00:00
|
|
|
case 0:
|
2005-05-23 09:30:43 +00:00
|
|
|
push(_sprite->getSpriteFlagXFlipped(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2005-05-23 09:30:43 +00:00
|
|
|
push(_sprite->getSpriteFlagYFlipped(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2005-05-23 09:30:43 +00:00
|
|
|
push(_sprite->getSpriteFlagActive(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2005-05-23 09:30:43 +00:00
|
|
|
push(_sprite->getSpriteFlagDoubleBuffered(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteFlagRemapPalette(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
push(0);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 43:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpritePriority(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 45:
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.heversion == 99) {
|
2005-02-22 01:25:53 +00:00
|
|
|
flags = getStackList(args, ARRAYSIZE(args));
|
2005-06-05 08:02:50 +00:00
|
|
|
type = pop();
|
|
|
|
groupId = pop();
|
|
|
|
y = pop();
|
|
|
|
x = pop();
|
|
|
|
push(_sprite->findSpriteWithClassOf(x, y, groupId, type, flags, args));
|
2006-02-20 16:51:30 +00:00
|
|
|
} else if (_game.heversion == 98) {
|
2005-06-05 08:02:50 +00:00
|
|
|
type = pop();
|
|
|
|
groupId = pop();
|
|
|
|
y = pop();
|
|
|
|
x = pop();
|
|
|
|
push(_sprite->findSpriteWithClassOf(x, y, groupId, type, 0, 0));
|
2004-09-18 21:44:00 +00:00
|
|
|
} else {
|
2005-06-05 08:02:50 +00:00
|
|
|
groupId = pop();
|
|
|
|
y = pop();
|
|
|
|
x = pop();
|
|
|
|
push(_sprite->findSpriteWithClassOf(x, y, groupId, 0, 0, 0));
|
2004-09-18 21:44:00 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 52:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteImageState(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 62:
|
2005-02-21 04:53:34 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteSourceImage(spriteId));
|
2005-02-21 04:53:34 +00:00
|
|
|
else
|
|
|
|
push(0);
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 63:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteImage(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 68:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteFlagEraseType(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(1);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 82:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteFlagAutoAnim(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 86:
|
2005-02-21 04:53:34 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpritePalette(spriteId));
|
2005-02-21 04:53:34 +00:00
|
|
|
else
|
|
|
|
push(0);
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 92:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteScale(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 97:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteAnimSpeed(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
2005-02-21 04:53:34 +00:00
|
|
|
push(1);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 98:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteShadow(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 124:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteFlagUpdateType(spriteId));
|
2005-02-20 13:26:30 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 125:
|
2005-02-22 01:25:53 +00:00
|
|
|
flags = getStackList(args, ARRAYSIZE(args));
|
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId) {
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteClass(spriteId, flags, args));
|
2005-02-22 01:25:53 +00:00
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 139:
|
2005-02-23 09:55:34 +00:00
|
|
|
flags = pop();
|
2005-02-23 10:00:12 +00:00
|
|
|
spriteId = pop();
|
2005-02-23 09:55:34 +00:00
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteGeneralProperty(spriteId, flags));
|
2005-02-23 09:55:34 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2005-02-20 23:30:37 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 140:
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteMaskImage(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 198:
|
2004-09-18 21:44:00 +00:00
|
|
|
pop();
|
2005-02-21 00:34:00 +00:00
|
|
|
spriteId = pop();
|
|
|
|
if (spriteId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getSpriteUserValue(spriteId));
|
2005-02-20 23:30:37 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-02-20 11:14:50 +00:00
|
|
|
error("o90_getSpriteInfo: Unknown case %d", subOp);
|
2004-09-06 01:19:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-20 11:14:50 +00:00
|
|
|
void ScummEngine_v90he::o90_setSpriteInfo() {
|
2004-09-07 12:56:12 +00:00
|
|
|
int args[16];
|
2005-02-25 20:15:01 +00:00
|
|
|
int spriteId;
|
|
|
|
int32 tmp[2];
|
2005-02-22 22:23:10 +00:00
|
|
|
int n;
|
2005-02-22 01:37:57 +00:00
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-06 00:58:40 +00:00
|
|
|
|
2004-09-07 02:53:22 +00:00
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 34:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpriteDist(spriteId, tmp[0], tmp[1]);
|
|
|
|
_sprite->setSpriteDist(spriteId, args[0], tmp[1]);
|
2005-02-21 02:02:32 +00:00
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 35:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->getSpriteDist(spriteId, tmp[0], tmp[1]);
|
|
|
|
_sprite->setSpriteDist(spriteId, tmp[0], args[0]);
|
2005-02-21 02:02:32 +00:00
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 37:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteGroup(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 42:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[1] = pop();
|
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2006-07-14 13:33:58 +00:00
|
|
|
switch (args[1]) {
|
2005-02-21 02:02:32 +00:00
|
|
|
case 0:
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->setSpriteFlagXFlipped(spriteId, args[0]);
|
2005-02-21 02:02:32 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->setSpriteFlagYFlipped(spriteId, args[0]);
|
2005-02-21 02:02:32 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->setSpriteFlagActive(spriteId, args[0]);
|
2005-02-21 02:02:32 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->setSpriteFlagDoubleBuffered(spriteId, args[0]);
|
2005-02-21 02:02:32 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteFlagRemapPalette(spriteId, args[0]);
|
2005-02-21 02:02:32 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 43:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpritePriority(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 44:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[1] = pop();
|
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->moveSprite(spriteId, args[0], args[1]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 52:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteImageState(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 53:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->setSpriteAngle(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 57:
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.features & GF_HE_985 || _game.heversion >= 99) {
|
2005-02-21 00:02:44 +00:00
|
|
|
_curMaxSpriteId = pop();
|
|
|
|
_curSpriteId = pop();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-02-21 00:02:44 +00:00
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
SWAP(_curSpriteId, _curMaxSpriteId);
|
|
|
|
} else {
|
|
|
|
_curSpriteId = pop();
|
|
|
|
_curMaxSpriteId = _curSpriteId; // to make all functions happy
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 62: // HE99+
|
2005-02-21 00:02:44 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteSourceImage(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 63:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteImage(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 65:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[1] = pop();
|
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpritePosition(spriteId, args[0], args[1]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 68:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteFlagEraseType(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 77:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[1] = pop();
|
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteDist(spriteId, args[0], args[1]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 82:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteFlagAutoAnim(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 86: // HE 98+
|
2005-02-21 00:02:44 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpritePalette(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 92: // HE 99+
|
2005-02-21 00:59:50 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteScale(spriteId, args[0]);
|
2004-10-02 07:46:06 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 97: // HE 98+
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteAnimSpeed(spriteId, args[0]);
|
2004-09-30 09:35:02 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 98:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteShadow(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 124:
|
2005-02-21 02:02:32 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteFlagUpdateType(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 125:
|
2005-02-22 22:23:10 +00:00
|
|
|
n = getStackList(args, ARRAYSIZE(args));
|
|
|
|
if (_curSpriteId != 0 && _curMaxSpriteId != 0 && n != 0) {
|
|
|
|
int *p = &args[n - 1];
|
|
|
|
do {
|
|
|
|
int code = *p;
|
|
|
|
if (code == 0) {
|
|
|
|
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
|
2005-07-30 21:11:48 +00:00
|
|
|
_sprite->setSpriteResetClass(i);
|
2005-02-22 22:23:10 +00:00
|
|
|
}
|
|
|
|
} else if (code & 0x80) {
|
|
|
|
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteSetClass(i, code & 0x7F, 1);
|
2005-02-22 22:23:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) {
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteSetClass(i, code & 0x7F, 0);
|
2005-02-22 22:23:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--p;
|
|
|
|
} while (--n);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 139: // HE 99+
|
2005-02-23 09:23:54 +00:00
|
|
|
args[1] = pop();
|
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteGeneralProperty(spriteId, args[0], args[1]);
|
2004-10-10 06:32:02 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 140: // HE 99+
|
2005-02-21 00:02:44 +00:00
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteMaskImage(spriteId, args[0]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 158:
|
2005-05-23 11:50:36 +00:00
|
|
|
_sprite->resetTables(true);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 198:
|
2005-02-21 00:59:50 +00:00
|
|
|
args[1] = pop();
|
|
|
|
args[0] = pop();
|
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setSpriteUserValue(spriteId, args[0], args[1]);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 217:
|
2005-02-21 00:02:44 +00:00
|
|
|
if (_curSpriteId > _curMaxSpriteId)
|
|
|
|
break;
|
|
|
|
spriteId = _curSpriteId;
|
|
|
|
if (!spriteId)
|
|
|
|
spriteId++;
|
|
|
|
|
|
|
|
for (; spriteId <= _curMaxSpriteId; spriteId++)
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->resetSprite(spriteId);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-02-20 11:14:50 +00:00
|
|
|
error("o90_setSpriteInfo: Unknown case %d", subOp);
|
2004-09-06 01:54:24 +00:00
|
|
|
}
|
2004-09-06 00:58:40 +00:00
|
|
|
}
|
|
|
|
|
2005-02-20 11:14:50 +00:00
|
|
|
void ScummEngine_v90he::o90_getSpriteGroupInfo() {
|
2005-02-21 01:08:48 +00:00
|
|
|
int32 tx, ty;
|
2005-02-21 02:37:05 +00:00
|
|
|
int spriteGroupId, type;
|
2005-02-21 01:08:48 +00:00
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2005-02-22 01:37:57 +00:00
|
|
|
|
2004-09-06 08:53:19 +00:00
|
|
|
switch (subOp) {
|
2004-09-30 10:24:26 +00:00
|
|
|
case 8: // HE 99+
|
2005-02-21 02:37:05 +00:00
|
|
|
spriteGroupId = pop();
|
|
|
|
if (spriteGroupId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(getGroupSpriteArray(spriteGroupId));
|
2005-02-21 02:37:05 +00:00
|
|
|
else
|
|
|
|
push(0);
|
2004-09-30 10:24:26 +00:00
|
|
|
break;
|
2004-09-18 21:44:00 +00:00
|
|
|
case 30:
|
2005-02-21 02:37:05 +00:00
|
|
|
spriteGroupId = pop();
|
|
|
|
if (spriteGroupId) {
|
2006-02-04 08:19:10 +00:00
|
|
|
_sprite->getGroupPosition(spriteGroupId, tx, ty);
|
2005-02-21 01:08:48 +00:00
|
|
|
push(tx);
|
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
case 31:
|
2005-02-21 02:37:05 +00:00
|
|
|
spriteGroupId = pop();
|
|
|
|
if (spriteGroupId) {
|
2006-02-04 08:19:10 +00:00
|
|
|
_sprite->getGroupPosition(spriteGroupId, tx, ty);
|
2005-02-21 01:08:48 +00:00
|
|
|
push(ty);
|
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2004-09-30 10:24:26 +00:00
|
|
|
case 42: // HE 99+
|
2005-02-21 01:08:48 +00:00
|
|
|
type = pop();
|
2005-02-21 02:37:05 +00:00
|
|
|
spriteGroupId = pop();
|
|
|
|
if (spriteGroupId) {
|
2006-07-14 13:33:58 +00:00
|
|
|
switch (type) {
|
2005-02-21 01:08:48 +00:00
|
|
|
case 0:
|
2006-02-04 08:19:10 +00:00
|
|
|
push(_sprite->getGroupXMul(spriteGroupId));
|
2005-02-21 01:08:48 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2006-02-04 08:19:10 +00:00
|
|
|
push(_sprite->getGroupXDiv(spriteGroupId));
|
2005-02-21 01:08:48 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2006-02-04 08:19:10 +00:00
|
|
|
push(_sprite->getGroupYMul(spriteGroupId));
|
2005-02-21 01:08:48 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2006-02-04 08:19:10 +00:00
|
|
|
push(_sprite->getGroupYDiv(spriteGroupId));
|
2005-02-21 01:08:48 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
push(0);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
push(0);
|
|
|
|
}
|
2004-09-30 10:24:26 +00:00
|
|
|
break;
|
2004-09-18 21:44:00 +00:00
|
|
|
case 43:
|
2005-02-21 02:37:05 +00:00
|
|
|
spriteGroupId = pop();
|
2005-02-21 04:53:34 +00:00
|
|
|
if (spriteGroupId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getGroupPriority(spriteGroupId));
|
2005-02-21 04:53:34 +00:00
|
|
|
else
|
2005-02-21 01:08:48 +00:00
|
|
|
push(0);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2004-09-30 10:24:26 +00:00
|
|
|
case 63: // HE 99+
|
2005-02-21 02:37:05 +00:00
|
|
|
spriteGroupId = pop();
|
2005-02-21 04:53:34 +00:00
|
|
|
if (spriteGroupId)
|
2005-06-05 08:02:50 +00:00
|
|
|
push(_sprite->getGroupDstResNum(spriteGroupId));
|
2005-02-21 04:53:34 +00:00
|
|
|
else
|
2005-02-21 01:08:48 +00:00
|
|
|
push(0);
|
2004-09-30 10:24:26 +00:00
|
|
|
break;
|
|
|
|
case 139: // HE 99+
|
2005-02-21 01:08:48 +00:00
|
|
|
// dummy case
|
2004-09-30 10:24:26 +00:00
|
|
|
pop();
|
|
|
|
pop();
|
2005-02-21 01:08:48 +00:00
|
|
|
push(0);
|
2004-09-30 10:24:26 +00:00
|
|
|
break;
|
2004-09-18 21:44:00 +00:00
|
|
|
default:
|
2005-02-20 11:14:50 +00:00
|
|
|
error("o90_getSpriteGroupInfo: Unknown case %d", subOp);
|
2004-09-06 08:53:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-20 11:14:50 +00:00
|
|
|
void ScummEngine_v90he::o90_setSpriteGroupInfo() {
|
2005-02-23 01:08:29 +00:00
|
|
|
int type, value1, value2, value3, value4;
|
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-06 02:39:02 +00:00
|
|
|
|
2004-09-07 02:53:22 +00:00
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 37:
|
2005-02-23 01:08:29 +00:00
|
|
|
type = pop() - 1;
|
|
|
|
switch (type) {
|
|
|
|
case 0:
|
|
|
|
value2 = pop();
|
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->moveGroupMembers(_curSpriteGroupId, value1, value2);
|
2005-02-23 01:08:29 +00:00
|
|
|
break;
|
2004-10-17 09:17:32 +00:00
|
|
|
case 1:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersPriority(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersGroup(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersUpdateType(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2005-02-23 01:08:29 +00:00
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersResetSprite(_curSpriteGroupId);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersAnimationSpeed(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersAutoAnimFlag(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupMembersShadow(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-02-20 11:14:50 +00:00
|
|
|
error("o90_setSpriteGroupInfo subOp 0: Unknown case %d", subOp);
|
2004-10-17 09:17:32 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 42:
|
2005-02-23 01:08:29 +00:00
|
|
|
type = pop();
|
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case 0:
|
2006-02-04 08:19:10 +00:00
|
|
|
_sprite->setGroupXMul(_curSpriteGroupId, value1);
|
2005-02-23 01:08:29 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2006-02-04 08:19:10 +00:00
|
|
|
_sprite->setGroupXDiv(_curSpriteGroupId, value1);
|
2005-02-23 01:08:29 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2006-02-04 08:19:10 +00:00
|
|
|
_sprite->setGroupYMul(_curSpriteGroupId, value1);
|
2005-02-23 01:08:29 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2006-02-04 08:19:10 +00:00
|
|
|
_sprite->setGroupYDiv(_curSpriteGroupId, value1);
|
2005-02-23 01:08:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_setSpriteGroupInfo subOp 5: Unknown case %d", subOp);
|
|
|
|
}
|
2004-10-10 06:32:02 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 43:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupPriority(_curSpriteGroupId, value1);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 44:
|
2005-02-23 01:08:29 +00:00
|
|
|
value2 = pop();
|
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:22:09 +00:00
|
|
|
_sprite->moveGroup(_curSpriteGroupId, value1, value2);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 57:
|
2005-02-23 01:08:29 +00:00
|
|
|
_curSpriteGroupId = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 63:
|
2005-02-23 01:08:29 +00:00
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupImage(_curSpriteGroupId, value1);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 65:
|
2005-02-23 01:08:29 +00:00
|
|
|
value2 = pop();
|
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:22:09 +00:00
|
|
|
_sprite->setGroupPosition(_curSpriteGroupId, value1, value2);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 67:
|
2005-02-23 01:08:29 +00:00
|
|
|
value4 = pop();
|
|
|
|
value3 = pop();
|
|
|
|
value2 = pop();
|
|
|
|
value1 = pop();
|
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->setGroupBounds(_curSpriteGroupId, value1, value2, value3, value4);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 93:
|
2005-02-23 01:08:29 +00:00
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-06-05 08:02:50 +00:00
|
|
|
_sprite->resetGroupBounds(_curSpriteGroupId);
|
2004-10-17 09:17:32 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 217:
|
2005-02-23 01:08:29 +00:00
|
|
|
if (!_curSpriteGroupId)
|
|
|
|
break;
|
|
|
|
|
2005-05-23 11:50:36 +00:00
|
|
|
_sprite->resetGroup(_curSpriteGroupId);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-02-20 11:14:50 +00:00
|
|
|
error("o90_setSpriteGroupInfo: Unknown case %d", subOp);
|
2004-09-06 02:39:02 +00:00
|
|
|
}
|
2004-09-07 03:42:15 +00:00
|
|
|
}
|
|
|
|
|
2004-11-22 20:34:29 +00:00
|
|
|
void ScummEngine_v90he::o90_getWizData() {
|
2005-05-07 11:07:45 +00:00
|
|
|
byte filename[4096];
|
2009-06-04 01:05:47 +00:00
|
|
|
int resId, state, type;
|
2004-10-16 20:38:37 +00:00
|
|
|
int32 w, h;
|
2006-01-16 09:20:27 +00:00
|
|
|
int32 x, y;
|
2004-09-22 00:22:32 +00:00
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-07 03:42:15 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 30:
|
2004-09-22 00:22:32 +00:00
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
2006-01-31 00:46:20 +00:00
|
|
|
_wiz->getWizImageSpot(resId, state, x, y);
|
2004-09-26 15:29:58 +00:00
|
|
|
push(x);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 31:
|
2004-09-22 00:22:32 +00:00
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
2006-01-31 00:46:20 +00:00
|
|
|
_wiz->getWizImageSpot(resId, state, x, y);
|
2004-09-26 15:29:58 +00:00
|
|
|
push(y);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 32:
|
2004-09-22 00:22:32 +00:00
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
2005-05-23 03:33:08 +00:00
|
|
|
_wiz->getWizImageDim(resId, state, w, h);
|
2004-09-22 00:22:32 +00:00
|
|
|
push(w);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 33:
|
2004-09-22 00:22:32 +00:00
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
2005-05-23 03:33:08 +00:00
|
|
|
_wiz->getWizImageDim(resId, state, w, h);
|
2004-09-22 00:22:32 +00:00
|
|
|
push(h);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 36:
|
2004-10-16 05:10:15 +00:00
|
|
|
resId = pop();
|
2005-05-23 03:33:08 +00:00
|
|
|
push(_wiz->getWizImageStates(resId));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 45:
|
2004-11-21 21:31:28 +00:00
|
|
|
y = pop();
|
|
|
|
x = pop();
|
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
2005-05-23 03:33:08 +00:00
|
|
|
push(_wiz->isWizPixelNonTransparent(resId, state, x, y, 0));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 66:
|
2004-11-21 21:31:28 +00:00
|
|
|
y = pop();
|
|
|
|
x = pop();
|
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
2009-06-05 04:16:32 +00:00
|
|
|
push(_wiz->getWizPixelColor(resId, state, x, y));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 130:
|
2004-11-22 20:34:29 +00:00
|
|
|
h = pop();
|
|
|
|
w = pop();
|
|
|
|
y = pop();
|
|
|
|
x = pop();
|
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
|
|
|
if (x == -1 && y == -1 && w == -1 && h == -1) {
|
2005-05-23 03:33:08 +00:00
|
|
|
_wiz->getWizImageDim(resId, state, w, h);
|
2004-11-22 20:34:29 +00:00
|
|
|
x = 0;
|
|
|
|
y = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
}
|
|
|
|
push(computeWizHistogram(resId, state, x, y, w, h));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 139:
|
2009-06-04 01:05:47 +00:00
|
|
|
type = pop();
|
|
|
|
state = pop();
|
|
|
|
resId = pop();
|
|
|
|
push(_wiz->getWizImageData(resId, state, type));
|
2005-07-30 21:11:48 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 141:
|
2005-05-07 11:07:45 +00:00
|
|
|
pop();
|
|
|
|
copyScriptString(filename, sizeof(filename));
|
|
|
|
pop();
|
|
|
|
push(0);
|
2005-08-14 01:41:52 +00:00
|
|
|
debug(0, "o90_getWizData() case 111 unhandled");
|
2005-05-07 11:07:45 +00:00
|
|
|
break;
|
2004-09-18 21:44:00 +00:00
|
|
|
default:
|
2004-11-22 20:34:29 +00:00
|
|
|
error("o90_getWizData: Unknown case %d", subOp);
|
2004-09-07 03:42:15 +00:00
|
|
|
}
|
2004-09-06 02:39:02 +00:00
|
|
|
}
|
|
|
|
|
2008-01-06 06:21:04 +00:00
|
|
|
void ScummEngine_v90he::o90_getActorData() {
|
2008-09-25 10:11:06 +00:00
|
|
|
ActorHE *a;
|
2008-01-06 06:21:04 +00:00
|
|
|
|
|
|
|
int subOp = pop();
|
|
|
|
int val = pop();
|
|
|
|
int act = pop();
|
|
|
|
|
2008-09-25 10:11:06 +00:00
|
|
|
a = (ActorHE *)derefActor(act, "o90_getActorData");
|
2008-01-06 06:21:04 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
|
|
|
case 1:
|
|
|
|
push(a->isUserConditionSet(val));
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
assertRange(0, val, 15, "o90_getActorData: Limb");
|
2009-01-04 06:15:01 +00:00
|
|
|
push(a->_cost.frame[val] * 4);
|
2008-01-06 06:21:04 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
push(a->getAnimSpeed());
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
push(a->_shadowMode);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
push(a->_layer);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
push(a->_hePaletteNum);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_getActorData: Unknown actor property %d", subOp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_startScriptUnk() {
|
|
|
|
int args[25];
|
|
|
|
int script, cycle;
|
|
|
|
byte flags;
|
|
|
|
|
|
|
|
getStackList(args, ARRAYSIZE(args));
|
|
|
|
cycle = pop();
|
|
|
|
script = pop();
|
|
|
|
flags = fetchScriptByte();
|
|
|
|
runScript(script, (flags == 199 || flags == 200), (flags == 195 || flags == 200), args, cycle);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_jumpToScriptUnk() {
|
|
|
|
int args[25];
|
|
|
|
int script, cycle;
|
|
|
|
byte flags;
|
|
|
|
|
|
|
|
getStackList(args, ARRAYSIZE(args));
|
|
|
|
cycle = pop();
|
|
|
|
script = pop();
|
|
|
|
flags = fetchScriptByte();
|
|
|
|
stopObjectCode();
|
|
|
|
runScript(script, (flags == 199 || flags == 200), (flags == 195 || flags == 200), args, cycle);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_videoOps() {
|
|
|
|
// Uses Smacker video
|
|
|
|
int status = fetchScriptByte();
|
|
|
|
int subOp = status - 49;
|
|
|
|
|
|
|
|
switch (subOp) {
|
|
|
|
case 0:
|
|
|
|
copyScriptString(_videoParams.filename, sizeof(_videoParams.filename));
|
|
|
|
_videoParams.status = status;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
_videoParams.flags |= pop();
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
memset(_videoParams.filename, 0, sizeof(_videoParams.filename));
|
2008-12-27 02:36:08 +00:00
|
|
|
_videoParams.status = 0;
|
|
|
|
_videoParams.flags = 0;
|
2008-01-06 06:21:04 +00:00
|
|
|
_videoParams.unk2 = pop();
|
2008-12-27 02:36:08 +00:00
|
|
|
_videoParams.wizResNum = 0;
|
2008-01-06 06:21:04 +00:00
|
|
|
break;
|
|
|
|
case 14:
|
|
|
|
_videoParams.wizResNum = pop();
|
|
|
|
if (_videoParams.wizResNum)
|
|
|
|
_videoParams.flags |= 2;
|
|
|
|
break;
|
|
|
|
case 116:
|
|
|
|
_videoParams.status = status;
|
|
|
|
break;
|
|
|
|
case 206:
|
|
|
|
if (_videoParams.status == 49) {
|
|
|
|
// Start video
|
|
|
|
if (_videoParams.flags == 0)
|
|
|
|
_videoParams.flags = 4;
|
|
|
|
|
2009-07-23 10:33:13 +00:00
|
|
|
const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename, sizeof(_videoParams.filename));
|
2008-01-06 06:21:04 +00:00
|
|
|
if (_videoParams.flags & 2) {
|
|
|
|
VAR(119) = _moviePlay->load(filename, _videoParams.flags, _videoParams.wizResNum);
|
|
|
|
} else {
|
|
|
|
VAR(119) = _moviePlay->load(filename, _videoParams.flags);
|
|
|
|
}
|
|
|
|
} else if (_videoParams.status == 165) {
|
|
|
|
// Stop video
|
2010-05-18 14:17:24 +00:00
|
|
|
_moviePlay->close();
|
2008-01-06 06:21:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_videoOps: unhandled case %d", subOp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_getVideoData() {
|
|
|
|
// Uses Smacker video
|
|
|
|
byte subOp = fetchScriptByte();
|
|
|
|
|
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 32: // Get width
|
2008-01-06 06:21:04 +00:00
|
|
|
pop();
|
|
|
|
push(_moviePlay->getWidth());
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 33: // Get height
|
2008-01-06 06:21:04 +00:00
|
|
|
pop();
|
|
|
|
push(_moviePlay->getHeight());
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 36: // Get frame count
|
2008-01-06 06:21:04 +00:00
|
|
|
pop();
|
|
|
|
push(_moviePlay->getFrameCount());
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 52: // Get current frame
|
2008-01-06 06:21:04 +00:00
|
|
|
pop();
|
2010-05-17 21:59:05 +00:00
|
|
|
push(_moviePlay->endOfVideo() ? -1 : (_moviePlay->getCurFrame() + 1));
|
2008-01-06 06:21:04 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 63: // Get image number
|
2008-01-06 06:21:04 +00:00
|
|
|
pop();
|
|
|
|
push(_moviePlay->getImageNum());
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 139: // Get statistics
|
2008-01-06 06:21:04 +00:00
|
|
|
debug(0, "o90_getVideoData: subOp 107 stub (%d, %d)", pop(), pop());
|
|
|
|
push(0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_getVideoData: unhandled case %d", subOp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-18 19:17:19 +00:00
|
|
|
void ScummEngine_v90he::o90_floodFill() {
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-10 14:31:20 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 54:
|
2006-01-10 21:39:14 +00:00
|
|
|
pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 57:
|
2005-10-18 19:17:19 +00:00
|
|
|
memset(&_floodFillParams, 0, sizeof(_floodFillParams));
|
|
|
|
_floodFillParams.box.left = 0;
|
|
|
|
_floodFillParams.box.top = 0;
|
|
|
|
_floodFillParams.box.right = 639;
|
|
|
|
_floodFillParams.box.bottom = 479;
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 65:
|
2005-10-18 19:17:19 +00:00
|
|
|
_floodFillParams.y = pop();
|
|
|
|
_floodFillParams.x = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 66:
|
2005-10-18 19:17:19 +00:00
|
|
|
_floodFillParams.flags = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 67:
|
2005-10-18 19:17:19 +00:00
|
|
|
_floodFillParams.box.bottom = pop();
|
|
|
|
_floodFillParams.box.right = pop();
|
|
|
|
_floodFillParams.box.top = pop();
|
|
|
|
_floodFillParams.box.left = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 255:
|
2005-10-18 19:17:19 +00:00
|
|
|
floodFill(&_floodFillParams, this);
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-10-18 19:17:19 +00:00
|
|
|
error("o90_floodFill: Unknown case %d", subOp);
|
2004-09-10 14:31:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-06 06:21:04 +00:00
|
|
|
void ScummEngine_v90he::o90_mod() {
|
|
|
|
int a = pop();
|
|
|
|
if (a == 0)
|
|
|
|
error("modulus by zero");
|
|
|
|
push(pop() % a);
|
|
|
|
}
|
|
|
|
|
2004-11-28 05:33:33 +00:00
|
|
|
void ScummEngine_v90he::o90_shl() {
|
|
|
|
int a = pop();
|
2004-09-30 09:35:02 +00:00
|
|
|
push(pop() << a);
|
|
|
|
}
|
|
|
|
|
2004-11-28 05:33:33 +00:00
|
|
|
void ScummEngine_v90he::o90_shr() {
|
|
|
|
int a = pop();
|
2004-09-30 09:35:02 +00:00
|
|
|
push(pop() >> a);
|
|
|
|
}
|
|
|
|
|
2005-04-09 06:39:20 +00:00
|
|
|
void ScummEngine_v90he::o90_xor() {
|
|
|
|
int a = pop();
|
|
|
|
push(pop() ^ a);
|
|
|
|
}
|
|
|
|
|
2004-10-03 05:29:31 +00:00
|
|
|
void ScummEngine_v90he::o90_findAllObjectsWithClassOf() {
|
2004-09-12 10:23:20 +00:00
|
|
|
int args[16];
|
2004-10-03 06:07:25 +00:00
|
|
|
int cond, num, cls, tmp;
|
2004-10-03 05:29:31 +00:00
|
|
|
bool b;
|
2004-09-12 10:23:20 +00:00
|
|
|
|
2004-10-03 05:29:31 +00:00
|
|
|
num = getStackList(args, ARRAYSIZE(args));
|
2004-09-12 10:23:20 +00:00
|
|
|
int room = pop();
|
2005-04-08 07:49:06 +00:00
|
|
|
int numObjs = 0;
|
2004-09-12 10:23:20 +00:00
|
|
|
|
|
|
|
if (room != _currentRoom)
|
2005-04-08 07:49:06 +00:00
|
|
|
error("o90_findAllObjectsWithClassOf: current room is not %d", room);
|
2004-10-03 06:07:25 +00:00
|
|
|
|
2004-09-12 10:23:20 +00:00
|
|
|
writeVar(0, 0);
|
2005-04-08 07:49:06 +00:00
|
|
|
defineArray(0, kDwordArray, 0, 0, 0, _numLocalObjects);
|
2004-10-03 05:34:48 +00:00
|
|
|
for (int i = 1; i < _numLocalObjects; i++) {
|
2004-10-03 05:29:31 +00:00
|
|
|
cond = 1;
|
|
|
|
tmp = num;
|
|
|
|
while (--tmp >= 0) {
|
|
|
|
cls = args[tmp];
|
2005-03-28 11:38:04 +00:00
|
|
|
b = getClass(_objs[i].obj_nr, cls);
|
2004-10-03 05:29:31 +00:00
|
|
|
if ((cls & 0x80 && !b) || (!(cls & 0x80) && b))
|
|
|
|
cond = 0;
|
|
|
|
}
|
|
|
|
|
2005-04-08 07:49:06 +00:00
|
|
|
if (cond) {
|
|
|
|
numObjs++;
|
|
|
|
writeArray(0, 0, numObjs, _objs[i].obj_nr);
|
|
|
|
}
|
2004-09-12 10:23:20 +00:00
|
|
|
}
|
2005-03-28 11:38:04 +00:00
|
|
|
|
2005-04-08 07:49:06 +00:00
|
|
|
writeArray(0, 0, 0, numObjs);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-09-12 10:23:20 +00:00
|
|
|
push(readVar(0));
|
2004-09-10 14:31:20 +00:00
|
|
|
}
|
|
|
|
|
2004-10-04 02:23:02 +00:00
|
|
|
void ScummEngine_v90he::o90_getPolygonOverlap() {
|
2004-10-09 16:10:53 +00:00
|
|
|
int args1[32];
|
2004-09-30 09:54:45 +00:00
|
|
|
int args2[32];
|
|
|
|
|
2004-10-09 16:10:53 +00:00
|
|
|
int n1 = getStackList(args1, ARRAYSIZE(args1));
|
2005-03-31 02:28:14 +00:00
|
|
|
int n2 = getStackList(args2, ARRAYSIZE(args2));
|
2004-09-30 09:54:45 +00:00
|
|
|
|
|
|
|
int subOp = pop();
|
|
|
|
|
|
|
|
switch (subOp) {
|
|
|
|
case 1:
|
2004-10-09 16:10:53 +00:00
|
|
|
{
|
|
|
|
Common::Rect r(args1[0], args1[1], args1[2] + 1, args1[3] + 1);
|
|
|
|
Common::Point p(args2[0], args2[1]);
|
|
|
|
push(r.contains(p) ? 1 : 0);
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 2:
|
2004-10-09 16:10:53 +00:00
|
|
|
{
|
|
|
|
int dx = args2[0] - args1[0];
|
|
|
|
int dy = args2[1] - args1[1];
|
|
|
|
int dist = dx * dx + dy * dy;
|
|
|
|
if (dist >= 2) {
|
2004-10-16 20:38:37 +00:00
|
|
|
dist = (int)sqrt((double)(dist + 1));
|
2004-10-09 16:10:53 +00:00
|
|
|
}
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.heversion >= 98) {
|
2005-05-23 00:39:55 +00:00
|
|
|
push((dist <= args1[2]) ? 1 : 0);
|
|
|
|
} else {
|
|
|
|
push((dist > args1[2]) ? 1 : 0);
|
|
|
|
}
|
2004-10-09 16:10:53 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 3:
|
2004-10-09 16:10:53 +00:00
|
|
|
{
|
|
|
|
Common::Rect r1(args1[0], args1[1], args1[2] + 1, args1[3] + 1);
|
|
|
|
Common::Rect r2(args2[0], args2[1], args2[2] + 1, args2[3] + 1);
|
2005-07-30 21:11:48 +00:00
|
|
|
push(r2.intersects(r1) ? 1 : 0);
|
2004-10-09 16:10:53 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 4:
|
2004-10-09 16:10:53 +00:00
|
|
|
{
|
|
|
|
int dx = args2[0] - args1[0];
|
|
|
|
int dy = args2[1] - args1[1];
|
|
|
|
int dist = dx * dx + dy * dy;
|
|
|
|
if (dist >= 2) {
|
2004-10-16 20:38:37 +00:00
|
|
|
dist = (int)sqrt((double)(dist + 1));
|
2004-10-09 16:10:53 +00:00
|
|
|
}
|
|
|
|
push((dist < args1[2] && dist < args2[2]) ? 1 : 0);
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 5:
|
2004-10-09 16:10:53 +00:00
|
|
|
{
|
|
|
|
assert((n1 & 1) == 0);
|
|
|
|
n1 /= 2;
|
|
|
|
if (n1 == 0) {
|
|
|
|
push(0);
|
|
|
|
} else {
|
|
|
|
WizPolygon wp;
|
|
|
|
memset(&wp, 0, sizeof(wp));
|
|
|
|
wp.numVerts = n1;
|
|
|
|
assert(n1 < ARRAYSIZE(wp.vert));
|
|
|
|
for (int i = 0; i < n1; ++i) {
|
|
|
|
wp.vert[i].x = args1[i * 2 + 0];
|
|
|
|
wp.vert[i].y = args1[i * 2 + 1];
|
|
|
|
}
|
2005-05-23 02:00:49 +00:00
|
|
|
push(_wiz->polygonContains(wp, args2[0], args2[1]) ? 1 : 0);
|
2004-10-09 16:10:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
// HE 98+
|
|
|
|
case 6:
|
2005-03-31 02:28:14 +00:00
|
|
|
{
|
|
|
|
Common::Rect r1, r2;
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->getSpriteBounds(args2[0], false, r2);
|
|
|
|
_sprite->getSpriteBounds(args1[0], false, r1);
|
2005-03-31 02:28:14 +00:00
|
|
|
if (r2.isValidRect() == false) {
|
|
|
|
push(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
if (n2 == 3) {
|
2005-03-31 02:28:14 +00:00
|
|
|
r2.left += args2[1];
|
|
|
|
r2.right += args2[1];
|
|
|
|
r2.top += args2[2];
|
|
|
|
r2.bottom += args2[2];
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
if (n1 == 3) {
|
2005-03-31 09:56:14 +00:00
|
|
|
r1.left += args1[1];
|
|
|
|
r1.right += args1[1];
|
|
|
|
r1.top += args1[2];
|
|
|
|
r1.bottom += args1[2];
|
|
|
|
}
|
2005-03-31 02:28:14 +00:00
|
|
|
push(r2.intersects(r1) ? 1 : 0);
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 7:
|
2005-03-31 02:28:14 +00:00
|
|
|
{
|
|
|
|
Common::Rect r2;
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->getSpriteBounds(args2[0], false, r2);
|
2005-03-31 02:28:14 +00:00
|
|
|
Common::Rect r1(args1[0], args1[1], args1[2], args1[3]);
|
|
|
|
if (r2.isValidRect() == false) {
|
|
|
|
push(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
if (n2 == 3) {
|
2005-03-31 02:28:14 +00:00
|
|
|
r2.left += args2[1];
|
|
|
|
r2.right += args2[1];
|
|
|
|
r2.top += args2[2];
|
|
|
|
r2.bottom += args2[2];
|
|
|
|
}
|
|
|
|
push(r2.intersects(r1) ? 1 : 0);
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 8:
|
2005-06-05 04:53:43 +00:00
|
|
|
case 10: // TODO: Draw sprites to buffer and compare.
|
2005-03-31 02:28:14 +00:00
|
|
|
{
|
|
|
|
Common::Rect r1, r2;
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->getSpriteBounds(args2[0], true, r2);
|
|
|
|
_sprite->getSpriteBounds(args1[0], true, r1);
|
2005-03-31 02:28:14 +00:00
|
|
|
if (r2.isValidRect() == false) {
|
|
|
|
push(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
if (n2 == 3) {
|
2005-03-31 02:28:14 +00:00
|
|
|
r2.left += args2[1];
|
|
|
|
r2.right += args2[1];
|
|
|
|
r2.top += args2[2];
|
|
|
|
r2.bottom += args2[2];
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
if (n1 == 3) {
|
2005-03-31 09:56:14 +00:00
|
|
|
r1.left += args1[1];
|
|
|
|
r1.right += args1[1];
|
|
|
|
r1.top += args1[2];
|
|
|
|
r1.bottom += args1[2];
|
|
|
|
}
|
2005-03-31 02:28:14 +00:00
|
|
|
push(r2.intersects(r1) ? 1 : 0);
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
case 9:
|
2005-03-31 02:28:14 +00:00
|
|
|
{
|
|
|
|
Common::Rect r2;
|
2005-05-23 09:30:43 +00:00
|
|
|
_sprite->getSpriteBounds(args2[0], true, r2);
|
2005-03-31 02:28:14 +00:00
|
|
|
Common::Rect r1(args1[0], args1[1], args1[2], args1[3]);
|
|
|
|
if (r2.isValidRect() == false) {
|
|
|
|
push(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
if (n2 == 3) {
|
2005-03-31 02:28:14 +00:00
|
|
|
r2.left += args2[1];
|
|
|
|
r2.right += args2[1];
|
|
|
|
r2.top += args2[2];
|
|
|
|
r2.bottom += args2[2];
|
|
|
|
}
|
|
|
|
push(r2.intersects(r1) ? 1 : 0);
|
|
|
|
}
|
|
|
|
break;
|
2004-09-30 09:54:45 +00:00
|
|
|
default:
|
2004-10-04 02:23:02 +00:00
|
|
|
error("o90_getPolygonOverlap: default case %d", subOp);
|
2004-09-30 09:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-11-26 20:17:02 +00:00
|
|
|
void ScummEngine_v90he::o90_cond() {
|
2004-09-12 11:15:26 +00:00
|
|
|
int a = pop();
|
|
|
|
int b = pop();
|
|
|
|
int c = pop();
|
|
|
|
|
|
|
|
if (!c)
|
|
|
|
b = a;
|
|
|
|
push(b);
|
|
|
|
}
|
|
|
|
|
2004-10-04 01:34:29 +00:00
|
|
|
void ScummEngine_v90he::o90_dim2dim2Array() {
|
2004-09-07 12:56:12 +00:00
|
|
|
int data, dim1start, dim1end, dim2start, dim2end;
|
|
|
|
|
2006-02-05 00:40:48 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
|
|
|
|
|
|
|
switch (subOp) {
|
2004-09-07 12:56:12 +00:00
|
|
|
case 2: // SO_BIT_ARRAY
|
|
|
|
data = kBitArray;
|
|
|
|
break;
|
|
|
|
case 3: // SO_NIBBLE_ARRAY
|
|
|
|
data = kNibbleArray;
|
|
|
|
break;
|
|
|
|
case 4: // SO_BYTE_ARRAY
|
|
|
|
data = kByteArray;
|
|
|
|
break;
|
|
|
|
case 5: // SO_INT_ARRAY
|
|
|
|
data = kIntArray;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
data = kDwordArray;
|
|
|
|
break;
|
|
|
|
case 7: // SO_STRING_ARRAY
|
|
|
|
data = kStringArray;
|
|
|
|
break;
|
|
|
|
default:
|
2006-02-05 00:40:48 +00:00
|
|
|
error("o90_dim2dim2Array: default case %d", subOp);
|
2004-09-07 12:56:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pop() == 2) {
|
|
|
|
dim1end = pop();
|
|
|
|
dim1start = pop();
|
|
|
|
dim2end = pop();
|
|
|
|
dim2start = pop();
|
|
|
|
} else {
|
|
|
|
dim2end = pop();
|
|
|
|
dim2start = pop();
|
|
|
|
dim1end = pop();
|
|
|
|
dim1start = pop();
|
|
|
|
}
|
|
|
|
|
|
|
|
defineArray(fetchScriptWord(), data, dim2start, dim2end, dim1start, dim1end);
|
|
|
|
}
|
|
|
|
|
2005-03-07 10:21:23 +00:00
|
|
|
void ScummEngine_v90he::o90_redim2dimArray() {
|
|
|
|
int a, b, c, d;
|
|
|
|
d = pop();
|
|
|
|
c = pop();
|
|
|
|
b = pop();
|
|
|
|
a = pop();
|
|
|
|
|
|
|
|
byte subOp = fetchScriptByte();
|
|
|
|
|
|
|
|
switch (subOp) {
|
|
|
|
case 4:
|
|
|
|
redimArray(fetchScriptWord(), a, b, c, d, kByteArray);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
redimArray(fetchScriptWord(), a, b, c, d, kIntArray);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
redimArray(fetchScriptWord(), a, b, c, d, kDwordArray);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_redim2dimArray: default type %d", subOp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-13 19:48:49 +00:00
|
|
|
void ScummEngine_v90he::o90_getLinesIntersectionPoint() {
|
|
|
|
int var_ix = fetchScriptWord();
|
|
|
|
int var_iy = fetchScriptWord();
|
|
|
|
int line2_y2 = pop();
|
|
|
|
int line2_x2 = pop();
|
|
|
|
int line2_y1 = pop();
|
|
|
|
int line2_x1 = pop();
|
|
|
|
int line1_y2 = pop();
|
|
|
|
int line1_x2 = pop();
|
|
|
|
int line1_y1 = pop();
|
|
|
|
int line1_x1 = pop();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-16 14:22:14 +00:00
|
|
|
int result = 0;
|
|
|
|
int ix = 0;
|
|
|
|
int iy = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-16 14:22:14 +00:00
|
|
|
bool isLine1Point = (line1_x1 == line1_x2 && line1_y1 == line1_y2);
|
|
|
|
bool isLine2Point = (line2_x1 == line2_x2 && line2_y1 == line2_y2);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-16 14:22:14 +00:00
|
|
|
if (isLine1Point) {
|
|
|
|
if (isLine2Point) {
|
|
|
|
if (line1_x1 == line2_x1 && line1_y1 == line2_y2) {
|
|
|
|
ix = line1_x1;
|
|
|
|
iy = line2_x1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// 1 point and 1 line
|
|
|
|
int dx2 = line2_x2 - line2_x1;
|
|
|
|
if (dx2 != 0) {
|
|
|
|
int dy2 = line2_y2 - line2_y1;
|
|
|
|
float y = (float)dy2 / dx2 * (line1_x1 - line2_x1) + line2_y1 + .5f;
|
|
|
|
if (line1_y1 == (int)y) {
|
|
|
|
ix = line1_x1;
|
|
|
|
iy = line1_y1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// vertical line
|
|
|
|
if (line1_x1 == line2_x1) {
|
|
|
|
if (line2_y1 > line2_y2) {
|
|
|
|
if (line1_y1 >= line2_y2 && line1_y1 <= line2_y1) {
|
|
|
|
ix = line1_x1;
|
|
|
|
iy = line1_y1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (line1_y1 >= line2_y1 && line1_y1 <= line2_y2) {
|
|
|
|
ix = line1_x1;
|
|
|
|
iy = line1_y1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (isLine2Point) {
|
|
|
|
// 1 point and 1 line
|
|
|
|
int dx1 = line1_x2 - line1_x1;
|
|
|
|
if (dx1 != 0) {
|
|
|
|
int dy1 = line1_y2 - line1_y1;
|
|
|
|
float y = (float)dy1 / dx1 * (line2_x1 - line1_x1) + line1_y1 + .5f;
|
|
|
|
if (line2_y1 == (int)y) {
|
|
|
|
ix = line2_x1;
|
|
|
|
iy = line2_y1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// vertical line
|
|
|
|
if (line2_x1 == line1_x1) {
|
|
|
|
if (line1_y1 > line1_y2) {
|
|
|
|
if (line2_y1 >= line1_y2 && line2_y1 <= line1_y1) {
|
|
|
|
ix = line2_x1;
|
|
|
|
iy = line2_y1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (line2_y1 >= line1_y1 && line2_y1 <= line1_y2) {
|
|
|
|
ix = line2_x2;
|
|
|
|
iy = line2_y1;
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
}
|
2005-04-16 14:22:14 +00:00
|
|
|
} else {
|
|
|
|
// 2 lines
|
|
|
|
int dy1 = line1_y2 - line1_y1;
|
|
|
|
int dx1 = line1_x2 - line1_x1;
|
|
|
|
int dy2 = line2_y2 - line2_y1;
|
|
|
|
int dx2 = line2_x2 - line2_x1;
|
|
|
|
int det = dx1 * dy2 - dx2 * dy1;
|
|
|
|
int cross_p1 = dx1 * (line1_y1 - line2_y1) - dy1 * (line1_x1 - line2_x1);
|
|
|
|
int cross_p2 = dx2 * (line1_y1 - line2_y1) - dy2 * (line1_x1 - line2_x1);
|
|
|
|
if (det == 0) {
|
|
|
|
// parallel lines
|
|
|
|
if (cross_p2 == 0) {
|
|
|
|
ix = ABS(line2_x2 + line2_x1) / 2;
|
|
|
|
iy = ABS(line2_y2 + line2_y1) / 2;
|
|
|
|
result = 2;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
float rcp1 = (float)cross_p1 / det;
|
|
|
|
float rcp2 = (float)cross_p2 / det;
|
|
|
|
if (rcp1 >= 0 && rcp1 <= 1 && rcp2 >= 0 && rcp2 <= 1) {
|
|
|
|
ix = (int)(dx1 * rcp2 + line1_x1 + .5f);
|
|
|
|
iy = (int)(dy1 * rcp2 + line1_y1 + .5f);
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
writeVar(var_ix, ix);
|
|
|
|
writeVar(var_iy, iy);
|
|
|
|
push(result);
|
2005-04-09 06:26:12 +00:00
|
|
|
}
|
|
|
|
|
2005-04-02 17:19:44 +00:00
|
|
|
void ScummEngine_v90he::getArrayDim(int array, int *dim2start, int *dim2end, int *dim1start, int *dim1end) {
|
|
|
|
ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
|
|
|
|
assert(ah);
|
|
|
|
if (dim2start && *dim2start == -1) {
|
2006-03-11 09:43:00 +00:00
|
|
|
*dim2start = FROM_LE_32(ah->dim2start);
|
2005-04-02 17:19:44 +00:00
|
|
|
}
|
|
|
|
if (dim2end && *dim2end == -1) {
|
2006-03-11 09:43:00 +00:00
|
|
|
*dim2end = FROM_LE_32(ah->dim2end);
|
2005-04-02 17:19:44 +00:00
|
|
|
}
|
|
|
|
if (dim1start && *dim1start == -1) {
|
2006-03-11 09:43:00 +00:00
|
|
|
*dim1start = FROM_LE_32(ah->dim1start);
|
2005-04-02 17:19:44 +00:00
|
|
|
}
|
|
|
|
if (dim1end && *dim1end == -1) {
|
2006-03-11 09:43:00 +00:00
|
|
|
*dim1end = FROM_LE_32(ah->dim1end);
|
2005-04-02 17:19:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int compareByteArray(const void *a, const void *b) {
|
2009-10-21 09:59:18 +00:00
|
|
|
int va = *((const uint8 *)a);
|
|
|
|
int vb = *((const uint8 *)a);
|
2005-04-02 17:19:44 +00:00
|
|
|
return va - vb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int compareByteArrayReverse(const void *a, const void *b) {
|
2009-10-21 09:59:18 +00:00
|
|
|
int va = *((const uint8 *)a);
|
|
|
|
int vb = *((const uint8 *)a);
|
2005-04-02 17:19:44 +00:00
|
|
|
return vb - va;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int compareIntArray(const void *a, const void *b) {
|
2009-10-21 09:59:18 +00:00
|
|
|
int va = (int16)READ_LE_UINT16((const uint8 *)a);
|
|
|
|
int vb = (int16)READ_LE_UINT16((const uint8 *)b);
|
2005-04-02 17:19:44 +00:00
|
|
|
return va - vb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int compareIntArrayReverse(const void *a, const void *b) {
|
2009-10-21 09:59:18 +00:00
|
|
|
int va = (int16)READ_LE_UINT16((const uint8 *)a);
|
|
|
|
int vb = (int16)READ_LE_UINT16((const uint8 *)b);
|
2005-04-02 17:19:44 +00:00
|
|
|
return vb - va;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int compareDwordArray(const void *a, const void *b) {
|
2009-10-21 09:59:18 +00:00
|
|
|
int va = (int32)READ_LE_UINT32((const uint8 *)a);
|
|
|
|
int vb = (int32)READ_LE_UINT32((const uint8 *)b);
|
2005-04-02 17:19:44 +00:00
|
|
|
return va - vb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int compareDwordArrayReverse(const void *a, const void *b) {
|
2009-10-21 09:59:18 +00:00
|
|
|
int va = (int32)READ_LE_UINT32((const uint8 *)a);
|
|
|
|
int vb = (int32)READ_LE_UINT32((const uint8 *)b);
|
2005-04-02 17:19:44 +00:00
|
|
|
return vb - va;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::sortArray(int array, int dim2start, int dim2end, int dim1start, int dim1end, int sortOrder) {
|
2006-02-11 09:33:29 +00:00
|
|
|
debug(9, "sortArray(%d, [%d,%d,%d,%d], %d)", array, dim2start, dim2end, dim1start, dim1end, sortOrder);
|
2005-04-02 17:19:44 +00:00
|
|
|
|
|
|
|
assert(dim1start == dim1end);
|
|
|
|
checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end);
|
|
|
|
ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
|
|
|
|
assert(ah);
|
|
|
|
|
|
|
|
const int num = dim2end - dim2start + 1;
|
|
|
|
const int pitch = FROM_LE_32(ah->dim1end) - FROM_LE_32(ah->dim1start) + 1;
|
2009-10-21 09:59:18 +00:00
|
|
|
const int offset = pitch * (dim2start - FROM_LE_32(ah->dim2start))
|
|
|
|
+ dim1start - FROM_LE_32(ah->dim1start);
|
2005-04-02 17:19:44 +00:00
|
|
|
|
|
|
|
switch (FROM_LE_32(ah->type)) {
|
|
|
|
case kByteArray:
|
|
|
|
case kStringArray:
|
|
|
|
if (sortOrder <= 0) {
|
|
|
|
qsort(ah->data + offset, num, pitch, compareByteArray);
|
|
|
|
} else {
|
|
|
|
qsort(ah->data + offset, num, pitch, compareByteArrayReverse);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case kIntArray:
|
|
|
|
if (sortOrder <= 0) {
|
|
|
|
qsort(ah->data + offset * 2, num, pitch * 2, compareIntArray);
|
|
|
|
} else {
|
|
|
|
qsort(ah->data + offset * 2, num, pitch * 2, compareIntArrayReverse);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case kDwordArray:
|
|
|
|
if (sortOrder <= 0) {
|
|
|
|
qsort(ah->data + offset * 4, num, pitch * 4, compareDwordArray);
|
|
|
|
} else {
|
|
|
|
qsort(ah->data + offset * 4, num, pitch * 4, compareDwordArrayReverse);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2006-03-08 11:37:25 +00:00
|
|
|
error("Invalid array type %d", FROM_LE_32(ah->type));
|
2005-04-02 17:19:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-04 02:23:02 +00:00
|
|
|
void ScummEngine_v90he::o90_sortArray() {
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-13 05:25:35 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2004-09-18 21:44:00 +00:00
|
|
|
case 129:
|
2005-02-01 04:58:14 +00:00
|
|
|
case 134: // HE100
|
2005-07-30 21:11:48 +00:00
|
|
|
{
|
2005-04-02 17:19:44 +00:00
|
|
|
int array = fetchScriptWord();
|
|
|
|
int sortOrder = pop();
|
|
|
|
int dim1end = pop();
|
|
|
|
int dim1start = pop();
|
|
|
|
int dim2end = pop();
|
|
|
|
int dim2start = pop();
|
|
|
|
getArrayDim(array, &dim2start, &dim2end, &dim1start, &dim1end);
|
2006-04-01 12:26:50 +00:00
|
|
|
checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end);
|
2005-04-02 17:19:44 +00:00
|
|
|
sortArray(array, dim2start, dim2end, dim1start, dim1end, sortOrder);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-10-04 02:23:02 +00:00
|
|
|
error("o90_sortArray: Unknown case %d", subOp);
|
2004-09-13 05:25:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-04 02:23:02 +00:00
|
|
|
void ScummEngine_v90he::o90_getObjectData() {
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-10-02 01:40:34 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 32:
|
2004-10-02 01:40:34 +00:00
|
|
|
if (_heObjectNum == -1)
|
|
|
|
push(0);
|
|
|
|
else
|
2005-04-04 14:57:28 +00:00
|
|
|
push(_objs[_heObjectNum].width);
|
2004-10-02 01:40:34 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 33:
|
2004-10-02 01:40:34 +00:00
|
|
|
if (_heObjectNum == -1)
|
|
|
|
push(0);
|
|
|
|
else
|
2005-04-04 14:57:28 +00:00
|
|
|
push(_objs[_heObjectNum].height);
|
2004-10-02 01:40:34 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 36:
|
2006-03-30 00:32:29 +00:00
|
|
|
if (_heObjectNum == -1)
|
|
|
|
push(0);
|
|
|
|
else
|
|
|
|
push(getObjectImageCount(_heObject));
|
2004-10-02 01:40:34 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 38:
|
2004-10-02 01:40:34 +00:00
|
|
|
if (_heObjectNum == -1)
|
|
|
|
push(0);
|
|
|
|
else
|
2005-04-04 14:57:28 +00:00
|
|
|
push(_objs[_heObjectNum].x_pos);
|
2004-10-02 01:40:34 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 39:
|
2004-10-02 01:40:34 +00:00
|
|
|
if (_heObjectNum == -1)
|
|
|
|
push(0);
|
|
|
|
else
|
2005-04-04 14:57:28 +00:00
|
|
|
push(_objs[_heObjectNum].y_pos);
|
2004-10-02 01:40:34 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 52:
|
2004-10-02 01:40:34 +00:00
|
|
|
push(getState(_heObject));
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 57:
|
2004-10-02 01:40:34 +00:00
|
|
|
_heObject = pop();
|
|
|
|
_heObjectNum = getObjectIndex(_heObject);
|
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 139:
|
2004-10-02 01:40:34 +00:00
|
|
|
// Dummy case
|
|
|
|
pop();
|
|
|
|
push(0);
|
|
|
|
break;
|
|
|
|
default:
|
2004-10-04 02:23:02 +00:00
|
|
|
error("o90_getObjectData: Unknown case %d", subOp);
|
2004-10-02 01:40:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-04 02:23:02 +00:00
|
|
|
void ScummEngine_v90he::o90_getPaletteData() {
|
2009-06-04 01:05:47 +00:00
|
|
|
int c, d, e;
|
|
|
|
int r, g, b;
|
2005-04-06 23:56:50 +00:00
|
|
|
int palSlot, color;
|
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-18 04:12:14 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 45:
|
2005-04-21 15:40:40 +00:00
|
|
|
e = pop();
|
|
|
|
d = pop();
|
|
|
|
palSlot = pop();
|
|
|
|
b = pop();
|
2009-06-04 01:05:47 +00:00
|
|
|
g = pop();
|
|
|
|
r = pop();
|
|
|
|
push(getHEPaletteSimilarColor(palSlot, r, g, d, e));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 52:
|
2005-04-21 16:02:37 +00:00
|
|
|
c = pop();
|
|
|
|
b = pop();
|
|
|
|
palSlot = pop();
|
2005-04-21 19:27:17 +00:00
|
|
|
push(getHEPaletteColorComponent(palSlot, b, c));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 66:
|
2005-04-06 23:56:50 +00:00
|
|
|
color = pop();
|
|
|
|
palSlot = pop();
|
|
|
|
push(getHEPaletteColor(palSlot, color));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 132:
|
2005-04-21 16:02:37 +00:00
|
|
|
c = pop();
|
|
|
|
b = pop();
|
2009-06-04 01:05:47 +00:00
|
|
|
if (_game.features & GF_16BIT_COLOR)
|
|
|
|
push(getHEPalette16BitColorComponent(b, c));
|
|
|
|
else
|
|
|
|
push(getHEPaletteColorComponent(1, b, c));
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 217:
|
2005-04-21 15:40:40 +00:00
|
|
|
b = pop();
|
|
|
|
b = MAX(0, b);
|
|
|
|
b = MIN(b, 255);
|
2009-06-04 01:05:47 +00:00
|
|
|
g = pop();
|
|
|
|
g = MAX(0, g);
|
|
|
|
g = MIN(g, 255);
|
|
|
|
r = pop();
|
|
|
|
r = MAX(0, r);
|
|
|
|
r = MIN(r, 255);
|
|
|
|
|
|
|
|
if (_game.features & GF_16BIT_COLOR) {
|
2009-06-04 11:03:45 +00:00
|
|
|
push(get16BitColor(r, g, b));
|
2009-06-04 01:05:47 +00:00
|
|
|
} else {
|
|
|
|
push(getHEPaletteSimilarColor(1, r, g, 10, 245));
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-10-04 02:23:02 +00:00
|
|
|
error("o90_getPaletteData: Unknown case %d", subOp);
|
2004-09-18 04:12:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-04 02:23:02 +00:00
|
|
|
void ScummEngine_v90he::o90_paletteOps() {
|
2005-03-02 23:57:20 +00:00
|
|
|
int a, b, c, d, e;
|
2004-10-04 04:04:37 +00:00
|
|
|
|
|
|
|
byte subOp = fetchScriptByte();
|
2004-09-12 10:23:20 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2008-09-05 13:35:27 +00:00
|
|
|
case 57:
|
2004-10-04 04:04:37 +00:00
|
|
|
_hePaletteNum = pop();
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 63:
|
2005-03-02 23:57:20 +00:00
|
|
|
b = pop();
|
|
|
|
a = pop();
|
|
|
|
if (_hePaletteNum != 0) {
|
|
|
|
setHEPaletteFromImage(_hePaletteNum, a, b);
|
2004-10-04 04:04:37 +00:00
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 66:
|
2005-03-02 23:57:20 +00:00
|
|
|
e = pop();
|
|
|
|
d = pop();
|
|
|
|
c = pop();
|
|
|
|
b = pop();
|
|
|
|
a = pop();
|
|
|
|
if (_hePaletteNum != 0) {
|
|
|
|
for (; a <= b; ++a) {
|
|
|
|
setHEPaletteColor(_hePaletteNum, a, c, d, e);
|
|
|
|
}
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 70:
|
2005-03-02 23:57:20 +00:00
|
|
|
c = pop();
|
|
|
|
b = pop();
|
|
|
|
a = pop();
|
2005-04-09 08:55:26 +00:00
|
|
|
if (_hePaletteNum != 0) {
|
2005-03-02 23:57:20 +00:00
|
|
|
for (; a <= b; ++a) {
|
|
|
|
copyHEPaletteColor(_hePaletteNum, a, c);
|
|
|
|
}
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 76: //HE99+
|
2005-03-02 23:57:20 +00:00
|
|
|
a = pop();
|
|
|
|
if (_hePaletteNum != 0) {
|
|
|
|
setHEPaletteFromCostume(_hePaletteNum, a);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 86:
|
2005-03-02 23:57:20 +00:00
|
|
|
a = pop();
|
|
|
|
if (_hePaletteNum != 0) {
|
|
|
|
copyHEPalette(_hePaletteNum, a);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 175:
|
2005-03-02 23:57:20 +00:00
|
|
|
b = pop();
|
|
|
|
a = pop();
|
|
|
|
if (_hePaletteNum != 0) {
|
|
|
|
setHEPaletteFromRoom(_hePaletteNum, a, b);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 217:
|
2005-03-02 23:57:20 +00:00
|
|
|
if (_hePaletteNum != 0) {
|
|
|
|
restoreHEPalette(_hePaletteNum);
|
|
|
|
}
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
2008-09-05 13:35:27 +00:00
|
|
|
case 255:
|
2004-10-04 04:04:37 +00:00
|
|
|
_hePaletteNum = 0;
|
2004-09-18 21:44:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
2004-10-04 02:23:02 +00:00
|
|
|
error("o90_paletteOps: Unknown case %d", subOp);
|
2004-09-12 10:23:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-10 05:42:48 +00:00
|
|
|
void ScummEngine_v90he::o90_fontUnk() {
|
2004-10-24 13:43:36 +00:00
|
|
|
// Font related
|
2004-10-09 23:45:04 +00:00
|
|
|
byte string[80];
|
|
|
|
int a;
|
|
|
|
|
2004-10-10 00:24:15 +00:00
|
|
|
byte subOp = fetchScriptByte();
|
2004-10-01 23:56:39 +00:00
|
|
|
|
|
|
|
switch (subOp) {
|
2005-06-14 03:06:56 +00:00
|
|
|
case 60: // HE100
|
2004-10-01 23:56:39 +00:00
|
|
|
case 42:
|
2004-10-09 23:45:04 +00:00
|
|
|
a = pop();
|
2004-10-24 13:43:36 +00:00
|
|
|
if (a == 2) {
|
2005-04-13 10:34:47 +00:00
|
|
|
copyScriptString(string, sizeof(string));
|
2004-10-24 13:43:36 +00:00
|
|
|
push(-1);
|
|
|
|
} else if (a == 1) {
|
2004-10-01 23:56:39 +00:00
|
|
|
pop();
|
2004-10-24 13:43:36 +00:00
|
|
|
writeVar(0, 0);
|
|
|
|
defineArray(0, kStringArray, 0, 0, 0, 0);
|
|
|
|
writeArray(0, 0, 0, 0);
|
|
|
|
push(readVar(0));
|
|
|
|
}
|
2004-10-01 23:56:39 +00:00
|
|
|
break;
|
2005-06-14 03:06:56 +00:00
|
|
|
case 0: // HE100
|
2004-10-01 23:56:39 +00:00
|
|
|
case 57:
|
2004-10-24 13:43:36 +00:00
|
|
|
push(1);
|
2004-10-01 23:56:39 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-05-10 05:42:48 +00:00
|
|
|
error("o90_fontUnk: Unknown case %d", subOp);
|
2004-10-01 23:56:39 +00:00
|
|
|
}
|
|
|
|
|
2005-08-31 20:54:51 +00:00
|
|
|
debug(1, "o90_fontUnk stub (%d)", subOp);
|
2004-10-01 23:56:39 +00:00
|
|
|
}
|
|
|
|
|
2004-09-21 05:59:26 +00:00
|
|
|
void ScummEngine_v90he::o90_getActorAnimProgress() {
|
|
|
|
Actor *a = derefActor(pop(), "o90_getActorAnimProgress");
|
|
|
|
push(a->getAnimProgress());
|
|
|
|
}
|
|
|
|
|
2005-03-23 00:16:51 +00:00
|
|
|
void ScummEngine_v90he::o90_kernelGetFunctions() {
|
|
|
|
int args[29];
|
2005-05-01 11:09:30 +00:00
|
|
|
int num, tmp;
|
|
|
|
Actor *a;
|
2005-03-23 00:16:51 +00:00
|
|
|
|
|
|
|
num = getStackList(args, ARRAYSIZE(args));
|
|
|
|
|
|
|
|
switch (args[0]) {
|
|
|
|
case 1001:
|
|
|
|
{
|
2005-05-01 11:09:30 +00:00
|
|
|
double b = args[1] * PI / 180.;
|
|
|
|
push((int)(sin(b) * 100000));
|
2005-03-23 00:16:51 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1002:
|
|
|
|
{
|
2005-05-01 11:09:30 +00:00
|
|
|
double b = args[1] * PI / 180.;
|
|
|
|
push((int)(cos(b) * 100000));
|
2005-03-23 00:16:51 +00:00
|
|
|
}
|
|
|
|
break;
|
2005-05-01 11:09:30 +00:00
|
|
|
case 1969:
|
|
|
|
a = derefActor(args[1], "o90_kernelGetFunctions: 1969");
|
|
|
|
tmp = a->_heCondMask;
|
|
|
|
tmp &= 0x7FFF0000;
|
|
|
|
push(tmp);
|
|
|
|
break;
|
2005-03-23 00:16:51 +00:00
|
|
|
case 2001:
|
2005-05-09 17:24:25 +00:00
|
|
|
push(_logicHE->dispatch(args[1], num - 2, (int32 *)&args[2]));
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_kernelGetFunctions: default case %d", args[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v90he::o90_kernelSetFunctions() {
|
|
|
|
int args[29];
|
2005-05-01 11:09:30 +00:00
|
|
|
int num, tmp;
|
2008-09-25 10:11:06 +00:00
|
|
|
ActorHE *a;
|
2005-03-23 00:16:51 +00:00
|
|
|
|
|
|
|
num = getStackList(args, ARRAYSIZE(args));
|
|
|
|
|
|
|
|
switch (args[0]) {
|
|
|
|
case 20:
|
2008-09-25 10:11:06 +00:00
|
|
|
a = (ActorHE *)derefActor(args[1], "o90_kernelSetFunctions: 20");
|
2005-03-23 00:16:51 +00:00
|
|
|
queueAuxBlock(a);
|
|
|
|
break;
|
|
|
|
case 21:
|
|
|
|
_skipDrawObject = 1;
|
|
|
|
break;
|
|
|
|
case 22:
|
|
|
|
_skipDrawObject = 0;
|
|
|
|
break;
|
|
|
|
case 23:
|
2007-01-28 20:11:31 +00:00
|
|
|
clearCharsetMask();
|
2005-08-06 14:34:40 +00:00
|
|
|
_fullRedraw = true;
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
_skipProcessActors = 1;
|
2005-04-02 14:24:43 +00:00
|
|
|
redrawAllActors();
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
case 25:
|
|
|
|
_skipProcessActors = 0;
|
2005-04-02 14:24:43 +00:00
|
|
|
redrawAllActors();
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
2005-05-01 03:17:45 +00:00
|
|
|
case 27:
|
|
|
|
// Used in readdemo
|
|
|
|
break;
|
2005-03-23 00:16:51 +00:00
|
|
|
case 42:
|
2005-05-23 02:00:49 +00:00
|
|
|
_wiz->_rectOverrideEnabled = true;
|
|
|
|
_wiz->_rectOverride.left = args[1];
|
|
|
|
_wiz->_rectOverride.top = args[2];
|
2005-11-06 11:29:08 +00:00
|
|
|
_wiz->_rectOverride.right = args[3];
|
|
|
|
_wiz->_rectOverride.bottom = args[4];
|
2006-06-16 13:14:55 +00:00
|
|
|
adjustRect(_wiz->_rectOverride);
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
case 43:
|
2005-05-23 02:00:49 +00:00
|
|
|
_wiz->_rectOverrideEnabled = false;
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
case 714:
|
2006-01-16 09:20:27 +00:00
|
|
|
debug(5, "o90_kernelSetFunctions: case 714: type %d resId %d unk1 %d", args[1], args[2], args[3]);
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
case 1492:
|
2005-10-30 04:02:45 +00:00
|
|
|
// Remote start script function
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
2005-05-01 11:09:30 +00:00
|
|
|
case 1969:
|
2008-09-25 10:11:06 +00:00
|
|
|
a = (ActorHE *)derefActor(args[1], "o90_kernelSetFunctions: 1969");
|
2005-05-01 11:09:30 +00:00
|
|
|
tmp = a->_heCondMask;
|
|
|
|
tmp ^= args[2];
|
|
|
|
tmp &= 0x7FFF0000;
|
|
|
|
a->_heCondMask ^= tmp;
|
|
|
|
break;
|
2005-03-23 00:16:51 +00:00
|
|
|
case 2001:
|
2005-05-09 17:24:25 +00:00
|
|
|
_logicHE->dispatch(args[1], num - 2, (int32 *)&args[2]);
|
2005-03-23 00:16:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("o90_kernelSetFunctions: default case %d (param count %d)", args[0], num);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
} // End of namespace Scumm
|
2009-08-12 00:53:35 +00:00
|
|
|
|
|
|
|
#endif // ENABLE_HE
|