[Scummvm-cvs-logs] SF.net SVN: scummvm: [31136] scummvm/trunk/engines/kyra
athrxx at users.sourceforge.net
athrxx at users.sourceforge.net
Sun Mar 16 03:00:14 CET 2008
Revision: 31136
http://scummvm.svn.sourceforge.net/scummvm/?rev=31136&view=rev
Author: athrxx
Date: 2008-03-15 19:00:14 -0700 (Sat, 15 Mar 2008)
Log Message:
-----------
- add opcode 146 - resetInputColorCode()
- add updateWaterFlasks()
- some fixes for mouse pointer positioning in sjis mode
- bug fix for tim player
Modified Paths:
--------------
scummvm/trunk/engines/kyra/items_v2.cpp
scummvm/trunk/engines/kyra/kyra.cpp
scummvm/trunk/engines/kyra/kyra.h
scummvm/trunk/engines/kyra/kyra_v2.cpp
scummvm/trunk/engines/kyra/kyra_v2.h
scummvm/trunk/engines/kyra/scene_v2.cpp
scummvm/trunk/engines/kyra/script_v2.cpp
scummvm/trunk/engines/kyra/sequences_tim.cpp
Modified: scummvm/trunk/engines/kyra/items_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/items_v2.cpp 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/items_v2.cpp 2008-03-16 02:00:14 UTC (rev 31136)
@@ -92,6 +92,28 @@
}
}
+void KyraEngine_v2::updateWaterFlasks() {
+ for (int i = 22; i < 24; i++) {
+ if (_itemInHand == i)
+ setHandItem(i - 1);
+
+ for (int ii = 0; ii < 20; ii++) {
+ if (_mainCharacter.inventory[ii] == i) {
+ _mainCharacter.inventory[ii]--;
+ if (ii < 10) {
+ clearInventorySlot(ii, 0);
+ _screen->drawShape(0, getShapePtr(i + 63), _inventoryX[ii], _inventoryY[ii], 0, 0);
+ }
+ }
+ }
+
+ for (int ii = 0; ii < 30; ii++) {
+ if (_itemList[ii].id == i)
+ _itemList[ii].id--;
+ }
+ }
+}
+
bool KyraEngine_v2::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
if (_handItemSet <= -1)
return false;
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/kyra.cpp 2008-03-16 02:00:14 UTC (rev 31136)
@@ -202,6 +202,14 @@
return mouse;
}
+void KyraEngine::setMousePos(int x, int y) {
+ if (_flags.useHiResOverlay) {
+ x <<= 1;
+ y <<= 1;
+ }
+ _system->warpMouse(x, y);
+}
+
int KyraEngine::setGameFlag(int flag) {
_flagsTable[flag >> 3] |= (1 << (flag & 7));
return 1;
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/kyra.h 2008-03-16 02:00:14 UTC (rev 31136)
@@ -193,6 +193,7 @@
// input
Common::Point getMousePos() const;
+ void setMousePos(int x, int y);
// pathfinder
virtual int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp 2008-03-16 02:00:14 UTC (rev 31136)
@@ -1867,7 +1867,7 @@
else if (mouseY > mouseDstY)
mouseY -= 2;
uint32 waitEnd = _system->getMillis() + _tickLength;
- _system->warpMouse(mouseX, mouseY);
+ setMousePos(mouseX, mouseY);
_system->updateScreen();
delayUntil(waitEnd);
}
@@ -1878,7 +1878,7 @@
else if (mouseX > mouseDstX)
mouseX -= 2;
uint32 waitEnd = _system->getMillis() + _tickLength;
- _system->warpMouse(mouseX, mouseY);
+ setMousePos(mouseX, mouseY);
_system->updateScreen();
delayUntil(waitEnd);
}
@@ -2264,7 +2264,7 @@
// 0x90
Opcode(o2_clearSpecialSceneScriptState),
Opcode(o2_querySpecialSceneScriptState),
- OpcodeUnImpl(),
+ Opcode(o2_resetInputColorCode),
Opcode(o2_setHiddenItemsEntry),
// 0x94
Opcode(o2_getHiddenItemsEntry),
Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/kyra_v2.h 2008-03-16 02:00:14 UTC (rev 31136)
@@ -542,6 +542,7 @@
int findItem(uint16 sceneId, uint16 id);
int checkItemCollision(int x, int y);
void resetItemList();
+ void updateWaterFlasks();
int _itemInHand;
int _handItemSet;
@@ -1024,6 +1025,7 @@
int o2_setSpecialSceneScriptState(ScriptState *script);
int o2_clearSpecialSceneScriptState(ScriptState *script);
int o2_querySpecialSceneScriptState(ScriptState *script);
+ int o2_resetInputColorCode(ScriptState *script);
int o2_setHiddenItemsEntry(ScriptState *script);
int o2_getHiddenItemsEntry(ScriptState *script);
int o2_mushroomEffect(ScriptState *script);
Modified: scummvm/trunk/engines/kyra/scene_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_v2.cpp 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/scene_v2.cpp 2008-03-16 02:00:14 UTC (rev 31136)
@@ -47,7 +47,7 @@
_screen->hideMouse();
if (!unk3) {
- //updateSpecialItems();
+ updateWaterFlasks();
//displayInvWsaLastFrame();
}
Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/script_v2.cpp 2008-03-16 02:00:14 UTC (rev 31136)
@@ -410,7 +410,7 @@
int KyraEngine_v2::o2_setMousePos(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _system->warpMouse(stackPos(0), stackPos(1));
+ setMousePos(stackPos(0), stackPos(1));
return 0;
}
@@ -661,7 +661,7 @@
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
_screen->fadePalette(_screen->getPalette(0), 0x14);
_screen->setMouseCursor(0, 0, getShapePtr(0));
- _system->warpMouse(280, 160);
+ setMousePos(280, 160);
_screen->showMouse();
@@ -786,7 +786,7 @@
}
int KyraEngine_v2::o2_setSceneAnimPosAndUpdate(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "o2_updateSceneAnim(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "o2_setSceneAnimPosAndUpdate(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
const int anim = stackPos(0);
_sceneAnims[anim].x2 = stackPos(1);
_sceneAnims[anim].y2 = stackPos(2);
@@ -1039,6 +1039,12 @@
return _specialSceneScriptState[stackPos(0)];
}
+int KyraEngine_v2::o2_resetInputColorCode(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "o2_resetInputColorCode(%p)", (const void *)script);
+ memset(_inputColorCode, 255, 7);
+ return 0;
+}
+
int KyraEngine_v2::o2_setHiddenItemsEntry(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "o2_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
return (_hiddenItems[stackPos(0)] = stackPos(1));
Modified: scummvm/trunk/engines/kyra/sequences_tim.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_tim.cpp 2008-03-15 21:33:01 UTC (rev 31135)
+++ scummvm/trunk/engines/kyra/sequences_tim.cpp 2008-03-16 02:00:14 UTC (rev 31136)
@@ -258,7 +258,7 @@
}
int KyraEngine_v2::tim_o_printTalkText(uint8 *ptr) {
- _chatText = _timChatText = (const char*) _TIMBuffers.TEXTChunk + (READ_LE_UINT16(ptr) << 1);
+ _chatText = _timChatText = (const char*) _TIMBuffers.TEXTChunk + READ_LE_UINT16(_TIMBuffers.TEXTChunk + (READ_LE_UINT16(ptr) << 1));
_chatObject = _timChatObject = READ_LE_UINT16(ptr + 2);
if (_flags.lang == Common::JA_JPN) {
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