[Scummvm-cvs-logs] SF.net SVN: scummvm: [31584] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Apr 20 02:11:43 CEST 2008
Revision: 31584
http://scummvm.svn.sourceforge.net/scummvm/?rev=31584&view=rev
Author: lordhoto
Date: 2008-04-19 17:11:42 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
Implemented opcodes:
- 21: o3_showBadConscience
- 23: o3_hideBadConscience
Modified Paths:
--------------
scummvm/trunk/engines/kyra/animator_v3.cpp
scummvm/trunk/engines/kyra/kyra_v3.cpp
scummvm/trunk/engines/kyra/kyra_v3.h
scummvm/trunk/engines/kyra/module.mk
scummvm/trunk/engines/kyra/script_v3.cpp
scummvm/trunk/engines/kyra/staticres.cpp
Modified: scummvm/trunk/engines/kyra/animator_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_v3.cpp 2008-04-19 22:26:22 UTC (rev 31583)
+++ scummvm/trunk/engines/kyra/animator_v3.cpp 2008-04-20 00:11:42 UTC (rev 31584)
@@ -378,6 +378,88 @@
}
}
+void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, int x2, int y2, int w,
+ int h, int unk10, int specialSize, int unk14, int shape, const char *filename) {
+ restorePage3();
+ SceneAnim &anim = _sceneAnims[animId];
+ anim.flags = flags;
+ anim.x = x;
+ anim.y = y;
+ anim.x2 = x2;
+ anim.y2 = y2;
+ anim.width = w;
+ anim.height = h;
+ anim.unk10 = unk10;
+ anim.specialSize = specialSize;
+ anim.unk14 = unk14;
+ anim.shapeIndex = shape;
+ if (filename)
+ strcpy(anim.filename, filename);
+
+ if (flags & 8) {
+ _sceneAnimMovie[animId]->open(filename, 1, 0);
+ musicUpdate(0);
+ if (_sceneAnimMovie[animId]->opened()) {
+ anim.wsaFlag = 1;
+ if (x2 == -1)
+ x2 = _sceneAnimMovie[animId]->xAdd();
+ if (y2 == -1)
+ y2 = _sceneAnimMovie[animId]->yAdd();
+ if (w == -1)
+ w = _sceneAnimMovie[animId]->width();
+ if (h == -1)
+ h = _sceneAnimMovie[animId]->height();
+ if (x == -1)
+ x = (w >> 1) + x2;
+ if (y == -1)
+ y = y2 + h - 1;
+
+ anim.x = x;
+ anim.y = y;
+ anim.x2 = x2;
+ anim.y2 = y2;
+ anim.width = w;
+ anim.height = h;
+ }
+ }
+
+ AnimObj *obj = &_animObjects[1+animId];
+ obj->enabled = true;
+ obj->needRefresh = true;
+
+ obj->unk8 = (anim.flags & 0x20) ? 1 : 0;
+ obj->flags = (anim.flags & 0x10) ? 0x800 : 0;
+ if (anim.flags & 2)
+ obj->flags |= 1;
+
+ obj->xPos1 = anim.x;
+ obj->yPos1 = anim.y;
+
+ if ((anim.flags & 4) && anim.shapeIndex != 0xFFFF)
+ obj->shapePtr = _sceneShapes[anim.shapeIndex];
+ else
+ obj->shapePtr = 0;
+
+ if (anim.flags & 8) {
+ obj->shapeIndex3 = anim.shapeIndex;
+ obj->animNum = animId;
+ } else {
+ obj->shapeIndex3 = 0xFFFF;
+ obj->animNum = 0xFFFF;
+ }
+
+ obj->xPos3 = obj->xPos2 = anim.x2;
+ obj->yPos3 = obj->yPos2 = anim.y2;
+ obj->width = anim.width;
+ obj->height = anim.height;
+ obj->width2 = obj->height2 = anim.specialSize;
+
+ if (_animList)
+ _animList = addToAnimListSorted(_animList, obj);
+ else
+ _animList = initAnimList(_animList, obj);
+}
+
void KyraEngine_v3::removeSceneAnimObject(int anim, int refresh) {
debugC(9, kDebugLevelAnimator, "KyraEngine_v3::removeSceneAnimObject(%d, %d)", anim, refresh);
AnimObj *obj = &_animObjects[anim+1];
Modified: scummvm/trunk/engines/kyra/kyra_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-19 22:26:22 UTC (rev 31583)
+++ scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-20 00:11:42 UTC (rev 31584)
@@ -106,6 +106,8 @@
_charBackUpWidth = _charBackUpHeight = -1;
_useActorBuffer = false;
_curStudioSFX = 283;
+ _badConscienceShown = false;
+ _curChapter = 1;
}
KyraEngine_v3::~KyraEngine_v3() {
Modified: scummvm/trunk/engines/kyra/kyra_v3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.h 2008-04-19 22:26:22 UTC (rev 31583)
+++ scummvm/trunk/engines/kyra/kyra_v3.h 2008-04-20 00:11:42 UTC (rev 31584)
@@ -216,6 +216,7 @@
void updateCharacterAnim(int charId);
void updateSceneAnim(int anim, int newFrame);
+ void setupSceneAnimObject(int anim, uint16 flags, int x, int y, int x2, int y2, int w, int h, int unk10, int specialSize, int unk14, int shape, const char *filename);
void removeSceneAnimObject(int anim, int refresh);
int _charBackUpWidth2, _charBackUpHeight2;
@@ -459,6 +460,16 @@
void objectChatProcess(const char *script);
void objectChatWaitToFinish();
+ // conscience
+ bool _badConscienceShown;
+ int _badConscienceAnim;
+ bool _badConsciencePosition;
+
+ static const uint8 _badConscienceFrameTable[];
+
+ void showBadConscience();
+ void hideBadConscience();
+
// special script code
bool _temporaryScriptExecBit;
bool _useFrameTable;
@@ -486,6 +497,7 @@
uint8 *_gfxBackUpRect;
uint8 *_paletteOverlay;
bool _useActorBuffer;
+ int _curChapter;
int _unk3, _unk4, _unk5;
@@ -498,6 +510,8 @@
int o3_defineObject(ScriptState *script);
int o3_refreshCharacter(ScriptState *script);
int o3_showSceneFileMessage(ScriptState *script);
+ int o3_showBadConscience(ScriptState *script);
+ int o3_hideBadConscience(ScriptState *script);
int o3_objectChat(ScriptState *script);
int o3_defineItem(ScriptState *script);
int o3_queryGameFlag(ScriptState *script);
Modified: scummvm/trunk/engines/kyra/module.mk
===================================================================
--- scummvm/trunk/engines/kyra/module.mk 2008-04-19 22:26:22 UTC (rev 31583)
+++ scummvm/trunk/engines/kyra/module.mk 2008-04-20 00:11:42 UTC (rev 31584)
@@ -36,6 +36,7 @@
seqplayer.o \
sequences_v1.o \
sequences_v2.o \
+ sequences_v3.o \
sound_adlib.o \
sound_digital.o \
sound_towns.o \
Modified: scummvm/trunk/engines/kyra/script_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v3.cpp 2008-04-19 22:26:22 UTC (rev 31583)
+++ scummvm/trunk/engines/kyra/script_v3.cpp 2008-04-20 00:11:42 UTC (rev 31584)
@@ -89,6 +89,18 @@
return 0;
}
+int KyraEngine_v3::o3_showBadConscience(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showBadConscience(%p) ()", (const void *)script);
+ showBadConscience();
+ return 0;
+}
+
+int KyraEngine_v3::o3_hideBadConscience(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_hideBadConscience(%p) ()", (const void *)script);
+ hideBadConscience();
+ return 0;
+}
+
int KyraEngine_v3::o3_objectChat(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_objectChat(%p) (%d)", (const void *)script, stackPos(0));
int id = stackPos(0);
@@ -425,9 +437,9 @@
Opcode(o3_dummy),
// 0x14
OpcodeUnImpl(),
- OpcodeUnImpl(),
+ Opcode(o3_showBadConscience),
Opcode(o3_dummy),
- OpcodeUnImpl(),
+ Opcode(o3_hideBadConscience),
// 0x18
OpcodeUnImpl(),
OpcodeUnImpl(),
Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp 2008-04-19 22:26:22 UTC (rev 31583)
+++ scummvm/trunk/engines/kyra/staticres.cpp 2008-04-20 00:11:42 UTC (rev 31584)
@@ -2310,6 +2310,14 @@
const int KyraEngine_v3::_sfxFileListSize = ARRAYSIZE(KyraEngine_v3::_sfxFileList);
+const uint8 KyraEngine_v3::_badConscienceFrameTable[] = {
+ 0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
+ 0x13, 0x13, 0x13, 0x10, 0x13, 0x13, 0x13, 0x13,
+ 0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
+ 0x15, 0x15, 0x14, 0x18, 0x14, 0x14, 0x14, 0x14,
+ 0x24, 0x24, 0x24, 0x24, 0x24, 0x1D, 0x1D, 0x1D
+};
+
} // End of namespace Kyra
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list