diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/animator_hof.cpp (renamed from engines/kyra/animator_v2.cpp) | 181 | ||||
-rw-r--r-- | engines/kyra/animator_mr.cpp (renamed from engines/kyra/animator_v3.cpp) | 201 | ||||
-rw-r--r-- | engines/kyra/debugger.cpp | 19 | ||||
-rw-r--r-- | engines/kyra/debugger.h | 12 | ||||
-rw-r--r-- | engines/kyra/detection.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/gui_v2.cpp | 63 | ||||
-rw-r--r-- | engines/kyra/gui_v2.h | 8 | ||||
-rw-r--r-- | engines/kyra/gui_v3.cpp | 85 | ||||
-rw-r--r-- | engines/kyra/gui_v3.h | 12 | ||||
-rw-r--r-- | engines/kyra/items_hof.cpp (renamed from engines/kyra/items_v2.cpp) | 80 | ||||
-rw-r--r-- | engines/kyra/items_mr.cpp (renamed from engines/kyra/items_v3.cpp) | 98 | ||||
-rw-r--r-- | engines/kyra/kyra_hof.cpp (renamed from engines/kyra/kyra_v2.cpp) | 298 | ||||
-rw-r--r-- | engines/kyra/kyra_mr.cpp (renamed from engines/kyra/kyra_v3.cpp) | 324 | ||||
-rw-r--r-- | engines/kyra/kyra_mr.h (renamed from engines/kyra/kyra_v3.h) | 136 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 1166 | ||||
-rw-r--r-- | engines/kyra/module.mk | 36 | ||||
-rw-r--r-- | engines/kyra/resource.h | 2 | ||||
-rw-r--r-- | engines/kyra/saveload_hof.cpp (renamed from engines/kyra/saveload_v2.cpp) | 16 | ||||
-rw-r--r-- | engines/kyra/saveload_mr.cpp (renamed from engines/kyra/saveload_v3.cpp) | 10 | ||||
-rw-r--r-- | engines/kyra/scene_hof.cpp (renamed from engines/kyra/scene_v2.cpp) | 286 | ||||
-rw-r--r-- | engines/kyra/scene_mr.cpp (renamed from engines/kyra/scene_v3.cpp) | 142 | ||||
-rw-r--r-- | engines/kyra/screen.cpp | 300 | ||||
-rw-r--r-- | engines/kyra/screen.h | 35 | ||||
-rw-r--r-- | engines/kyra/screen_hof.cpp (renamed from engines/kyra/screen_v2.cpp) | 30 | ||||
-rw-r--r-- | engines/kyra/screen_hof.h (renamed from engines/kyra/screen_v2.h) | 21 | ||||
-rw-r--r-- | engines/kyra/screen_mr.cpp (renamed from engines/kyra/screen_v3.cpp) | 36 | ||||
-rw-r--r-- | engines/kyra/screen_mr.h (renamed from engines/kyra/screen_v3.h) | 18 | ||||
-rw-r--r-- | engines/kyra/script_hof.cpp (renamed from engines/kyra/script_v2.cpp) | 691 | ||||
-rw-r--r-- | engines/kyra/script_mr.cpp (renamed from engines/kyra/script_v3.cpp) | 453 | ||||
-rw-r--r-- | engines/kyra/sequences_hof.cpp (renamed from engines/kyra/sequences_v2.cpp) | 171 | ||||
-rw-r--r-- | engines/kyra/sequences_mr.cpp (renamed from engines/kyra/sequences_v3.cpp) | 38 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 182 | ||||
-rw-r--r-- | engines/kyra/text_hof.cpp (renamed from engines/kyra/text_v2.cpp) | 40 | ||||
-rw-r--r-- | engines/kyra/text_hof.h (renamed from engines/kyra/text_v2.h) | 8 | ||||
-rw-r--r-- | engines/kyra/text_mr.cpp (renamed from engines/kyra/text_v3.cpp) | 114 | ||||
-rw-r--r-- | engines/kyra/text_mr.h (renamed from engines/kyra/text_v3.h) | 16 | ||||
-rw-r--r-- | engines/kyra/timer_hof.cpp (renamed from engines/kyra/timer_v2.cpp) | 36 | ||||
-rw-r--r-- | engines/kyra/timer_mr.cpp (renamed from engines/kyra/timer_v3.cpp) | 32 | ||||
-rw-r--r-- | engines/kyra/wsamovie.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/wsamovie.h | 8 |
40 files changed, 1603 insertions, 3812 deletions
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_hof.cpp index 8efbdbe747..4667f11498 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_hof.cpp @@ -23,15 +23,20 @@ * */ -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/wsamovie.h" #include "common/endian.h" namespace Kyra { -void KyraEngine_v2::clearAnimObjects() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::clearAnimObjects()"); +void KyraEngine_HoF::restorePage3() { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::restorePage3()"); + screen()->copyBlockToPage(2, 0, 0, 320, 144, _gamePlayBuffer); +} + +void KyraEngine_HoF::clearAnimObjects() { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::clearAnimObjects()"); memset(_animObjects, 0, sizeof(_animObjects)); _animObjects[0].index = 0; @@ -57,87 +62,8 @@ void KyraEngine_v2::clearAnimObjects() { } } -KyraEngine_v2::AnimObj *KyraEngine_v2::initAnimList(AnimObj *list, AnimObj *entry) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::initAnimList(%p, %p)", (const void*)list, (const void*)entry); - entry->nextObject = list; - return entry; -} - -KyraEngine_v2::AnimObj *KyraEngine_v2::addToAnimListSorted(AnimObj *list, AnimObj *add) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)add); - add->nextObject = 0; - - if (!list) - return add; - - if (add->yPos1 <= list->yPos1) { - add->nextObject = list; - return add; - } - - AnimObj *cur = list; - AnimObj *prev = list; - while (add->yPos1 > cur->yPos1) { - AnimObj *temp = cur->nextObject; - if (!temp) - break; - prev = cur; - cur = temp; - } - - if (add->yPos1 <= cur->yPos1) { - prev->nextObject = add; - add->nextObject = cur; - } else { - cur->nextObject = add; - add->nextObject = 0; - } - return list; -} - -KyraEngine_v2::AnimObj *KyraEngine_v2::deleteAnimListEntry(AnimObj *list, AnimObj *entry) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)entry); - if (!list) - return 0; - - AnimObj *old = 0; - AnimObj *cur = list; - - while (true) { - if (cur == entry) - break; - if (!cur->nextObject) - break; - old = cur; - cur = cur->nextObject; - } - - if (cur != entry) - return list; - - if (cur == list) { - if (!cur->nextObject) - return 0; - cur = cur->nextObject; - return cur; - } - - if (!cur->nextObject) { - if (!old) - return 0; - old->nextObject = 0; - return list; - } - - if (cur != entry) - return list; - - old->nextObject = entry->nextObject; - return list; -} - -void KyraEngine_v2::drawAnimObjects() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::drawAnimObjects()"); +void KyraEngine_HoF::drawAnimObjects() { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::drawAnimObjects()"); for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) { if (!curObject->enabled) continue; @@ -161,8 +87,8 @@ void KyraEngine_v2::drawAnimObjects() { } } -void KyraEngine_v2::refreshAnimObjects(int force) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::refreshAnimObjects(%d)", force); +void KyraEngine_HoF::refreshAnimObjects(int force) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::refreshAnimObjects(%d)", force); for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) { if (!curObject->enabled) continue; @@ -195,21 +121,8 @@ void KyraEngine_v2::refreshAnimObjects(int force) { } } -void KyraEngine_v2::refreshAnimObjectsIfNeed() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::refreshAnimObjectsIfNeed()"); - for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) { - if (curEntry->enabled && curEntry->needRefresh) { - restorePage3(); - drawAnimObjects(); - refreshAnimObjects(0); - _screen->updateScreen(); - return; - } - } -} - -void KyraEngine_v2::updateItemAnimations() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateItemAnimations()"); +void KyraEngine_HoF::updateItemAnimations() { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateItemAnimations()"); bool nextFrame = false; if (_itemAnimData[0].itemIndex == -1 || _inventorySaved) @@ -236,7 +149,7 @@ void KyraEngine_v2::updateItemAnimations() { for (int i = 0; i < 10; i++) { if (s->itemIndex == _mainCharacter.inventory[i]) { nextFrame = true; - _screen->drawShape(2, _defaultShapeTable[240 + i], 304, 184, 0, 0); + _screen->drawShape(2, getShapePtr(240 + i), 304, 184, 0, 0); _screen->drawShape(2, getShapePtr(shpIdx), 304, 184, 0, 0); _screen->copyRegion(304, 184, _inventoryX[i], _inventoryY[i], 16, 16, 2, 0); } @@ -257,7 +170,7 @@ void KyraEngine_v2::updateItemAnimations() { } } } - animObject->shapePtr = _defaultShapeTable[shpIdx]; + animObject->shapePtr = getShapePtr(shpIdx); animObject->shapeIndex1 = shpIdx; animObject->needRefresh = 1; nextFrame = true; @@ -270,20 +183,8 @@ void KyraEngine_v2::updateItemAnimations() { } } -void KyraEngine_v2::flagAnimObjsForRefresh() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::flagAnimObjsForRefresh()"); - for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) - curEntry->needRefresh = 1; -} - -void KyraEngine_v2::flagAnimObjsUnk8() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::flagAnimObjsUnk8()"); - for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) - curEntry->unk8 = 1; -} - -void KyraEngine_v2::updateCharFacing() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateCharFacing()"); +void KyraEngine_HoF::updateCharFacing() { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateCharFacing()"); if (_mainCharacter.x1 > _mouseX) _mainCharacter.facing = 5; else @@ -294,13 +195,13 @@ void KyraEngine_v2::updateCharFacing() { refreshAnimObjectsIfNeed(); } -void KyraEngine_v2::updateCharacterAnim(int) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateCharacterAnim(-)"); +void KyraEngine_HoF::updateCharacterAnim(int) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateCharacterAnim(-)"); Character *c = &_mainCharacter; AnimObj *animState = _animObjects; animState->needRefresh = 1; - animState->unk8 = 1; + animState->specialRefresh = 1; if (c->facing >= 1 && c->facing <= 3) animState->flags |= 1; @@ -309,7 +210,7 @@ void KyraEngine_v2::updateCharacterAnim(int) { animState->xPos2 = animState->xPos1 = c->x1; animState->yPos2 = animState->yPos1 = c->y1; - animState->shapePtr = _defaultShapeTable[c->animFrame]; + animState->shapePtr = getShapePtr(c->animFrame); animState->shapeIndex1 = animState->shapeIndex2 = c->animFrame; int xAdd = _shapeDescTable[c->animFrame-9].xAdd; @@ -331,14 +232,14 @@ void KyraEngine_v2::updateCharacterAnim(int) { updateCharPal(1); } -void KyraEngine_v2::updateSceneAnim(int anim, int newFrame) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::updateSceneAnim(%d, %d)", anim, newFrame); +void KyraEngine_HoF::updateSceneAnim(int anim, int newFrame) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::updateSceneAnim(%d, %d)", anim, newFrame); AnimObj *animObject = &_animObjects[1+anim]; if (!animObject->enabled) return; animObject->needRefresh = 1; - animObject->unk8 = 1; + animObject->specialRefresh = 1; animObject->flags = 0; if (_sceneAnims[anim].flags & 2) @@ -376,8 +277,8 @@ void KyraEngine_v2::updateSceneAnim(int anim, int newFrame) { } } -void KyraEngine_v2::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); +void KyraEngine_HoF::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); if (obj->type == 1) { if (obj->shapeIndex1 == 0xFFFF) return; @@ -410,29 +311,29 @@ void KyraEngine_v2::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) { } } -void KyraEngine_v2::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); +void KyraEngine_HoF::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); if (_drawNoShapeFlag || obj->shapeIndex1 == 0xFFFF) return; _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 4, layer, _charScaleX, _charScaleY); } -void KyraEngine_v2::addItemToAnimList(int item) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::addItemToAnimList(%d)", item); +void KyraEngine_HoF::addItemToAnimList(int item) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::addItemToAnimList(%d)", item); restorePage3(); AnimObj *animObj = &_animObjects[11+item]; animObj->enabled = 1; animObj->needRefresh = 1; - animObj->unk8 = 1; + animObj->specialRefresh = 1; int itemId = _itemList[item].id; animObj->xPos2 = animObj->xPos1 = _itemList[item].x; animObj->yPos2 = animObj->yPos1 = _itemList[item].y; - animObj->shapePtr = _defaultShapeTable[64+itemId]; + animObj->shapePtr = getShapePtr(64+itemId); animObj->shapeIndex2 = animObj->shapeIndex1 = 64+itemId; int scaleY, scaleX; @@ -446,11 +347,11 @@ void KyraEngine_v2::addItemToAnimList(int item) { _animList = addToAnimListSorted(_animList, animObj); animObj->needRefresh = 1; - animObj->unk8 = 1; + animObj->specialRefresh = 1; } -void KyraEngine_v2::deleteItemAnimEntry(int item) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::deleteItemAnimEntry(%d)", item); +void KyraEngine_HoF::deleteItemAnimEntry(int item) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::deleteItemAnimEntry(%d)", item); AnimObj *animObj = &_animObjects[11+item]; restorePage3(); @@ -459,7 +360,7 @@ void KyraEngine_v2::deleteItemAnimEntry(int item) { animObj->shapeIndex1 = 0xFFFF; animObj->shapeIndex2 = 0xFFFF; animObj->needRefresh = 1; - animObj->unk8 = 1; + animObj->specialRefresh = 1; refreshAnimObjectsIfNeed(); @@ -467,8 +368,8 @@ void KyraEngine_v2::deleteItemAnimEntry(int item) { _animList = deleteAnimListEntry(_animList, animObj); } -void KyraEngine_v2::setCharacterAnimDim(int w, int h) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::setCharacterAnimDim(%d, %d)", w, h); +void KyraEngine_HoF::setCharacterAnimDim(int w, int h) { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::setCharacterAnimDim(%d, %d)", w, h); restorePage3(); _animObj0Width = _animObjects[0].width; @@ -478,8 +379,8 @@ void KyraEngine_v2::setCharacterAnimDim(int w, int h) { _animObjects[0].height = h; } -void KyraEngine_v2::resetCharacterAnimDim() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v2::resetCharacterAnimDim()"); +void KyraEngine_HoF::resetCharacterAnimDim() { + debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::resetCharacterAnimDim()"); restorePage3(); _animObjects[0].width = _animObj0Width; diff --git a/engines/kyra/animator_v3.cpp b/engines/kyra/animator_mr.cpp index 07a3713908..8cf99c0290 100644 --- a/engines/kyra/animator_v3.cpp +++ b/engines/kyra/animator_mr.cpp @@ -23,13 +23,19 @@ * */ -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" +#include "kyra/resource.h" #include "kyra/wsamovie.h" namespace Kyra { -void KyraEngine_v3::clearAnimObjects() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::clearAnimObjects()"); +void KyraEngine_MR::restorePage3() { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::restorePage3()"); + screen()->copyBlockToPage(2, 0, 0, 320, 200, _gamePlayBuffer); +} + +void KyraEngine_MR::clearAnimObjects() { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::clearAnimObjects()"); for (int i = 0; i < 67; ++i) _animObjects[i].enabled = false; @@ -37,7 +43,7 @@ void KyraEngine_v3::clearAnimObjects() { _animObjects[0].index = 0; _animObjects[0].type = 0; _animObjects[0].enabled = true; - _animObjects[0].unk8 = 1; + _animObjects[0].specialRefresh = 1; _animObjects[0].flags = 0x800; _animObjects[0].width = 57; _animObjects[0].height = 91; @@ -50,13 +56,13 @@ void KyraEngine_v3::clearAnimObjects() { _animObjects[i].flags = 0; _animObjects[i].enabled = false; _animObjects[i].needRefresh = 0; - _animObjects[i].unk8 = 1; + _animObjects[i].specialRefresh = 1; } for (int i = 17; i <= 66; ++i) { _animObjects[i].index = i; _animObjects[i].type = 1; - _animObjects[i].unk8 = 1; + _animObjects[i].specialRefresh = 1; _animObjects[i].flags = 0x800; _animObjects[i].width = 24; _animObjects[i].height = 20; @@ -65,87 +71,8 @@ void KyraEngine_v3::clearAnimObjects() { } } -KyraEngine_v3::AnimObj *KyraEngine_v3::initAnimList(AnimObj *list, AnimObj *entry) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::initAnimList(%p, %p)", (const void*)list, (const void*)entry); - entry->nextObject = list; - return entry; -} - -KyraEngine_v3::AnimObj *KyraEngine_v3::addToAnimListSorted(AnimObj *list, AnimObj *add) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)add); - add->nextObject = 0; - - if (!list) - return add; - - if (add->yPos1 <= list->yPos1) { - add->nextObject = list; - return add; - } - - AnimObj *cur = list; - AnimObj *prev = list; - while (add->yPos1 > cur->yPos1) { - AnimObj *temp = cur->nextObject; - if (!temp) - break; - prev = cur; - cur = temp; - } - - if (add->yPos1 <= cur->yPos1) { - prev->nextObject = add; - add->nextObject = cur; - } else { - cur->nextObject = add; - add->nextObject = 0; - } - return list; -} - -KyraEngine_v3::AnimObj *KyraEngine_v3::deleteAnimListEntry(AnimObj *list, AnimObj *entry) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addToAnimListSorted(%p, %p)", (const void*)list, (const void*)entry); - if (!list) - return 0; - - AnimObj *old = 0; - AnimObj *cur = list; - - while (true) { - if (cur == entry) - break; - if (!cur->nextObject) - break; - old = cur; - cur = cur->nextObject; - } - - if (cur != entry) - return list; - - if (cur == list) { - if (!cur->nextObject) - return 0; - cur = cur->nextObject; - return cur; - } - - if (!cur->nextObject) { - if (!old) - return 0; - old->nextObject = 0; - return list; - } - - if (cur != entry) - return list; - - old->nextObject = entry->nextObject; - return list; -} - -void KyraEngine_v3::animSetupPaletteEntry(AnimObj *anim) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::animSetupPaletteEntry(%p)", (const void*)anim); +void KyraEngine_MR::animSetupPaletteEntry(AnimObj *anim) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::animSetupPaletteEntry(%p)", (const void*)anim); int layer = _screen->getLayer(anim->xPos1, anim->yPos1) - 1; int16 count = 0; for (int i = 0; i < 3; ++i) @@ -156,15 +83,8 @@ void KyraEngine_v3::animSetupPaletteEntry(AnimObj *anim) { anim->palette = count / 3; } -void KyraEngine_v3::restorePage3() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::restorePage3()"); - musicUpdate(0); - _screen->copyBlockToPage(3, 0, 0, 320, 200, _gamePlayBuffer); - musicUpdate(0); -} - -void KyraEngine_v3::drawAnimObjects() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::drawAnimObjects()"); +void KyraEngine_MR::drawAnimObjects() { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::drawAnimObjects()"); for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) { if (!curObject->enabled) continue; @@ -174,7 +94,7 @@ void KyraEngine_v3::drawAnimObjects() { int layer = 7; if (curObject->flags & 0x800) { - if (!curObject->unk8) + if (!curObject->specialRefresh) layer = 0; else layer = getDrawLayer(curObject->xPos1, curObject->yPos1); @@ -187,13 +107,13 @@ void KyraEngine_v3::drawAnimObjects() { } } -void KyraEngine_v3::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); +void KyraEngine_MR::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::drawSceneAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); if (obj->type == 1) { - if (obj->shapeIndex == 0xFFFF) + if (obj->shapeIndex1 == 0xFFFF) return; int scale = getScale(obj->xPos1, obj->yPos1); - _screen->drawShape(2, getShapePtr(obj->shapeIndex), x, y, 2, obj->flags | 0x104, _paletteOverlay, obj->palette, layer, scale, scale); + _screen->drawShape(2, getShapePtr(obj->shapeIndex1), x, y, 2, obj->flags | 0x104, _paletteOverlay, obj->palette, layer, scale, scale); } else { if (obj->shapePtr) { _screen->drawShape(2, obj->shapePtr, x, y, 2, obj->flags, 7); @@ -213,15 +133,15 @@ void KyraEngine_v3::drawSceneAnimObject(AnimObj *obj, int x, int y, int layer) { } } -void KyraEngine_v3::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); +void KyraEngine_MR::drawCharacterAnimObject(AnimObj *obj, int x, int y, int layer) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::drawCharacterAnimObject(%p, %d, %d, %d)", (const void*)obj, x, y, layer); if (_drawNoShapeFlag) return; if (_mainCharacter.animFrame < 9) _mainCharacter.animFrame = 87; - if (obj->shapeIndex == 0xFFFF || _mainCharacter.animFrame == 87) + if (obj->shapeIndex1 == 0xFFFF || _mainCharacter.animFrame == 87) return; _screen->drawShape(2, getShapePtr(421), _mainCharacter.x3, _mainCharacter.y3, 2, obj->flags | 0x304, _paletteOverlay, 3, layer, _charScale, _charScale); @@ -230,8 +150,8 @@ void KyraEngine_v3::drawCharacterAnimObject(AnimObj *obj, int x, int y, int laye _screen->drawShape(2, shape, x, y, 2, obj->flags | 4, layer, _charScale, _charScale); } -void KyraEngine_v3::refreshAnimObjects(int force) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::refreshAnimObjects(%d)", force); +void KyraEngine_MR::refreshAnimObjects(int force) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::refreshAnimObjects(%d)", force); for (AnimObj *curObject = _animList; curObject; curObject = curObject->nextObject) { if (!curObject->enabled) continue; @@ -276,27 +196,8 @@ void KyraEngine_v3::refreshAnimObjects(int force) { } } -void KyraEngine_v3::refreshAnimObjectsIfNeed() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::refreshAnimObjectsIfNeed()"); - for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) { - if (curEntry->enabled && curEntry->needRefresh) { - restorePage3(); - drawAnimObjects(); - refreshAnimObjects(0); - _screen->updateScreen(); - return; - } - } -} - -void KyraEngine_v3::flagAnimObjsForRefresh() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::flagAnimObjsForRefresh()"); - for (AnimObj *curEntry = _animList; curEntry; curEntry = curEntry->nextObject) - curEntry->needRefresh = true; -} - -void KyraEngine_v3::updateCharacterAnim(int charId) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::updateCharacterAnim(%d)", charId); +void KyraEngine_MR::updateCharacterAnim(int charId) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateCharacterAnim(%d)", charId); AnimObj *obj = &_animObjects[0]; obj->needRefresh = true; @@ -304,7 +205,7 @@ void KyraEngine_v3::updateCharacterAnim(int charId) { obj->xPos1 = _mainCharacter.x1; obj->yPos1 = _mainCharacter.y1; obj->shapePtr = getShapePtr(_mainCharacter.animFrame); - obj->shapeIndex = obj->shapeIndex2 = _mainCharacter.animFrame; + obj->shapeIndex1 = obj->shapeIndex2 = _mainCharacter.animFrame; int shapeOffsetX = 0, shapeOffsetY = 0; if (_mainCharacter.animFrame >= 50 && _mainCharacter.animFrame <= 87) { @@ -328,7 +229,7 @@ void KyraEngine_v3::updateCharacterAnim(int charId) { } for (int i = 1; i <= 16; ++i) { - if (_animObjects[i].enabled && _animObjects[i].unk8) + if (_animObjects[i].enabled && _animObjects[i].specialRefresh) _animObjects[i].needRefresh = true; } @@ -342,8 +243,8 @@ void KyraEngine_v3::updateCharacterAnim(int charId) { updateCharPal(1); } -void KyraEngine_v3::updateSceneAnim(int anim, int newFrame) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::updateSceneAnim(%d, %d)", anim, newFrame); +void KyraEngine_MR::updateSceneAnim(int anim, int newFrame) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateSceneAnim(%d, %d)", anim, newFrame); AnimObj *animObject = &_animObjects[1+anim]; if (!animObject->enabled) return; @@ -380,9 +281,9 @@ void KyraEngine_v3::updateSceneAnim(int anim, int newFrame) { } } -void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, int x2, int y2, int w, +void KyraEngine_MR::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) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::setupSceneAnimObject(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::setupSceneAnimObject(%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", animId, flags, x, y, x2, y2, w, h, unk10, specialSize, unk14, shape, filename); restorePage3(); SceneAnim &anim = _sceneAnims[animId]; @@ -393,9 +294,7 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, 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); @@ -431,7 +330,7 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, obj->enabled = true; obj->needRefresh = true; - obj->unk8 = (anim.flags & 0x20) ? 1 : 0; + obj->specialRefresh = (anim.flags & 0x20) ? 1 : 0; obj->flags = (anim.flags & 0x10) ? 0x800 : 0; if (anim.flags & 2) obj->flags |= 1; @@ -439,7 +338,7 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, obj->xPos1 = anim.x; obj->yPos1 = anim.y; - if ((anim.flags & 4) && anim.shapeIndex != 0xFFFF) + if ((anim.flags & 4) && anim.shapeIndex != -1) obj->shapePtr = _sceneShapes[anim.shapeIndex]; else obj->shapePtr = 0; @@ -464,8 +363,8 @@ void KyraEngine_v3::setupSceneAnimObject(int animId, uint16 flags, int x, int y, _animList = initAnimList(_animList, obj); } -void KyraEngine_v3::removeSceneAnimObject(int anim, int refresh) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::removeSceneAnimObject(%d, %d)", anim, refresh); +void KyraEngine_MR::removeSceneAnimObject(int anim, int refresh) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::removeSceneAnimObject(%d, %d)", anim, refresh); AnimObj *obj = &_animObjects[anim+1]; restorePage3(); obj->shapeIndex3 = 0xFFFF; @@ -480,8 +379,8 @@ void KyraEngine_v3::removeSceneAnimObject(int anim, int refresh) { _sceneAnimMovie[anim]->close(); } -void KyraEngine_v3::setCharacterAnimDim(int w, int h) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::setCharacterAnimDim(%d, %d)", w, h); +void KyraEngine_MR::setCharacterAnimDim(int w, int h) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::setCharacterAnimDim(%d, %d)", w, h); restorePage3(); _charBackUpWidth = _animObjects[0].width; _charBackUpWidth2 = _animObjects[0].width2; @@ -494,8 +393,8 @@ void KyraEngine_v3::setCharacterAnimDim(int w, int h) { _animObjects[0].height = h; } -void KyraEngine_v3::resetCharacterAnimDim() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::resetCharacterAnimDim()"); +void KyraEngine_MR::resetCharacterAnimDim() { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::resetCharacterAnimDim()"); restorePage3(); _animObjects[0].width2 = _charBackUpWidth2; _animObjects[0].height2 = _charBackUpHeight2; @@ -505,8 +404,8 @@ void KyraEngine_v3::resetCharacterAnimDim() { _charBackUpWidth = _charBackUpHeight = -1; } -void KyraEngine_v3::showIdleAnim() { - debugC(9, kDebugLevelMain | kDebugLevelAnimator, "KyraEngine_v3::showIdleAnim()"); +void KyraEngine_MR::showIdleAnim() { + debugC(9, kDebugLevelMain | kDebugLevelAnimator, "KyraEngine_MR::showIdleAnim()"); if (_mainCharacter.sceneId == 20 || _mainCharacter.sceneId == 21 || _mainCharacter.sceneId == 12 || _mainCharacter.sceneId == 11) @@ -532,8 +431,8 @@ void KyraEngine_v3::showIdleAnim() { _nextIdleType = !_nextIdleType; } -void KyraEngine_v3::addItemToAnimList(int item) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addItemToAnimList(%d)", item); +void KyraEngine_MR::addItemToAnimList(int item) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::addItemToAnimList(%d)", item); restorePage3(); AnimObj *animObj = &_animObjects[17+item]; @@ -548,7 +447,7 @@ void KyraEngine_v3::addItemToAnimList(int item) { animObj->shapePtr = getShapePtr(248+itemId); animSetupPaletteEntry(animObj); - animObj->shapeIndex2 = animObj->shapeIndex = 248+itemId; + animObj->shapeIndex2 = animObj->shapeIndex1 = 248+itemId; int scaleY, scaleX; scaleY = scaleX = getScale(animObj->xPos1, animObj->yPos1); @@ -563,14 +462,14 @@ void KyraEngine_v3::addItemToAnimList(int item) { animObj->needRefresh = 1; } -void KyraEngine_v3::deleteItemAnimEntry(int item) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::deleteItemAnimEntry(%d)", item); +void KyraEngine_MR::deleteItemAnimEntry(int item) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::deleteItemAnimEntry(%d)", item); AnimObj *animObj = &_animObjects[17+item]; restorePage3(); animObj->shapePtr = 0; - animObj->shapeIndex = 0xFFFF; + animObj->shapeIndex1 = 0xFFFF; animObj->shapeIndex2 = 0xFFFF; animObj->needRefresh = 1; diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index b59e7e9c84..82f6dd30fb 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -28,8 +28,8 @@ #include "common/system.h" #include "kyra/debugger.h" #include "kyra/kyra_v1.h" -#include "kyra/kyra_v2.h" -#include "kyra/kyra_v3.h" +#include "kyra/kyra_hof.h" +#include "kyra/kyra_mr.h" #include "kyra/screen.h" #include "kyra/timer.h" #include "kyra/resource.h" @@ -283,7 +283,7 @@ bool Debugger_v1::cmd_listBirthstones(int argc, const char **argv) { #pragma mark - -Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) { +Debugger_v2::Debugger_v2(KyraEngine_HoF *vm) : Debugger(vm), _vm(vm) { DCmd_Register("character_info", WRAP_METHOD(Debugger_v2, cmd_characterInfo)); DCmd_Register("enter", WRAP_METHOD(Debugger_v2, cmd_enterScene)); DCmd_Register("rooms", WRAP_METHOD(Debugger_v2, cmd_listScenes)); // for consistency with kyra_v1 @@ -322,7 +322,8 @@ bool Debugger_v2::cmd_enterScene(int argc, const char **argv) { _vm->_mainCharacter.facing = direction; _vm->enterNewScene(scene, _vm->_mainCharacter.facing, 0, 0, 1); - _vm->_screen->_mouseLockCount = 0; + while (!_vm->_screen->isMouseVisible()) + _vm->_screen->showMouse(); _detach_now = true; return false; @@ -335,8 +336,8 @@ bool Debugger_v2::cmd_enterScene(int argc, const char **argv) { bool Debugger_v2::cmd_listScenes(int argc, const char **argv) { int shown = 1; for (int i = 0; i < _vm->_sceneListSize; ++i) { - if (_vm->_sceneList[i].filename[0]) { - DebugPrintf("%-2i: %-10s", i, _vm->_sceneList[i].filename); + if (_vm->_sceneList[i].filename1[0]) { + DebugPrintf("%-2i: %-10s", i, _vm->_sceneList[i].filename1); if (!(shown % 5)) DebugPrintf("\n"); ++shown; @@ -348,7 +349,7 @@ bool Debugger_v2::cmd_listScenes(int argc, const char **argv) { } bool Debugger_v2::cmd_sceneInfo(int argc, const char **argv) { - DebugPrintf("Current scene: %d '%s'\n", _vm->_currentScene, _vm->_sceneList[_vm->_currentScene].filename); + DebugPrintf("Current scene: %d '%s'\n", _vm->_currentScene, _vm->_sceneList[_vm->_currentScene].filename1); DebugPrintf("\n"); DebugPrintf("Exit information:\n"); DebugPrintf("Exit1: leads to %d, position %dx%d\n", int16(_vm->_sceneExit1), _vm->_sceneEnterX1, _vm->_sceneEnterY1); @@ -371,7 +372,7 @@ bool Debugger_v2::cmd_sceneInfo(int argc, const char **argv) { } bool Debugger_v2::cmd_characterInfo(int argc, const char **argv) { - DebugPrintf("Main character is in scene: %d '%s'\n", _vm->_mainCharacter.sceneId, _vm->_sceneList[_vm->_mainCharacter.sceneId].filename); + DebugPrintf("Main character is in scene: %d '%s'\n", _vm->_mainCharacter.sceneId, _vm->_sceneList[_vm->_mainCharacter.sceneId].filename1); DebugPrintf("Position: %dx%d\n", _vm->_mainCharacter.x1, _vm->_mainCharacter.y1); DebugPrintf("Facing: %d\n", _vm->_mainCharacter.facing); DebugPrintf("Inventory:\n"); @@ -452,7 +453,7 @@ bool Debugger_v2::cmd_passcodes(int argc, const char **argv) { return true; } -Debugger_v3::Debugger_v3(KyraEngine_v3 *vm) : Debugger(vm), _vm(vm) { +Debugger_v3::Debugger_v3(KyraEngine_MR *vm) : Debugger(vm), _vm(vm) { DCmd_Register("give", WRAP_METHOD(Debugger_v3, cmd_giveItem)); DCmd_Register("enter", WRAP_METHOD(Debugger_v3, cmd_enterScene)); DCmd_Register("rooms", WRAP_METHOD(Debugger_v3, cmd_listScenes)); // for consistency with kyra_v1 diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h index 85c4902e42..be6725de89 100644 --- a/engines/kyra/debugger.h +++ b/engines/kyra/debugger.h @@ -32,8 +32,8 @@ namespace Kyra { class KyraEngine; class KyraEngine_v1; -class KyraEngine_v2; -class KyraEngine_v3; +class KyraEngine_HoF; +class KyraEngine_MR; class Debugger : public ::GUI::Debugger { public: @@ -73,11 +73,11 @@ protected: class Debugger_v2 : public Debugger { public: - Debugger_v2(KyraEngine_v2 *vm); + Debugger_v2(KyraEngine_HoF *vm); virtual ~Debugger_v2() {} protected: - KyraEngine_v2 *_vm; + KyraEngine_HoF *_vm; bool cmd_enterScene(int argc, const char **argv); bool cmd_listScenes(int argc, const char **argv); @@ -90,11 +90,11 @@ protected: class Debugger_v3 : public Debugger { public: - Debugger_v3(KyraEngine_v3 *vm); + Debugger_v3(KyraEngine_MR *vm); virtual ~Debugger_v3() {} protected: - KyraEngine_v3 *_vm; + KyraEngine_MR *_vm; bool cmd_giveItem(int argc, const char **argv); bool cmd_enterScene(int argc, const char **argv); diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 53d26becb2..30b0a17d4d 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -24,8 +24,8 @@ #include "kyra/kyra.h" #include "kyra/kyra_v1.h" -#include "kyra/kyra_v2.h" -#include "kyra/kyra_v3.h" +#include "kyra/kyra_hof.h" +#include "kyra/kyra_mr.h" #include "common/config-manager.h" #include "common/advancedDetector.h" @@ -509,10 +509,10 @@ bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common *engine = new Kyra::KyraEngine_v1(syst, flags); break; case Kyra::GI_KYRA2: - *engine = new Kyra::KyraEngine_v2(syst, flags); + *engine = new Kyra::KyraEngine_HoF(syst, flags); break; case Kyra::GI_KYRA3: - *engine = new Kyra::KyraEngine_v3(syst, flags); + *engine = new Kyra::KyraEngine_MR(syst, flags); break; default: res = false; diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 2e16de5112..aadb35d62d 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -24,17 +24,18 @@ */ #include "kyra/kyra.h" -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/screen.h" #include "kyra/wsamovie.h" #include "kyra/timer.h" #include "kyra/sound.h" +#include "kyra/resource.h" #include "common/savefile.h" namespace Kyra { -void KyraEngine_v2::loadButtonShapes() { +void KyraEngine_HoF::loadButtonShapes() { const uint8 *src = _screen->getCPagePtr(3); _screen->loadBitmap("_BUTTONS.CSH", 3, 3, 0); @@ -55,7 +56,7 @@ void KyraEngine_v2::loadButtonShapes() { _buttonShapes[18] = _screen->makeShapeCopy(src, 18); } -void KyraEngine_v2::setupLangButtonShapes() { +void KyraEngine_HoF::setupLangButtonShapes() { switch (_lang) { case 0: _inventoryButtons[0].data0ShapePtr = _buttonShapes[6]; @@ -79,7 +80,7 @@ void KyraEngine_v2::setupLangButtonShapes() { } } -GUI_v2::GUI_v2(KyraEngine_v2 *vm) : GUI(vm), _vm(vm), _screen(vm->screen_v2()) { +GUI_v2::GUI_v2(KyraEngine_HoF *vm) : GUI(vm), _vm(vm), _screen(vm->screen_v2()) { _backUpButtonList = _unknownButtonList = 0; initStaticData(); _currentMenu = 0; @@ -443,7 +444,7 @@ const char *GUI_v2::getMenuItemLabel(const MenuItem &menuItem) { #pragma mark - -int KyraEngine_v2::buttonInventory(Button *button) { +int KyraEngine_HoF::buttonInventory(Button *button) { if (!_screen->isMouseVisible()) return 0; @@ -494,7 +495,7 @@ int KyraEngine_v2::buttonInventory(Button *button) { return 0; } -int KyraEngine_v2::scrollInventory(Button *button) { +int KyraEngine_HoF::scrollInventory(Button *button) { uint16 *src = _mainCharacter.inventory; uint16 *dst = &_mainCharacter.inventory[10]; uint16 temp[5]; @@ -512,7 +513,7 @@ int KyraEngine_v2::scrollInventory(Button *button) { return 0; } -int KyraEngine_v2::getInventoryItemSlot(uint16 item) { +int KyraEngine_HoF::getInventoryItemSlot(uint16 item) { for (int i = 0; i < 20; ++i) { if (_mainCharacter.inventory[i] == item) return i; @@ -520,7 +521,7 @@ int KyraEngine_v2::getInventoryItemSlot(uint16 item) { return -1; } -int KyraEngine_v2::findFreeVisibleInventorySlot() { +int KyraEngine_HoF::findFreeVisibleInventorySlot() { for (int i = 0; i < 10; ++i) { if (_mainCharacter.inventory[i] == 0xFFFF) return i; @@ -528,7 +529,7 @@ int KyraEngine_v2::findFreeVisibleInventorySlot() { return -1; } -void KyraEngine_v2::removeItemFromInventory(int slot) { +void KyraEngine_HoF::removeItemFromInventory(int slot) { _mainCharacter.inventory[slot] = 0xFFFF; if (slot < 10) { _screen->hideMouse(); @@ -537,7 +538,7 @@ void KyraEngine_v2::removeItemFromInventory(int slot) { } } -bool KyraEngine_v2::checkInventoryItemExchange(uint16 handItem, int slot) { +bool KyraEngine_HoF::checkInventoryItemExchange(uint16 handItem, int slot) { bool removeItem = false; uint16 newItem = 0xFFFF; @@ -573,17 +574,17 @@ bool KyraEngine_v2::checkInventoryItemExchange(uint16 handItem, int slot) { return false; } -void KyraEngine_v2::drawInventoryShape(int page, uint16 item, int slot) { +void KyraEngine_HoF::drawInventoryShape(int page, uint16 item, int slot) { _screen->drawShape(page, getShapePtr(item+64), _inventoryX[slot], _inventoryY[slot], 0, 0); _screen->updateScreen(); } -void KyraEngine_v2::clearInventorySlot(int slot, int page) { - _screen->drawShape(page, _defaultShapeTable[240+slot], _inventoryX[slot], _inventoryY[slot], 0, 0); +void KyraEngine_HoF::clearInventorySlot(int slot, int page) { + _screen->drawShape(page, getShapePtr(240+slot), _inventoryX[slot], _inventoryY[slot], 0, 0); _screen->updateScreen(); } -void KyraEngine_v2::redrawInventory(int page) { +void KyraEngine_HoF::redrawInventory(int page) { int pageBackUp = _screen->_curPage; _screen->_curPage = page; @@ -602,7 +603,7 @@ void KyraEngine_v2::redrawInventory(int page) { _screen->_curPage = pageBackUp; } -void KyraEngine_v2::scrollInventoryWheel() { +void KyraEngine_HoF::scrollInventoryWheel() { WSAMovieV2 movie(this, _screen); movie.open("INVWHEEL.WSA", 0, 0); int frames = movie.opened() ? movie.frames() : 6; @@ -648,7 +649,7 @@ void KyraEngine_v2::scrollInventoryWheel() { // spellbook specific code -int KyraEngine_v2::bookButton(Button *button) { +int KyraEngine_HoF::bookButton(Button *button) { if (!queryGameFlag(1)) { objectChat(getTableString(0xEB, _cCodeBuffer, 1), 0, 0x83, 0xEB); return 0; @@ -739,7 +740,7 @@ int KyraEngine_v2::bookButton(Button *button) { return 0; } -void KyraEngine_v2::loadBookBkgd() { +void KyraEngine_HoF::loadBookBkgd() { char filename[16]; if (_flags.isTalkie) @@ -783,7 +784,7 @@ void KyraEngine_v2::loadBookBkgd() { _screen->loadBitmap(filename, 3, 3, 0); } -void KyraEngine_v2::showBookPage() { +void KyraEngine_HoF::showBookPage() { char filename[16]; sprintf(filename, "PAGE%.01X.", _bookCurPage); @@ -811,19 +812,19 @@ void KyraEngine_v2::showBookPage() { _screen->showMouse(); } -void KyraEngine_v2::bookLoop() { +void KyraEngine_HoF::bookLoop() { Button bookButtons[5]; GUI_V2_BUTTON(bookButtons[0], 0x24, 0, 0, 1, 1, 1, 0x4487, 0, 0x82, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - bookButtons[0].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookPrevPage); + bookButtons[0].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookPrevPage); GUI_V2_BUTTON(bookButtons[1], 0x25, 0, 0, 1, 1, 1, 0x4487, 0, 0xB1, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - bookButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookNextPage); + bookButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage); GUI_V2_BUTTON(bookButtons[2], 0x26, 0, 0, 1, 1, 1, 0x4487, 0, 0x8F, 0xBE, 0x21, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - bookButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookClose); + bookButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookClose); GUI_V2_BUTTON(bookButtons[3], 0x27, 0, 0, 1, 1, 1, 0x4487, 0, 0x08, 0x08, 0x90, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - bookButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookPrevPage); + bookButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookPrevPage); GUI_V2_BUTTON(bookButtons[4], 0x28, 0, 0, 1, 1, 1, 0x4487, 0, 0xAA, 0x08, 0x8E, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookNextPage); + bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage); Button *buttonList = 0; @@ -851,7 +852,7 @@ void KyraEngine_v2::bookLoop() { _screen->clearPage(2); } -void KyraEngine_v2::bookDecodeText(uint8 *str) { +void KyraEngine_HoF::bookDecodeText(uint8 *str) { uint8 *dst = str, *op = str; while (*op != 0x1A) { while (*op != 0x1A && *op != 0x0D) @@ -866,7 +867,7 @@ void KyraEngine_v2::bookDecodeText(uint8 *str) { *dst = 0; } -void KyraEngine_v2::bookPrintText(int dstPage, const uint8 *str, int x, int y, uint8 color) { +void KyraEngine_HoF::bookPrintText(int dstPage, const uint8 *str, int x, int y, uint8 color) { int curPageBackUp = _screen->_curPage; _screen->_curPage = dstPage; @@ -883,24 +884,24 @@ void KyraEngine_v2::bookPrintText(int dstPage, const uint8 *str, int x, int y, u _screen->_curPage = curPageBackUp; } -int KyraEngine_v2::bookPrevPage(Button *button) { +int KyraEngine_HoF::bookPrevPage(Button *button) { _bookNewPage = MAX<int>(_bookCurPage-2, 0); return 0; } -int KyraEngine_v2::bookNextPage(Button *button) { +int KyraEngine_HoF::bookNextPage(Button *button) { _bookNewPage = MIN<int>(_bookCurPage+2, _bookMaxPage); return 0; } -int KyraEngine_v2::bookClose(Button *button) { +int KyraEngine_HoF::bookClose(Button *button) { _bookShown = false; return 0; } // cauldron specific code -int KyraEngine_v2::cauldronClearButton(Button *button) { +int KyraEngine_HoF::cauldronClearButton(Button *button) { if (!queryGameFlag(2)) { updateCharFacing(); objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0); @@ -926,7 +927,7 @@ int KyraEngine_v2::cauldronClearButton(Button *button) { return 0; } -int KyraEngine_v2::cauldronButton(Button *button) { +int KyraEngine_HoF::cauldronButton(Button *button) { if (!queryGameFlag(2)) { objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0); return 0; diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h index b5a25d29bf..5f03da9ada 100644 --- a/engines/kyra/gui_v2.h +++ b/engines/kyra/gui_v2.h @@ -91,13 +91,13 @@ namespace Kyra { -class KyraEngine_v2; +class KyraEngine_HoF; class Screen_v2; class GUI_v2 : public GUI { -friend class KyraEngine_v2; +friend class KyraEngine_HoF; public: - GUI_v2(KyraEngine_v2 *engine); + GUI_v2(KyraEngine_HoF *engine); Button *addButtonToList(Button *list, Button *newButton); @@ -145,7 +145,7 @@ private: void resetState(int item); - KyraEngine_v2 *_vm; + KyraEngine_HoF *_vm; Screen_v2 *_screen; bool _buttonListChanged; diff --git a/engines/kyra/gui_v3.cpp b/engines/kyra/gui_v3.cpp index 0c9a2ef9f1..3a701caf91 100644 --- a/engines/kyra/gui_v3.cpp +++ b/engines/kyra/gui_v3.cpp @@ -24,14 +24,15 @@ */ #include "kyra/gui_v3.h" -#include "kyra/kyra_v3.h" -#include "kyra/text_v3.h" +#include "kyra/kyra_mr.h" +#include "kyra/text_mr.h" #include "kyra/wsamovie.h" +#include "kyra/resource.h" namespace Kyra { -void KyraEngine_v3::showMessage(const char *string, uint8 c0, uint8 c1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::showMessage('%s', %d, %d)", string, c0, c1); +void KyraEngine_MR::showMessage(const char *string, uint8 c0, uint8 c1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::showMessage('%s', %d, %d)", string, c0, c1); _shownMessage = string; _screen->hideMouse(); @@ -51,13 +52,13 @@ void KyraEngine_v3::showMessage(const char *string, uint8 c0, uint8 c1) { _screen->showMouse(); } -void KyraEngine_v3::showMessageFromCCode(int string, uint8 c0, int) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::showMessageFromCCode(%d, %d, -)", string, c0); +void KyraEngine_MR::showMessageFromCCode(int string, uint8 c0, int) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::showMessageFromCCode(%d, %d, -)", string, c0); showMessage((const char*)getTableEntry(_cCodeFile, string), c0, 0xF0); } -void KyraEngine_v3::updateItemCommand(int item, int str, uint8 c0) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateItemCommand(%d, %d, %d)", item, str, c0); +void KyraEngine_MR::updateItemCommand(int item, int str, uint8 c0) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateItemCommand(%d, %d, %d)", item, str, c0); char buffer[100]; char *src = (char*)getTableEntry(_itemFile, item); @@ -74,30 +75,30 @@ void KyraEngine_v3::updateItemCommand(int item, int str, uint8 c0) { showMessage(buffer, c0, 0xF0); } -void KyraEngine_v3::updateCommandLine() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCommandLine()"); +void KyraEngine_MR::updateCommandLine() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCommandLine()"); if (_restoreCommandLine) { restoreCommandLine(); _restoreCommandLine = false; } } -void KyraEngine_v3::restoreCommandLine() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::restoreCommandLine()"); +void KyraEngine_MR::restoreCommandLine() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::restoreCommandLine()"); int y = _inventoryState ? 144 : 188; _screen->copyBlockToPage(0, 0, y, 320, 12, _interfaceCommandLine); } -void KyraEngine_v3::updateCLState() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCLState()"); +void KyraEngine_MR::updateCLState() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCLState()"); if (_inventoryState) _commandLineY = 145; else _commandLineY = 189; } -void KyraEngine_v3::showInventory() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::showInventory()"); +void KyraEngine_MR::showInventory() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::showInventory()"); if (!_screen->isMouseVisible()) return; if (queryGameFlag(3)) @@ -175,8 +176,8 @@ void KyraEngine_v3::showInventory() { _screen->showMouse(); } -void KyraEngine_v3::hideInventory() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::hideInventory()"); +void KyraEngine_MR::hideInventory() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::hideInventory()"); if (queryGameFlag(3)) return; @@ -239,8 +240,8 @@ void KyraEngine_v3::hideInventory() { _screen->showMouse(); } -void KyraEngine_v3::drawMalcolmsMoodText() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::drawMalcolmsMoodText()"); +void KyraEngine_MR::drawMalcolmsMoodText() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::drawMalcolmsMoodText()"); static const int stringId[] = { 0x32, 0x37, 0x3C }; if (queryGameFlag(0x219)) @@ -274,8 +275,8 @@ void KyraEngine_v3::drawMalcolmsMoodText() { _screen->_curPage = pageBackUp; } -void KyraEngine_v3::drawMalcolmsMoodPointer(int frame, int page) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::drawMalcolmsMoodPointer(%d, %d)", frame, page); +void KyraEngine_MR::drawMalcolmsMoodPointer(int frame, int page) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::drawMalcolmsMoodPointer(%d, %d)", frame, page); static const uint8 stateTable[] = { 1, 6, 11 }; @@ -301,8 +302,8 @@ void KyraEngine_v3::drawMalcolmsMoodPointer(int frame, int page) { _invWsaFrame = frame; } -void KyraEngine_v3::drawJestersStaff(int type, int page) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::drawJestersStaff(%d, %d)", type, page); +void KyraEngine_MR::drawJestersStaff(int type, int page) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::drawJestersStaff(%d, %d)", type, page); int y = 155; if (page == 30) { page = 2; @@ -313,8 +314,8 @@ void KyraEngine_v3::drawJestersStaff(int type, int page) { _screen->drawShape(page, getShapePtr(shape), 217, y, 0, 0); } -void KyraEngine_v3::drawScore(int page, int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::drawScore(%d, %d, %d)", page, x, y); +void KyraEngine_MR::drawScore(int page, int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::drawScore(%d, %d, %d)", page, x, y); if (page == 30) { page = 2; y -= 144; @@ -331,8 +332,8 @@ void KyraEngine_v3::drawScore(int page, int x, int y) { _screen->drawShape(page, getShapePtr(shape3+433), x, y, 0, 0); } -void KyraEngine_v3::drawScoreCounting(int oldScore, int newScore, int drawOld, const int x) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::drawScoreCounting(%d, %d, %d, %d)", oldScore, newScore, drawOld, x); +void KyraEngine_MR::drawScoreCounting(int oldScore, int newScore, int drawOld, const int x) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::drawScoreCounting(%d, %d, %d, %d)", oldScore, newScore, drawOld, x); int y = 189; if (_inventoryState) y -= 44; @@ -366,8 +367,8 @@ void KyraEngine_v3::drawScoreCounting(int oldScore, int newScore, int drawOld, c _screen->drawShape(0, getShapePtr(new001+433), x + 16, y, 0, 0); } -int KyraEngine_v3::getScoreX(const char *str) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getScoreX('%s')", str); +int KyraEngine_MR::getScoreX(const char *str) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getScoreX('%s')", str); Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT); _screen->_charWidth = -2; @@ -379,8 +380,8 @@ int KyraEngine_v3::getScoreX(const char *str) { return x; } -void KyraEngine_v3::redrawInventory(int page) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::redrawInventory(%d)", page); +void KyraEngine_MR::redrawInventory(int page) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::redrawInventory(%d)", page); int yOffset = 0; if (page == 30) { @@ -407,8 +408,8 @@ void KyraEngine_v3::redrawInventory(int page) { _screen->updateScreen(); } -void KyraEngine_v3::clearInventorySlot(int slot, int page) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::clearInventorySlot(%d, %d)", slot, page); +void KyraEngine_MR::clearInventorySlot(int slot, int page) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::clearInventorySlot(%d, %d)", slot, page); int yOffset = 0; if (page == 30) { page = 2; @@ -418,8 +419,8 @@ void KyraEngine_v3::clearInventorySlot(int slot, int page) { _screen->drawShape(page, getShapePtr(slot+422), _inventoryX[slot], _inventoryY[slot] + yOffset, 0, 0); } -void KyraEngine_v3::drawInventorySlot(int page, int item, int slot) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::drawInventorySlot(%d, %d, %d)", page, item, slot); +void KyraEngine_MR::drawInventorySlot(int page, int item, int slot) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::drawInventorySlot(%d, %d, %d)", page, item, slot); int yOffset = 0; if (page == 30) { page = 2; @@ -429,8 +430,8 @@ void KyraEngine_v3::drawInventorySlot(int page, int item, int slot) { _screen->drawShape(page, getShapePtr(item+248), _inventoryX[slot], _inventoryY[slot] + yOffset, 0, 0); } -int KyraEngine_v3::buttonInventory(Button *button) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::buttonInventory(%p)", (const void*)button); +int KyraEngine_MR::buttonInventory(Button *button) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::buttonInventory(%p)", (const void*)button); setNextIdleAnimTimer(); if (!_enableInventory || !_inventoryState || !_screen->isMouseVisible()) return 0; @@ -483,7 +484,7 @@ int KyraEngine_v3::buttonInventory(Button *button) { return 0; } -int KyraEngine_v3::buttonMoodChange(Button *button) { +int KyraEngine_MR::buttonMoodChange(Button *button) { if (queryGameFlag(0x219)) { snd_playSoundEffect(0x0D, 0xC8); return 0; @@ -550,7 +551,7 @@ int KyraEngine_v3::buttonMoodChange(Button *button) { return 0; } -int KyraEngine_v3::buttonShowScore(Button *button) { +int KyraEngine_MR::buttonShowScore(Button *button) { strcpy(_stringBuffer, (const char*)getTableEntry(_cCodeFile, 18)); char *buffer = _stringBuffer; @@ -573,7 +574,7 @@ int KyraEngine_v3::buttonShowScore(Button *button) { return 0; } -int KyraEngine_v3::buttonJesterStaff(Button *button) { +int KyraEngine_MR::buttonJesterStaff(Button *button) { makeCharFacingMouse(); if (_itemInHand == 27) { _screen->hideMouse(); @@ -606,7 +607,7 @@ int KyraEngine_v3::buttonJesterStaff(Button *button) { #pragma mark - -GUI_v3::GUI_v3(KyraEngine_v3 *vm) : GUI(vm), _vm(vm), _screen(vm->_screen) { +GUI_v3::GUI_v3(KyraEngine_MR *vm) : GUI(vm), _vm(vm), _screen(vm->_screen) { _backUpButtonList = _unknownButtonList = 0; _buttonListChanged = false; } diff --git a/engines/kyra/gui_v3.h b/engines/kyra/gui_v3.h index acf3d948f8..b6c7953dff 100644 --- a/engines/kyra/gui_v3.h +++ b/engines/kyra/gui_v3.h @@ -53,13 +53,13 @@ namespace Kyra { button.data2Val3 = s; \ button.flags2 = t; -class KyraEngine_v3; -class Screen_v3; +class KyraEngine_MR; +class Screen_MR; class GUI_v3 : public GUI { -friend class KyraEngine_v3; +friend class KyraEngine_MR; public: - GUI_v3(KyraEngine_v3 *engine); + GUI_v3(KyraEngine_MR *engine); Button *addButtonToList(Button *list, Button *newButton); @@ -84,8 +84,8 @@ private: uint8 defaultColor1() const { return 0xCF; } uint8 defaultColor2() const { return 0xF8; } - KyraEngine_v3 *_vm; - Screen_v3 *_screen; + KyraEngine_MR *_vm; + Screen_MR *_screen; bool _buttonListChanged; Button *_backUpButtonList; diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_hof.cpp index ee010b62e6..c20ce5bbb1 100644 --- a/engines/kyra/items_v2.cpp +++ b/engines/kyra/items_hof.cpp @@ -23,12 +23,12 @@ * */ -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" namespace Kyra { -int KyraEngine_v2::findFreeItem() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::findFreeItem()"); +int KyraEngine_HoF::findFreeItem() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::findFreeItem()"); for (int i = 0; i < 30; ++i) { if (_itemList[i].id == 0xFFFF) return i; @@ -36,8 +36,8 @@ int KyraEngine_v2::findFreeItem() { return -1; } -int KyraEngine_v2::countAllItems() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::countAllItems()"); +int KyraEngine_HoF::countAllItems() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::countAllItems()"); int num = 0; for (int i = 0; i < 30; ++i) { if (_itemList[i].id != 0xFFFF) @@ -46,8 +46,8 @@ int KyraEngine_v2::countAllItems() { return num; } -int KyraEngine_v2::findItem(uint16 sceneId, uint16 id) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::findItem(%u, %u)", sceneId, id); +int KyraEngine_HoF::findItem(uint16 sceneId, uint16 id) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::findItem(%u, %u)", sceneId, id); for (int i = 0; i < 30; ++i) { if (_itemList[i].id == id && _itemList[i].sceneId == sceneId) return i; @@ -55,8 +55,8 @@ int KyraEngine_v2::findItem(uint16 sceneId, uint16 id) { return -1; } -int KyraEngine_v2::checkItemCollision(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::checkItemCollision(%d, %d)", x, y); +int KyraEngine_HoF::checkItemCollision(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::checkItemCollision(%d, %d)", x, y); int itemPos = -1, yPos = -1; for (int i = 0; i < 30; ++i) { @@ -86,8 +86,8 @@ int KyraEngine_v2::checkItemCollision(int x, int y) { return itemPos; } -void KyraEngine_v2::resetItemList() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::resetItemList()"); +void KyraEngine_HoF::resetItemList() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::resetItemList()"); for (int i = 0; i < 30; ++i) { _itemList[i].id = 0xFFFF; _itemList[i].sceneId = 0xFFFF; @@ -97,8 +97,8 @@ void KyraEngine_v2::resetItemList() { } } -void KyraEngine_v2::updateWaterFlasks() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::updateWaterFlasks()"); +void KyraEngine_HoF::updateWaterFlasks() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::updateWaterFlasks()"); for (int i = 22; i < 24; i++) { if (_itemInHand == i) setHandItem(i - 1); @@ -120,8 +120,8 @@ void KyraEngine_v2::updateWaterFlasks() { } } -bool KyraEngine_v2::dropItem(int unk1, uint16 item, int x, int y, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::dropItem(%d, %u, %d, %d, %d)", unk1, item, x, y, unk2); +bool KyraEngine_HoF::dropItem(int unk1, uint16 item, int x, int y, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::dropItem(%d, %u, %d, %d, %d)", unk1, item, x, y, unk2); if (_handItemSet <= -1) return false; @@ -135,8 +135,8 @@ bool KyraEngine_v2::dropItem(int unk1, uint16 item, int x, int y, int unk2) { return success; } -bool KyraEngine_v2::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::processItemDrop(%u, %u, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2); +bool KyraEngine_HoF::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::processItemDrop(%u, %u, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2); int itemPos = checkItemCollision(x, y); if (unk1) @@ -244,8 +244,8 @@ bool KyraEngine_v2::processItemDrop(uint16 sceneId, uint16 item, int x, int y, i return true; } -void KyraEngine_v2::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::itemDropDown(%d, %d, %d, %d, %d, %u)", startX, startY, dstX, dstY, itemSlot, item); +void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::itemDropDown(%d, %d, %d, %d, %d, %u)", startX, startY, dstX, dstY, itemSlot, item); uint8 *itemShape = getShapePtr(item + 64); if (startX == dstX && startY == dstY) { @@ -349,8 +349,8 @@ void KyraEngine_v2::itemDropDown(int startX, int startY, int dstX, int dstY, int } } -void KyraEngine_v2::exchangeMouseItem(int itemPos) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::exchangeMouseItem(%d)", itemPos); +void KyraEngine_HoF::exchangeMouseItem(int itemPos) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::exchangeMouseItem(%d)", itemPos); _screen->hideMouse(); deleteItemAnimEntry(itemPos); @@ -373,8 +373,8 @@ void KyraEngine_v2::exchangeMouseItem(int itemPos) { runSceneScript6(); } -bool KyraEngine_v2::pickUpItem(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::pickUpItem(%d, %d)", x, y); +bool KyraEngine_HoF::pickUpItem(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::pickUpItem(%d, %d)", x, y); int itemPos = checkItemCollision(x, y); if (itemPos <= -1) @@ -404,8 +404,8 @@ bool KyraEngine_v2::pickUpItem(int x, int y) { return true; } -bool KyraEngine_v2::isDropable(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::isDropable(%d, %d)", x, y); +bool KyraEngine_HoF::isDropable(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::isDropable(%d, %d)", x, y); if (x < 14 || x > 304 || y < 14 || y > 136) return false; @@ -420,8 +420,8 @@ bool KyraEngine_v2::isDropable(int x, int y) { return true; } -int KyraEngine_v2::getItemCommandStringDrop(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::getItemCommandStringDrop(%u)", item); +int KyraEngine_HoF::getItemCommandStringDrop(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::getItemCommandStringDrop(%u)", item); assert(item < _itemStringMapSize); int stringId = _itemStringMap[item]; @@ -433,8 +433,8 @@ int KyraEngine_v2::getItemCommandStringDrop(uint16 item) { return dropStringIds[stringId]; } -int KyraEngine_v2::getItemCommandStringPickUp(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::getItemCommandStringPickUp(%u)", item); +int KyraEngine_HoF::getItemCommandStringPickUp(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::getItemCommandStringPickUp(%u)", item); assert(item < _itemStringMapSize); int stringId = _itemStringMap[item]; @@ -446,8 +446,8 @@ int KyraEngine_v2::getItemCommandStringPickUp(uint16 item) { return pickUpStringIds[stringId]; } -int KyraEngine_v2::getItemCommandStringInv(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::getItemCommandStringInv(%u)", item); +int KyraEngine_HoF::getItemCommandStringInv(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::getItemCommandStringInv(%u)", item); assert(item < _itemStringMapSize); int stringId = _itemStringMap[item]; @@ -459,8 +459,8 @@ int KyraEngine_v2::getItemCommandStringInv(uint16 item) { return pickUpStringIds[stringId]; } -void KyraEngine_v2::setMouseCursor(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::setMouseCursor(%u)", item); +void KyraEngine_HoF::setMouseCursor(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::setMouseCursor(%u)", item); int shape = 0; int hotX = 1; int hotY = 1; @@ -474,8 +474,8 @@ void KyraEngine_v2::setMouseCursor(uint16 item) { _screen->setMouseCursor(hotX, hotY, getShapePtr(shape)); } -void KyraEngine_v2::setHandItem(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::setHandItem(%u)", item); +void KyraEngine_HoF::setHandItem(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::setHandItem(%u)", item); _screen->hideMouse(); if (item == 0xFFFF) { @@ -488,17 +488,17 @@ void KyraEngine_v2::setHandItem(uint16 item) { _screen->showMouse(); } -void KyraEngine_v2::removeHandItem() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::removeHandItem()"); +void KyraEngine_HoF::removeHandItem() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::removeHandItem()"); _screen->hideMouse(); - _screen->setMouseCursor(0, 0, _defaultShapeTable[0]); + _screen->setMouseCursor(0, 0, getShapePtr(0)); _itemInHand = -1; _handItemSet = -1; _screen->showMouse(); } -bool KyraEngine_v2::itemIsFlask(int item) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::itemIsFlask(%d)", item); +bool KyraEngine_HoF::itemIsFlask(int item) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::itemIsFlask(%d)", item); for (int i = 0; _flaskTable[i] != -1; ++i) { if (_flaskTable[i] == item) return true; diff --git a/engines/kyra/items_v3.cpp b/engines/kyra/items_mr.cpp index d428debda6..609d87881e 100644 --- a/engines/kyra/items_v3.cpp +++ b/engines/kyra/items_mr.cpp @@ -23,13 +23,13 @@ * */ -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" #include "kyra/timer.h" namespace Kyra { -void KyraEngine_v3::resetItem(int index) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::resetItem(%d)", index); +void KyraEngine_MR::resetItem(int index) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::resetItem(%d)", index); _itemList[index].id = 0xFFFF; _itemList[index].sceneId = 0xFFFF; _itemList[index].x = 0; @@ -37,14 +37,14 @@ void KyraEngine_v3::resetItem(int index) { _itemList[index].unk8 = 0; } -void KyraEngine_v3::resetItemList() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::resetItemList()"); +void KyraEngine_MR::resetItemList() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::resetItemList()"); for (int i = 0; i < 50; ++i) resetItem(i); } -void KyraEngine_v3::removeTrashItems() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::removeTrashItems()"); +void KyraEngine_MR::removeTrashItems() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::removeTrashItems()"); for (int i = 0; _trashItemList[i] != 0xFF; ++i) { for (int item = findItem(_trashItemList[i]); item != -1; item = findItem(_trashItemList[i])) { if (_itemList[item].sceneId != _mainCharacter.sceneId) @@ -55,8 +55,8 @@ void KyraEngine_v3::removeTrashItems() { } } -int KyraEngine_v3::findFreeItem() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::findFreeItem()"); +int KyraEngine_MR::findFreeItem() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::findFreeItem()"); for (int i = 0; i < 50; ++i) { if (_itemList[i].id == 0xFFFF) return i; @@ -64,8 +64,8 @@ int KyraEngine_v3::findFreeItem() { return -1; } -int KyraEngine_v3::findFreeInventorySlot() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::findFreeInventorySlot()"); +int KyraEngine_MR::findFreeInventorySlot() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::findFreeInventorySlot()"); for (int i = 0; i < 10; ++i) { if (_mainCharacter.inventory[i] == 0xFFFF) return i; @@ -73,8 +73,8 @@ int KyraEngine_v3::findFreeInventorySlot() { return -1; } -int KyraEngine_v3::findItem(uint16 sceneId, uint16 id) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::findItem(%u, %u)", sceneId, id); +int KyraEngine_MR::findItem(uint16 sceneId, uint16 id) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::findItem(%u, %u)", sceneId, id); for (int i = 0; i < 50; ++i) { if (_itemList[i].id == id && _itemList[i].sceneId == sceneId) return i; @@ -82,8 +82,8 @@ int KyraEngine_v3::findItem(uint16 sceneId, uint16 id) { return -1; } -int KyraEngine_v3::findItem(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::findItem(%u)", item); +int KyraEngine_MR::findItem(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::findItem(%u)", item); for (int i = 0; i < 50; ++i) { if (_itemList[i].id == item) return i; @@ -91,8 +91,8 @@ int KyraEngine_v3::findItem(uint16 item) { return -1; } -int KyraEngine_v3::countAllItems() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::countAllItems()"); +int KyraEngine_MR::countAllItems() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::countAllItems()"); int count = 0; for (int i = 0; i < 50; ++i) { @@ -103,8 +103,8 @@ int KyraEngine_v3::countAllItems() { return count; } -int KyraEngine_v3::checkItemCollision(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::checkItemCollision(%d, %d)", x, y); +int KyraEngine_MR::checkItemCollision(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::checkItemCollision(%d, %d)", x, y); int itemIndex = -1; int maxItemY = -1; @@ -133,8 +133,8 @@ int KyraEngine_v3::checkItemCollision(int x, int y) { return itemIndex; } -void KyraEngine_v3::setMouseCursor(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::setMouseCursor(%u)", item); +void KyraEngine_MR::setMouseCursor(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::setMouseCursor(%u)", item); int shape = 0; int hotX = 1; int hotY = 1; @@ -149,8 +149,8 @@ void KyraEngine_v3::setMouseCursor(uint16 item) { _screen->setMouseCursor(hotX, hotY, getShapePtr(shape)); } -void KyraEngine_v3::setItemMouseCursor() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::setItemMouseCursor()"); +void KyraEngine_MR::setItemMouseCursor() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::setItemMouseCursor()"); _handItemSet = _itemInHand; if (_itemInHand == -1) _screen->setMouseCursor(0, 0, _gameShapes[0]); @@ -158,8 +158,8 @@ void KyraEngine_v3::setItemMouseCursor() { _screen->setMouseCursor(12, 19, _gameShapes[_itemInHand+248]); } -void KyraEngine_v3::setHandItem(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::setHandItem(%u)", item); +void KyraEngine_MR::setHandItem(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::setHandItem(%u)", item); _screen->hideMouse(); if (item == 0xFFFF) { @@ -172,8 +172,8 @@ void KyraEngine_v3::setHandItem(uint16 item) { _screen->showMouse(); } -void KyraEngine_v3::removeHandItem() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::removeHandItem()"); +void KyraEngine_MR::removeHandItem() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::removeHandItem()"); _screen->hideMouse(); _screen->setMouseCursor(0, 0, _gameShapes[0]); _itemInHand = -1; @@ -181,8 +181,8 @@ void KyraEngine_v3::removeHandItem() { _screen->showMouse(); } -bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2); +bool KyraEngine_MR::dropItem(int unk1, uint16 item, int x, int y, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2); if (_handItemSet <= -1) return false; @@ -206,8 +206,8 @@ bool KyraEngine_v3::dropItem(int unk1, uint16 item, int x, int y, int unk2) { return false; } -bool KyraEngine_v3::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2); +bool KyraEngine_MR::processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2); int itemPos = checkItemCollision(x, y); @@ -313,7 +313,7 @@ bool KyraEngine_v3::processItemDrop(uint16 sceneId, uint16 item, int x, int y, i return true; } -void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item, int remove) { +void KyraEngine_MR::itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item, int remove) { debugC(9, kDebugLevelMain, "KyraEngine_v2::itemDropDown(%d, %d, %d, %d, %d, %u, %d)", startX, startY, dstX, dstY, itemSlot, item, remove); if (startX == dstX && startY == dstY) { _itemList[itemSlot].x = dstX; @@ -398,8 +398,8 @@ void KyraEngine_v3::itemDropDown(int startX, int startY, int dstX, int dstY, int removeHandItem(); } -void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::exchangeMouseItem(%d, %d)", itemPos, runScript); +void KyraEngine_MR::exchangeMouseItem(int itemPos, int runScript) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::exchangeMouseItem(%d, %d)", itemPos, runScript); if (itemListMagic(_itemInHand, itemPos)) return; @@ -431,8 +431,8 @@ void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) { runSceneScript6(); } -bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::pickUpItem(%d, %d, %d)", x, y, runScript); +bool KyraEngine_MR::pickUpItem(int x, int y, int runScript) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::pickUpItem(%d, %d, %d)", x, y, runScript); int itemPos = checkItemCollision(x, y); if (itemPos <= -1) @@ -463,8 +463,8 @@ bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) { return true; } -bool KyraEngine_v3::isDropable(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::isDropable(%d, %d)", x, y); +bool KyraEngine_MR::isDropable(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::isDropable(%d, %d)", x, y); if (y < 14 || y > 187) return false; @@ -478,8 +478,8 @@ bool KyraEngine_v3::isDropable(int x, int y) { return true; } -bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::itemListMagic(%d, %d)", handItem, itemSlot); +bool KyraEngine_MR::itemListMagic(int handItem, int itemSlot) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::itemListMagic(%d, %d)", handItem, itemSlot); uint16 item = _itemList[itemSlot].id; if (_currentChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) { @@ -497,7 +497,7 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) { _screen->hideMouse(); snd_playSoundEffect(0x93, 0xC8); for (int i = 109; i <= 141; ++i) { - _animObjects[animObjIndex].shapeIndex = i+248; + _animObjects[animObjIndex].shapeIndex1 = i+248; _animObjects[animObjIndex].needRefresh = true; delay(1*_tickLength, true); } @@ -558,8 +558,8 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) { return false; } -bool KyraEngine_v3::itemInventoryMagic(int handItem, int invSlot) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::itemInventoryMagic(%d, %d)", handItem, invSlot); +bool KyraEngine_MR::itemInventoryMagic(int handItem, int invSlot) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::itemInventoryMagic(%d, %d)", handItem, invSlot); uint16 item = _mainCharacter.inventory[invSlot]; if (_currentChapter == 1 && handItem == 3 && item == 3 && queryGameFlag(0x76)) { @@ -619,22 +619,22 @@ bool KyraEngine_v3::itemInventoryMagic(int handItem, int invSlot) { return false; } -int KyraEngine_v3::getItemCommandStringDrop(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringDrop(%u)", item); +int KyraEngine_MR::getItemCommandStringDrop(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getItemCommandStringDrop(%u)", item); assert(item < _itemStringMapSize); int stringId = _itemStringMap[item]; return _itemStringDrop[stringId]; } -int KyraEngine_v3::getItemCommandStringPickUp(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringPickUp(%u)", item); +int KyraEngine_MR::getItemCommandStringPickUp(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getItemCommandStringPickUp(%u)", item); assert(item < _itemStringMapSize); int stringId = _itemStringMap[item]; return _itemStringPickUp[stringId]; } -int KyraEngine_v3::getItemCommandStringInv(uint16 item) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringInv(%u)", item); +int KyraEngine_MR::getItemCommandStringInv(uint16 item) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getItemCommandStringInv(%u)", item); assert(item < _itemStringMapSize); int stringId = _itemStringMap[item]; return _itemStringInv[stringId]; diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_hof.cpp index 8d4a64e1a7..e4b7d2b528 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -24,14 +24,14 @@ */ #include "kyra/kyra.h" -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/screen.h" #include "kyra/resource.h" #include "kyra/wsamovie.h" #include "kyra/sound.h" #include "kyra/script.h" #include "kyra/script_tim.h" -#include "kyra/text_v2.h" +#include "kyra/text_hof.h" #include "kyra/timer.h" #include "kyra/debugger.h" @@ -40,8 +40,7 @@ namespace Kyra { -KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags), _updateFunctor(this, &KyraEngine_v2::update) { - memset(_defaultShapeTable, 0, sizeof(_defaultShapeTable)); +KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags), _updateFunctor(this, &KyraEngine_HoF::update) { _mouseSHPBuf = 0; _debugger = 0; _screen = 0; @@ -72,8 +71,6 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi _currentTalkFile = 0; _lastSfxTrack = -1; _handItemSet = -1; - _lastProcessedSceneScript = 0; - _specialSceneScriptRunFlag = false; memset(_animObjects, 0, sizeof(_animObjects)); _unkHandleSceneChangeFlag = false; _pathfinderFlag = 0; @@ -110,7 +107,6 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi _screenBuffer = 0; _inventorySaved = false; _unkBuf200kByte = 0; - memset(&_defaultShapeTable, 0, sizeof(_defaultShapeTable)); memset(&_sceneShapeTable, 0, sizeof(_sceneShapeTable)); memset(&_sceneScriptData, 0, sizeof(_sceneScriptData)); @@ -149,7 +145,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi _menu = 0; } -KyraEngine_v2::~KyraEngine_v2() { +KyraEngine_HoF::~KyraEngine_HoF() { cleanup(); seq_uninit(); @@ -186,8 +182,8 @@ KyraEngine_v2::~KyraEngine_v2() { _timOpcodes.clear(); } -int KyraEngine_v2::init() { - _screen = new Screen_v2(this, _system); +int KyraEngine_HoF::init() { + _screen = new Screen_HoF(this, _system); assert(_screen); _screen->setResolution(); @@ -232,16 +228,14 @@ int KyraEngine_v2::init() { _mouseSHPBuf = _res->fileData("PWGMOUSE.SHP", 0); assert(_mouseSHPBuf); - for (int i = 0; i < 2; i++) { - _defaultShapeTable[i] = _screen->getPtrToShape(_mouseSHPBuf, i); - assert(_defaultShapeTable[i]); - } + for (int i = 0; i < 2; i++) + addShapeToPool(_screen->getPtrToShape(_mouseSHPBuf, i), i); - _screen->setMouseCursor(0, 0, _defaultShapeTable[0]); + _screen->setMouseCursor(0, 0, getShapePtr(0)); return 0; } -int KyraEngine_v2::go() { +int KyraEngine_HoF::go() { if (_gameToLoad == -1) { if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) seq_showStarcraftLogo(); @@ -282,7 +276,7 @@ int KyraEngine_v2::go() { return 0; } -void KyraEngine_v2::startup() { +void KyraEngine_HoF::startup() { _sound->setSoundList(&_soundData[kMusicIngame]); // The track map is exactly the same // for FM-TOWNS and DOS @@ -293,7 +287,6 @@ void KyraEngine_v2::startup() { delete [] _mouseSHPBuf; _mouseSHPBuf = 0; - memset(_defaultShapeTable, 0, sizeof(_defaultShapeTable)); memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable)); _gamePlayBuffer = new uint8[46080]; _unkBuf500Bytes = new uint8[500]; @@ -410,7 +403,7 @@ void KyraEngine_v2::startup() { setWalkspeed(_configWalkspeed); } -void KyraEngine_v2::runLoop() { +void KyraEngine_HoF::runLoop() { _screen->updateScreen(); _quitFlag = false; @@ -471,7 +464,7 @@ void KyraEngine_v2::runLoop() { } } -void KyraEngine_v2::handleInput(int x, int y) { +void KyraEngine_HoF::handleInput(int x, int y) { setNextIdleAnimTimer(); if (_unk5) { _unk5 = 0; @@ -575,7 +568,7 @@ void KyraEngine_v2::handleInput(int x, int y) { } } -bool KyraEngine_v2::handleInputUnkSub(int x, int y) { +bool KyraEngine_HoF::handleInputUnkSub(int x, int y) { if (y > 143 || _deathHandler > -1 || queryGameFlag(0x164)) return false; @@ -609,7 +602,7 @@ bool KyraEngine_v2::handleInputUnkSub(int x, int y) { } } -void KyraEngine_v2::update() { +void KyraEngine_HoF::update() { updateInput(); refreshAnimObjectsIfNeed(); @@ -622,7 +615,7 @@ void KyraEngine_v2::update() { _screen->updateScreen(); } -void KyraEngine_v2::updateWithText() { +void KyraEngine_HoF::updateWithText() { updateInput(); updateMouse(); @@ -645,7 +638,7 @@ void KyraEngine_v2::updateWithText() { _screen->updateScreen(); } -void KyraEngine_v2::updateMouse() { +void KyraEngine_HoF::updateMouse() { int shapeIndex = 0; int type = 0; int xOffset = 0, yOffset = 0; @@ -755,40 +748,7 @@ void KyraEngine_v2::updateMouse() { } } -void KyraEngine_v2::updateInput() { - Common::Event event; - - while (_eventMan->pollEvent(event)) { - switch (event.type) { - case Common::EVENT_QUIT: - _quitFlag = true; - break; - - case Common::EVENT_KEYDOWN: - if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE) - _eventList.push_back(Event(event, true)); - else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL) - _quitFlag = true; - else - _eventList.push_back(event); - break; - - case Common::EVENT_LBUTTONDOWN: - _eventList.push_back(Event(event, true)); - break; - - case Common::EVENT_LBUTTONUP: - case Common::EVENT_MOUSEMOVE: - _eventList.push_back(event); - break; - - default: - break; - } - } -} - -int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) { +int KyraEngine_HoF::checkInput(Button *buttonList, bool mainLoop) { updateInput(); int keys = 0; @@ -850,32 +810,7 @@ int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) { return _gui->processButtonList(buttonList, keys | 0x8000); } -void KyraEngine_v2::removeInputTop() { - if (!_eventList.empty()) - _eventList.erase(_eventList.begin()); -} - -bool KyraEngine_v2::skipFlag() const { - for (Common::List<Event>::const_iterator i = _eventList.begin(); i != _eventList.end(); ++i) { - if (i->causedSkip) - return true; - } - return false; -} - -void KyraEngine_v2::resetSkipFlag(bool removeEvent) { - for (Common::List<Event>::iterator i = _eventList.begin(); i != _eventList.end(); ++i) { - if (i->causedSkip) { - if (removeEvent) - _eventList.erase(i); - else - i->causedSkip = false; - return; - } - } -} - -void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) { +void KyraEngine_HoF::delay(uint32 amount, bool updateGame, bool isMainLoop) { uint32 start = _system->getMillis(); do { if (updateGame) { @@ -892,7 +827,7 @@ void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) { } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag); } -void KyraEngine_v2::cleanup() { +void KyraEngine_HoF::cleanup() { delete [] _inventoryButtons; _inventoryButtons = 0; delete [] _gamePlayBuffer; _gamePlayBuffer = 0; @@ -904,10 +839,6 @@ void KyraEngine_v2::cleanup() { _newShapeFiledata = 0; _newShapeCount = 0; - for (int i = 0; i < ARRAYSIZE(_defaultShapeTable); ++i) { - delete [] _defaultShapeTable[i]; - _defaultShapeTable[i] = 0; - } freeSceneShapePtrs(); if (_optionsBuffer != _cCodeBuffer) @@ -939,7 +870,7 @@ void KyraEngine_v2::cleanup() { #pragma mark - Localization -void KyraEngine_v2::loadCCodeBuffer(const char *file) { +void KyraEngine_HoF::loadCCodeBuffer(const char *file) { char tempString[13]; strcpy(tempString, file); changeFileExtension(tempString); @@ -948,7 +879,7 @@ void KyraEngine_v2::loadCCodeBuffer(const char *file) { _cCodeBuffer = _res->fileData(tempString, 0); } -void KyraEngine_v2::loadOptionsBuffer(const char *file) { +void KyraEngine_HoF::loadOptionsBuffer(const char *file) { char tempString[13]; strcpy(tempString, file); changeFileExtension(tempString); @@ -957,7 +888,7 @@ void KyraEngine_v2::loadOptionsBuffer(const char *file) { _optionsBuffer = _res->fileData(tempString, 0); } -void KyraEngine_v2::loadChapterBuffer(int chapter) { +void KyraEngine_HoF::loadChapterBuffer(int chapter) { char tempString[14]; static const char *chapterFilenames[] = { @@ -973,7 +904,7 @@ void KyraEngine_v2::loadChapterBuffer(int chapter) { _currentChapter = chapter; } -void KyraEngine_v2::changeFileExtension(char *buffer) { +void KyraEngine_HoF::changeFileExtension(char *buffer) { while (*buffer != '.') ++buffer; @@ -981,11 +912,11 @@ void KyraEngine_v2::changeFileExtension(char *buffer) { strcpy(buffer, _languageExtension[_lang]); } -uint8 *KyraEngine_v2::getTableEntry(uint8 *buffer, int id) { +uint8 *KyraEngine_HoF::getTableEntry(uint8 *buffer, int id) { return buffer + READ_LE_UINT16(buffer + (id<<1)); } -char *KyraEngine_v2::getTableString(int id, uint8 *buffer, int decode) { +char *KyraEngine_HoF::getTableString(int id, uint8 *buffer, int decode) { char *string = (char*)getTableEntry(buffer, id); if (decode && _flags.lang != Common::JA_JPN) { @@ -997,14 +928,14 @@ char *KyraEngine_v2::getTableString(int id, uint8 *buffer, int decode) { return string; } -const char *KyraEngine_v2::getChapterString(int id) { +const char *KyraEngine_HoF::getChapterString(int id) { if (_currentChapter != _newChapterFile) loadChapterBuffer(_newChapterFile); return getTableString(id, _chapterBuffer, 1); } -int KyraEngine_v2::decodeString1(const char *src, char *dst) { +int KyraEngine_HoF::decodeString1(const char *src, char *dst) { static const uint8 decodeTable1[] = { 0x20, 0x65, 0x74, 0x61, 0x69, 0x6E, 0x6F, 0x73, 0x72, 0x6C, 0x68, 0x63, 0x64, 0x75, 0x70, 0x6D @@ -1045,7 +976,7 @@ int KyraEngine_v2::decodeString1(const char *src, char *dst) { return size; } -void KyraEngine_v2::decodeString2(const char *src, char *dst) { +void KyraEngine_HoF::decodeString2(const char *src, char *dst) { if (!src || !dst) return; @@ -1064,12 +995,12 @@ void KyraEngine_v2::decodeString2(const char *src, char *dst) { #pragma mark - -void KyraEngine_v2::showMessageFromCCode(int id, int16 palIndex, int) { +void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) { const char *string = getTableString(id, _cCodeBuffer, 1); showMessage(string, palIndex); } -void KyraEngine_v2::showMessage(const char *string, int16 palIndex) { +void KyraEngine_HoF::showMessage(const char *string, int16 palIndex) { _shownMessage = string; _screen->hideMouse(); _screen->fillRect(0, 190, 319, 199, 0xCF); @@ -1092,11 +1023,11 @@ void KyraEngine_v2::showMessage(const char *string, int16 palIndex) { _screen->showMouse(); } -void KyraEngine_v2::showChapterMessage(int id, int16 palIndex) { +void KyraEngine_HoF::showChapterMessage(int id, int16 palIndex) { showMessage(getChapterString(id), palIndex); } -void KyraEngine_v2::updateCommandLineEx(int str1, int str2, int16 palIndex) { +void KyraEngine_HoF::updateCommandLineEx(int str1, int str2, int16 palIndex) { char buffer[0x51]; char *src = buffer; @@ -1120,7 +1051,7 @@ void KyraEngine_v2::updateCommandLineEx(int str1, int str2, int16 palIndex) { showMessage((char*)_unkBuf500Bytes, palIndex); } -void KyraEngine_v2::fadeMessagePalette() { +void KyraEngine_HoF::fadeMessagePalette() { if (!_fadeMessagePalette) return; @@ -1145,22 +1076,18 @@ void KyraEngine_v2::fadeMessagePalette() { #pragma mark - -void KyraEngine_v2::loadMouseShapes() { +void KyraEngine_HoF::loadMouseShapes() { _screen->loadBitmap("_MOUSE.CSH", 3, 3, 0); - for (int i = 0; i <= 8; ++i) { - _defaultShapeTable[i] = _screen->makeShapeCopy(_screen->getCPagePtr(3), i); - assert(_defaultShapeTable[i]); - } + for (int i = 0; i <= 8; ++i) + addShapeToPool(_screen->makeShapeCopy(_screen->getCPagePtr(3), i), i); } -void KyraEngine_v2::loadItemShapes() { +void KyraEngine_HoF::loadItemShapes() { _screen->loadBitmap("_ITEMS.CSH", 3, 3, 0); - for (int i = 64; i <= 239; ++i) { - _defaultShapeTable[i] = _screen->makeShapeCopy(_screen->getCPagePtr(3), i-64); - assert(_defaultShapeTable[i]); - } + for (int i = 64; i <= 239; ++i) + addShapeToPool(_screen->getCPagePtr(3), i, i-64); _res->loadFileToBuf("_ITEMHT.DAT", _itemHtDat, sizeof(_itemHtDat)); assert(_res->getFileSize("_ITEMHT.DAT") == sizeof(_itemHtDat)); @@ -1168,7 +1095,7 @@ void KyraEngine_v2::loadItemShapes() { _screen->_curPage = 0; } -void KyraEngine_v2::loadZShapes(int shapes) { +void KyraEngine_HoF::loadZShapes(int shapes) { char file[10]; strcpy(file, "_ZX.SHP"); @@ -1176,31 +1103,26 @@ void KyraEngine_v2::loadZShapes(int shapes) { file[2] = '0' + shapes; uint8 *data = _res->fileData(file, 0); - for (int i = 9; i <= 32; ++i) { - delete [] _defaultShapeTable[i]; - _defaultShapeTable[i] = _screen->makeShapeCopy(data, i-9); - assert(_defaultShapeTable[i]); - } + for (int i = 9; i <= 32; ++i) + addShapeToPool(data, i, i-9); delete [] data; _loadedZTable = shapes; } -void KyraEngine_v2::loadInventoryShapes() { +void KyraEngine_HoF::loadInventoryShapes() { int curPageBackUp = _screen->_curPage; _screen->_curPage = 2; _screen->loadBitmap("_PLAYALL.CPS", 3, 3, 0); - for (int i = 0; i < 10; ++i) { - _defaultShapeTable[240+i] = _screen->encodeShape(_inventoryX[i], _inventoryY[i], 16, 16, 0); - assert(_defaultShapeTable[240+i]); - } + for (int i = 0; i < 10; ++i) + addShapeToPool(_screen->encodeShape(_inventoryX[i], _inventoryY[i], 16, 16, 0), 240+i); _screen->_curPage = curPageBackUp; } -void KyraEngine_v2::runStartScript(int script, int unk1) { +void KyraEngine_HoF::runStartScript(int script, int unk1) { char filename[14]; strcpy(filename, "_START0X.EMC"); filename[7] = script + '0'; @@ -1219,7 +1141,7 @@ void KyraEngine_v2::runStartScript(int script, int unk1) { _emc->unload(&scriptData); } -void KyraEngine_v2::loadNPCScript() { +void KyraEngine_HoF::loadNPCScript() { char filename[12]; strcpy(filename, "_NPC.EMC"); @@ -1249,7 +1171,7 @@ void KyraEngine_v2::loadNPCScript() { _emc->load(filename, &_npcScriptData, &_opcodes); } -void KyraEngine_v2::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) { +void KyraEngine_HoF::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) { memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData)); memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState)); @@ -1298,25 +1220,25 @@ void KyraEngine_v2::runTemporaryScript(const char *filename, int allowSkip, int #pragma mark - -void KyraEngine_v2::resetScaleTable() { +void KyraEngine_HoF::resetScaleTable() { Common::set_to(_scaleTable, _scaleTable + ARRAYSIZE(_scaleTable), 0x100); } -void KyraEngine_v2::setScaleTableItem(int item, int data) { +void KyraEngine_HoF::setScaleTableItem(int item, int data) { if (item >= 1 || item <= 15) _scaleTable[item-1] = (data << 8) / 100; } -int KyraEngine_v2::getScale(int x, int y) { +int KyraEngine_HoF::getScale(int x, int y) { return _scaleTable[_screen->getLayer(x, y) - 1]; } -void KyraEngine_v2::setDrawLayerTableEntry(int entry, int data) { +void KyraEngine_HoF::setDrawLayerTableEntry(int entry, int data) { if (entry >= 1 || entry <= 15) _drawLayerTable[entry-1] = data; } -int KyraEngine_v2::getDrawLayer(int x, int y) { +int KyraEngine_HoF::getDrawLayer(int x, int y) { int layer = _screen->getLayer(x, y); layer = _drawLayerTable[layer-1]; if (layer < 0) @@ -1326,11 +1248,7 @@ int KyraEngine_v2::getDrawLayer(int x, int y) { return layer; } -void KyraEngine_v2::restorePage3() { - _screen->copyBlockToPage(2, 0, 0, 320, 144, _gamePlayBuffer); -} - -void KyraEngine_v2::backUpPage0() { +void KyraEngine_HoF::backUpPage0() { if (_screenBuffer) { _screen->hideMouse(); memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000); @@ -1338,13 +1256,13 @@ void KyraEngine_v2::backUpPage0() { } } -void KyraEngine_v2::restorePage0() { +void KyraEngine_HoF::restorePage0() { restorePage3(); if (_screenBuffer) _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer); } -void KyraEngine_v2::updateCharPal(int unk1) { +void KyraEngine_HoF::updateCharPal(int unk1) { static bool unkVar1 = false; if (!_useCharPal) @@ -1371,7 +1289,7 @@ void KyraEngine_v2::updateCharPal(int unk1) { } } -void KyraEngine_v2::setCharPalEntry(int entry, int value) { +void KyraEngine_HoF::setCharPalEntry(int entry, int value) { if (entry > 15 || entry < 1) entry = 1; if (value > 8 || value < 0) @@ -1381,7 +1299,7 @@ void KyraEngine_v2::setCharPalEntry(int entry, int value) { _charPalEntry = 0; } -int KyraEngine_v2::inputSceneChange(int x, int y, int unk1, int unk2) { +int KyraEngine_HoF::inputSceneChange(int x, int y, int unk1, int unk2) { bool refreshNPC = false; uint16 curScene = _mainCharacter.sceneId; _pathfinderFlag = 15; @@ -1480,14 +1398,7 @@ int KyraEngine_v2::inputSceneChange(int x, int y, int unk1, int unk2) { return refreshNPC; } -bool KyraEngine_v2::checkSpecialSceneExit(int num, int x, int y) { - if (_specialExitTable[0+num] > x || _specialExitTable[5+num] > y || - _specialExitTable[10+num] < x || _specialExitTable[15+num] < y) - return 0; - return 1; -} - -void KyraEngine_v2::moveCharacter(int facing, int x, int y) { +void KyraEngine_HoF::moveCharacter(int facing, int x, int y) { _mainCharacter.facing = facing; x &= ~3; y &= ~1; @@ -1521,7 +1432,7 @@ void KyraEngine_v2::moveCharacter(int facing, int x, int y) { _screen->showMouse(); } -int KyraEngine_v2::updateCharPos(int *table) { +int KyraEngine_HoF::updateCharPos(int *table) { static uint32 nextUpdate = 0; static const int updateX[] = { 0, 4, 4, 4, 0, -4, -4, -4 }; static const int updateY[] = { -2, -2, 0, 2, 2, 2, 0, -2 }; @@ -1537,12 +1448,12 @@ int KyraEngine_v2::updateCharPos(int *table) { return 1; } -void KyraEngine_v2::updateCharPosWithUpdate() { +void KyraEngine_HoF::updateCharPosWithUpdate() { updateCharPos(0); update(); } -void KyraEngine_v2::updateCharAnimFrame(int charId, int *table) { +void KyraEngine_HoF::updateCharAnimFrame(int charId, int *table) { static int unkTable1[] = { 0, 0 }; static const int unkTable2[] = { 17, 0 }; static const int unkTable3[] = { 10, 0 }; @@ -1607,7 +1518,7 @@ void KyraEngine_v2::updateCharAnimFrame(int charId, int *table) { updateCharacterAnim(charId); } -int KyraEngine_v2::checkCharCollision(int x, int y) { +int KyraEngine_HoF::checkCharCollision(int x, int y) { int scale1 = 0, scale2 = 0, scale3 = 0; int x1 = 0, x2 = 0, y1 = 0, y2 = 0; scale1 = getScale(_mainCharacter.x1, _mainCharacter.y1); @@ -1625,10 +1536,10 @@ int KyraEngine_v2::checkCharCollision(int x, int y) { return -1; } -int KyraEngine_v2::initNewShapes(uint8 *filedata) { +int KyraEngine_HoF::initNewShapes(uint8 *filedata) { const int lastEntry = MIN(_newShapeLastEntry, 31); for (int i = 0; i < lastEntry; ++i) { - _defaultShapeTable[33+i] = _screen->getPtrToShape(filedata, i); + addShapeToPool(filedata, i+33, i); ShapeDesc *desc = &_shapeDescTable[24+i]; desc->xAdd = _newShapeXAdd; desc->yAdd = _newShapeYAdd; @@ -1638,7 +1549,7 @@ int KyraEngine_v2::initNewShapes(uint8 *filedata) { return lastEntry; } -void KyraEngine_v2::processNewShapes(int allowSkip, int resetChar) { +void KyraEngine_HoF::processNewShapes(int allowSkip, int resetChar) { setCharacterAnimDim(_newShapeWidth, _newShapeHeight); _emc->init(&_temporaryScriptState, &_temporaryScriptData); @@ -1694,17 +1605,18 @@ void KyraEngine_v2::processNewShapes(int allowSkip, int resetChar) { resetCharacterAnimDim(); } -void KyraEngine_v2::resetNewShapes(int count, uint8 *filedata) { - Common::set_to(_defaultShapeTable+33, _defaultShapeTable+33+count, (uint8*)0); +void KyraEngine_HoF::resetNewShapes(int count, uint8 *filedata) { + for (int i = 0; i < count; ++i) + remShapeFromPool(i+33); delete [] filedata; setNextIdleAnimTimer(); } -void KyraEngine_v2::setNextIdleAnimTimer() { +void KyraEngine_HoF::setNextIdleAnimTimer() { _nextIdleAnim = _system->getMillis() + _rnd.getRandomNumberRng(10, 15) * 60 * _tickLength; } -void KyraEngine_v2::showIdleAnim() { +void KyraEngine_HoF::showIdleAnim() { static const uint8 scriptMinTable[] = { 0x00, 0x05, 0x07, 0x08, 0x00, 0x09, 0x0A, 0x0B, 0xFF, 0x00 }; @@ -1742,7 +1654,7 @@ void KyraEngine_v2::showIdleAnim() { } } -void KyraEngine_v2::runIdleScript(int script) { +void KyraEngine_HoF::runIdleScript(int script) { if (script < 0 || script >= 12) script = 0; @@ -1761,26 +1673,26 @@ void KyraEngine_v2::runIdleScript(int script) { #pragma mark - -void KyraEngine_v2::backUpGfxRect24x24(int x, int y) { +void KyraEngine_HoF::backUpGfxRect24x24(int x, int y) { _screen->copyRegionToBuffer(_screen->_curPage, x, y, 24, 24, _gfxBackUpRect); } -void KyraEngine_v2::restoreGfxRect24x24(int x, int y) { +void KyraEngine_HoF::restoreGfxRect24x24(int x, int y) { _screen->copyBlockToPage(_screen->_curPage, x, y, 24, 24, _gfxBackUpRect); } -void KyraEngine_v2::backUpGfxRect32x32(int x, int y) { +void KyraEngine_HoF::backUpGfxRect32x32(int x, int y) { _screen->copyRegionToBuffer(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect); } -void KyraEngine_v2::restoreGfxRect32x32(int x, int y) { +void KyraEngine_HoF::restoreGfxRect32x32(int x, int y) { _screen->copyBlockToPage(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect); } #pragma mark - -void KyraEngine_v2::openTalkFile(int newFile) { - debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::openTalkFile(%d)", newFile); +void KyraEngine_HoF::openTalkFile(int newFile) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::openTalkFile(%d)", newFile); char talkFilename[16]; if (_oldTalkFile > 0) { @@ -1800,8 +1712,8 @@ void KyraEngine_v2::openTalkFile(int newFile) { _oldTalkFile = newFile; } -void KyraEngine_v2::snd_playVoiceFile(int id) { - debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_playVoiceFile(%d)", id); +void KyraEngine_HoF::snd_playVoiceFile(int id) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::snd_playVoiceFile(%d)", id); char vocFile[9]; assert(id >= 0 && id <= 9999999); sprintf(vocFile, "%07d", id); @@ -1817,8 +1729,8 @@ void KyraEngine_v2::snd_playVoiceFile(int id) { } } -void KyraEngine_v2::snd_loadSoundFile(int id) { - debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_loadSoundFile(%d)", id); +void KyraEngine_HoF::snd_loadSoundFile(int id) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::snd_loadSoundFile(%d)", id); if (id < 0 || !_trackMap) return; @@ -1828,16 +1740,16 @@ void KyraEngine_v2::snd_loadSoundFile(int id) { _sound->loadSoundFile(file); } -void KyraEngine_v2::playVoice(int high, int low) { - debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::playVoice(%d, %d)", high, low); +void KyraEngine_HoF::playVoice(int high, int low) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::playVoice(%d, %d)", high, low); if (!_flags.isTalkie) return; int vocFile = high * 10000 + low * 10; snd_playVoiceFile(vocFile); } -void KyraEngine_v2::snd_playSoundEffect(int track, int volume) { - debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v2::snd_playSoundEffect(%d, %d)", track, volume); +void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) { + debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_HoF::snd_playSoundEffect(%d, %d)", track, volume); if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { if (track == 10) @@ -1860,7 +1772,7 @@ void KyraEngine_v2::snd_playSoundEffect(int track, int volume) { #pragma mark - -void KyraEngine_v2::loadInvWsa(const char *filename, int run, int delayTime, int page, int sfx, int sFrame, int flags) { +void KyraEngine_HoF::loadInvWsa(const char *filename, int run, int delayTime, int page, int sfx, int sFrame, int flags) { int wsaFlags = 1; if (flags) wsaFlags |= 2; @@ -1906,14 +1818,14 @@ void KyraEngine_v2::loadInvWsa(const char *filename, int run, int delayTime, int } } -void KyraEngine_v2::closeInvWsa() { +void KyraEngine_HoF::closeInvWsa() { _invWsa.wsa->close(); delete _invWsa.wsa; _invWsa.wsa = 0; _invWsa.running = false; } -void KyraEngine_v2::updateInvWsa() { +void KyraEngine_HoF::updateInvWsa() { if (!_invWsa.running || !_invWsa.wsa) return; @@ -1957,7 +1869,7 @@ void KyraEngine_v2::updateInvWsa() { } } -void KyraEngine_v2::displayInvWsaLastFrame() { +void KyraEngine_HoF::displayInvWsaLastFrame() { if (!_invWsa.wsa) return; @@ -1977,7 +1889,7 @@ void KyraEngine_v2::displayInvWsaLastFrame() { #pragma mark - -void KyraEngine_v2::setCauldronState(uint8 state, bool paletteFade) { +void KyraEngine_HoF::setCauldronState(uint8 state, bool paletteFade) { memcpy(_screen->getPalette(2), _screen->getPalette(0), 768); Common::SeekableReadStream *file = _res->getFileStream("_POTIONS.PAL"); if (!file) @@ -2002,17 +1914,17 @@ void KyraEngine_v2::setCauldronState(uint8 state, bool paletteFade) { // sub_27149(); } -void KyraEngine_v2::clearCauldronTable() { +void KyraEngine_HoF::clearCauldronTable() { Common::set_to(_cauldronTable, _cauldronTable+ARRAYSIZE(_cauldronTable), -1); } -void KyraEngine_v2::addFrontCauldronTable(int item) { +void KyraEngine_HoF::addFrontCauldronTable(int item) { for (int i = 23; i >= 0; --i) _cauldronTable[i+1] = _cauldronTable[i]; _cauldronTable[0] = item; } -void KyraEngine_v2::cauldronItemAnim(int item) { +void KyraEngine_HoF::cauldronItemAnim(int item) { const int x = 282; const int y = 135; const int mouseDstX = (x + 7) & (~1); @@ -2078,7 +1990,7 @@ void KyraEngine_v2::cauldronItemAnim(int item) { } } -bool KyraEngine_v2::updateCauldron() { +bool KyraEngine_HoF::updateCauldron() { for (int i = 0; i < 23; ++i) { const int16 *curStateTable = _cauldronStateTables[i]; if (*curStateTable == -2) @@ -2148,7 +2060,7 @@ bool KyraEngine_v2::updateCauldron() { return false; } -void KyraEngine_v2::cauldronRndPaletteFade() { +void KyraEngine_HoF::cauldronRndPaletteFade() { showMessage(0, 0xCF); int index = _rnd.getRandomNumberRng(0x0F, 0x16); Common::SeekableReadStream *file = _res->getFileStream("_POTIONS.PAL"); @@ -2164,12 +2076,12 @@ void KyraEngine_v2::cauldronRndPaletteFade() { _screen->fadePalette(_screen->getPalette(0), 0x1E, &_updateFunctor); } -void KyraEngine_v2::resetCauldronStateTable(int idx) { +void KyraEngine_HoF::resetCauldronStateTable(int idx) { for (int i = 0; i < 7; ++i) _cauldronStateTables[idx][i] = -2; } -bool KyraEngine_v2::addToCauldronStateTable(int data, int idx) { +bool KyraEngine_HoF::addToCauldronStateTable(int data, int idx) { for (int i = 0; i < 7; ++i) { if (_cauldronStateTables[idx][i] == -2) { _cauldronStateTables[idx][i] = data; @@ -2179,7 +2091,7 @@ bool KyraEngine_v2::addToCauldronStateTable(int data, int idx) { return false; } -void KyraEngine_v2::listItemsInCauldron() { +void KyraEngine_HoF::listItemsInCauldron() { int itemsInCauldron = 0; for (int i = 0; i < 25; ++i) { if (_cauldronTable[i] != -1) @@ -2225,7 +2137,7 @@ void KyraEngine_v2::listItemsInCauldron() { #pragma mark - -void KyraEngine_v2::dinoRide() { +void KyraEngine_HoF::dinoRide() { _mainCharX = _mainCharY = -1; setGameFlag(0x15A); @@ -2262,7 +2174,7 @@ void KyraEngine_v2::dinoRide() { #pragma mark - -void KyraEngine_v2::playTim(const char *filename) { +void KyraEngine_HoF::playTim(const char *filename) { TIM *tim = _tim->load(filename, &_timOpcodes); if (!tim) return; @@ -2282,7 +2194,7 @@ void KyraEngine_v2::playTim(const char *filename) { #pragma mark - -void KyraEngine_v2::registerDefaultSettings() { +void KyraEngine_HoF::registerDefaultSettings() { KyraEngine::registerDefaultSettings(); // Most settings already have sensible defaults. This one, however, is @@ -2290,7 +2202,7 @@ void KyraEngine_v2::registerDefaultSettings() { ConfMan.registerDefault("walkspeed", 5); } -void KyraEngine_v2::writeSettings() { +void KyraEngine_HoF::writeSettings() { ConfMan.setInt("talkspeed", ((_configTextspeed-2) * 255) / 95); switch (_lang) { @@ -2317,7 +2229,7 @@ void KyraEngine_v2::writeSettings() { KyraEngine::writeSettings(); } -void KyraEngine_v2::readSettings() { +void KyraEngine_HoF::readSettings() { int talkspeed = ConfMan.getInt("talkspeed"); _configTextspeed = (talkspeed*95)/255 + 2; KyraEngine::readSettings(); diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_mr.cpp index fd0b5b9e93..a3295f3f38 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -24,22 +24,23 @@ */ #include "kyra/kyra.h" -#include "kyra/kyra_v3.h" -#include "kyra/screen_v3.h" +#include "kyra/kyra_mr.h" +#include "kyra/screen_mr.h" #include "kyra/wsamovie.h" #include "kyra/sound.h" -#include "kyra/text_v3.h" +#include "kyra/text_mr.h" #include "kyra/vqa.h" #include "kyra/gui.h" #include "kyra/timer.h" #include "kyra/debugger.h" #include "kyra/gui_v3.h" +#include "kyra/resource.h" #include "common/system.h" #include "common/config-manager.h" namespace Kyra { -KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags) { +KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags) { _soundDigital = 0; _musicSoundChannel = -1; _menuAudioFile = "TITLE1.AUD"; @@ -53,7 +54,6 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi _interface = _interfaceCommandLine = 0; _costPalBuffer = 0; _animObjects = 0; - _sceneAnims = 0; memset(_sceneShapes, 0, sizeof(_sceneShapes)); memset(_sceneAnimMovie, 0, sizeof(_sceneAnimMovie)); _gfxBackUpRect = 0; @@ -94,8 +94,6 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi _unk4 = 0; _loadingState = false; _noStartupChat = false; - _lastProcessedSceneScript = 0; - _specialSceneScriptRunFlag = false; _pathfinderFlag = 0; _talkObjectList = 0; _chatText = 0; @@ -110,7 +108,6 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi _badConscienceShown = false; _currentChapter = 1; _deathHandler = -1; - _moveFacingTable = 0; _unkHandleSceneChangeFlag = false; memset(_sceneShapeDescs, 0, sizeof(_sceneShapeDescs)); _cnvFile = _dlgBuffer = 0; @@ -142,7 +139,7 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi _showOutro = false; } -KyraEngine_v3::~KyraEngine_v3() { +KyraEngine_MR::~KyraEngine_MR() { delete _screen; delete _soundDigital; @@ -157,7 +154,6 @@ KyraEngine_v3::~KyraEngine_v3() { delete [] _interfaceCommandLine; delete [] _costPalBuffer; delete [] _animObjects; - delete [] _sceneAnims; for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i) delete [] _sceneShapes[i]; @@ -180,7 +176,6 @@ KyraEngine_v3::~KyraEngine_v3() { delete [] _sceneStrings; delete [] _talkObjectList; - delete [] _moveFacingTable; for (Common::Array<const Opcode*>::iterator i = _opcodesTemporary.begin(); i != _opcodesTemporary.end(); ++i) delete *i; @@ -200,8 +195,8 @@ KyraEngine_v3::~KyraEngine_v3() { delete _gui; } -int KyraEngine_v3::init() { - _screen = new Screen_v3(this, _system); +int KyraEngine_MR::init() { + _screen = new Screen_MR(this, _system); assert(_screen); _screen->setResolution(); @@ -214,7 +209,7 @@ int KyraEngine_v3::init() { assert(_soundDigital); if (!_soundDigital->init()) error("_soundDigital->init() failed"); - KyraEngine::_text = _text = new TextDisplayer_v3(this, _screen); + KyraEngine::_text = _text = new TextDisplayer_MR(this, _screen); assert(_text); _gui = new GUI_v3(this); assert(_gui); @@ -232,7 +227,7 @@ int KyraEngine_v3::init() { return 0; } -int KyraEngine_v3::go() { +int KyraEngine_MR::go() { bool running = true; preinit(); _screen->hideMouse(); @@ -305,7 +300,7 @@ int KyraEngine_v3::go() { return 0; } -void KyraEngine_v3::initMainMenu() { +void KyraEngine_MR::initMainMenu() { _menuAnim = new WSAMovieV2(this, _screen); _menuAnim->open("REVENGE.WSA", 1, _screen->getPalette(0)); _menuAnim->setX(0); @@ -330,15 +325,15 @@ void KyraEngine_v3::initMainMenu() { _menu->init(data, anim); } -void KyraEngine_v3::uninitMainMenu() { +void KyraEngine_MR::uninitMainMenu() { delete _menuAnim; _menuAnim = 0; delete _menu; _menu = 0; } -void KyraEngine_v3::playVQA(const char *name) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::playVQA('%s')", name); +void KyraEngine_MR::playVQA(const char *name) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::playVQA('%s')", name); VQAMovie vqa(this, _system); @@ -375,16 +370,16 @@ void KyraEngine_v3::playVQA(const char *name) { #pragma mark - -void KyraEngine_v3::playMenuAudioFile() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::playMenuAudioFile()"); +void KyraEngine_MR::playMenuAudioFile() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::playMenuAudioFile()"); if (_soundDigital->isPlaying(_musicSoundChannel)) return; _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType); } -void KyraEngine_v3::snd_playWanderScoreViaMap(int track, int force) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_playWanderScoreViaMap(%d, %d)", track, force); +void KyraEngine_MR::snd_playWanderScoreViaMap(int track, int force) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playWanderScoreViaMap(%d, %d)", track, force); // XXX byte_3C87C compare @@ -407,8 +402,8 @@ void KyraEngine_v3::snd_playWanderScoreViaMap(int track, int force) { _lastMusicCommand = track; } -void KyraEngine_v3::stopMusicTrack() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::stopMusicTrack()"); +void KyraEngine_MR::stopMusicTrack() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::stopMusicTrack()"); if (_musicSoundChannel != -1 && _soundDigital->isPlaying(_musicSoundChannel)) _soundDigital->stopSound(_musicSoundChannel); @@ -417,8 +412,8 @@ void KyraEngine_v3::stopMusicTrack() { _musicSoundChannel = -1; } -int KyraEngine_v3::musicUpdate(int forceRestart) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::musicUpdate(%d)", forceRestart); +int KyraEngine_MR::musicUpdate(int forceRestart) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::musicUpdate(%d)", forceRestart); static uint32 mTimer = 0; static uint16 lock = 0; @@ -444,8 +439,8 @@ int KyraEngine_v3::musicUpdate(int forceRestart) { return 1; } -void KyraEngine_v3::fadeOutMusic(int ticks) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::fadeOutMusic(%d)", ticks); +void KyraEngine_MR::fadeOutMusic(int ticks) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::fadeOutMusic(%d)", ticks); if (_musicSoundChannel >= 0) { _fadeOutMusicChannel = _musicSoundChannel; _soundDigital->beginFadeOut(_musicSoundChannel, ticks); @@ -453,8 +448,8 @@ void KyraEngine_v3::fadeOutMusic(int ticks) { } } -void KyraEngine_v3::snd_playSoundEffect(int item, int volume) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_playSoundEffect(%d, %d)", item, volume); +void KyraEngine_MR::snd_playSoundEffect(int item, int volume) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playSoundEffect(%d, %d)", item, volume); if (_sfxFileMap[item*2+0] != 0xFF) { char filename[16]; snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]); @@ -464,32 +459,32 @@ void KyraEngine_v3::snd_playSoundEffect(int item, int volume) { } } -void KyraEngine_v3::playVoice(int high, int low) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::playVoice(%d, %d)", high, low); +void KyraEngine_MR::playVoice(int high, int low) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::playVoice(%d, %d)", high, low); snd_playVoiceFile(high * 1000 + low); } -void KyraEngine_v3::snd_playVoiceFile(int file) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_playVoiceFile(%d)", file); +void KyraEngine_MR::snd_playVoiceFile(int file) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playVoiceFile(%d)", file); char filename[16]; snprintf(filename, 16, "%u.AUD", (uint)file); _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255); } -bool KyraEngine_v3::snd_voiceIsPlaying() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_voiceIsPlaying()"); +bool KyraEngine_MR::snd_voiceIsPlaying() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_voiceIsPlaying()"); return _soundDigital->isPlaying(_voiceSoundChannel); } -void KyraEngine_v3::snd_stopVoice() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::snd_stopVoice()"); +void KyraEngine_MR::snd_stopVoice() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_stopVoice()"); if (_voiceSoundChannel != -1) _soundDigital->stopSound(_voiceSoundChannel); } -void KyraEngine_v3::playStudioSFX(const char *str) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::playStudioSFX('%s')", str); +void KyraEngine_MR::playStudioSFX(const char *str) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::playStudioSFX('%s')", str); if (_rnd.getRandomNumberRng(1, 2) != 2) return; @@ -505,8 +500,8 @@ void KyraEngine_v3::playStudioSFX(const char *str) { #pragma mark - -void KyraEngine_v3::preinit() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::preinit()"); +void KyraEngine_MR::preinit() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::preinit()"); _itemBuffer1 = new int8[72]; _itemBuffer2 = new int8[144]; @@ -516,8 +511,8 @@ void KyraEngine_v3::preinit() { _screen->setMouseCursor(0, 0, _gameShapes[0]); } -void KyraEngine_v3::initMouseShapes() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::initMouseShapes()"); +void KyraEngine_MR::initMouseShapes() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::initMouseShapes()"); uint8 *data = _res->fileData("MOUSE.SHP", 0); assert(data); for (int i = 0; i <= 6; ++i) @@ -525,8 +520,8 @@ void KyraEngine_v3::initMouseShapes() { delete [] data; } -void KyraEngine_v3::startup() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::startup()"); +void KyraEngine_MR::startup() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::startup()"); musicUpdate(0); memset(_flagsTable, 0, sizeof(_flagsTable)); @@ -543,11 +538,9 @@ void KyraEngine_v3::startup() { _stringBuffer = new char[500]; //XXX musicUpdate(0); - _moveFacingTable = new int[600]; _costPalBuffer = new uint8[864]; //XXX _animObjects = new AnimObj[67]; - _sceneAnims = new SceneAnim[16]; musicUpdate(0); @@ -654,19 +647,19 @@ void KyraEngine_v3::startup() { //XXX } -void KyraEngine_v3::loadCostPal() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadCostPal()"); +void KyraEngine_MR::loadCostPal() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadCostPal()"); _costPalBuffer = _res->fileData("_COSTPAL.DAT", 0); } -void KyraEngine_v3::loadShadowShape() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadShadowShape()"); +void KyraEngine_MR::loadShadowShape() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadShadowShape()"); _screen->loadBitmap("SHADOW.CSH", 3, 3, 0); addShapeToPool(_screen->getCPagePtr(3), 421, 0); } -void KyraEngine_v3::loadExtrasShapes() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadExtrasShapes()"); +void KyraEngine_MR::loadExtrasShapes() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadExtrasShapes()"); _screen->loadBitmap("EXTRAS.CSH", 3, 3, 0); for (int i = 0; i < 20; ++i) addShapeToPool(_screen->getCPagePtr(3), i+433, i); @@ -674,22 +667,22 @@ void KyraEngine_v3::loadExtrasShapes() { addShapeToPool(_screen->getCPagePtr(3), 454, 21); } -void KyraEngine_v3::loadInterfaceShapes() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadInterfaceShapes()"); +void KyraEngine_MR::loadInterfaceShapes() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadInterfaceShapes()"); _screen->loadBitmap("INTRFACE.CSH", 3, 3, 0); for (int i = 422; i <= 432; ++i) addShapeToPool(_screen->getCPagePtr(3), i, i-422); } -void KyraEngine_v3::loadInterface() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadInterface()"); +void KyraEngine_MR::loadInterface() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadInterface()"); _screen->loadBitmap("INTRFACE.CPS", 3, 3, 0); memcpy(_interface, _screen->getCPagePtr(3), 17920); memcpy(_interfaceCommandLine, _screen->getCPagePtr(3), 3840); } -void KyraEngine_v3::initItems() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::initItems()"); +void KyraEngine_MR::initItems() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::initItems()"); _screen->loadBitmap("ITEMS.CSH", 3, 3, 0); @@ -714,8 +707,8 @@ void KyraEngine_v3::initItems() { _screen->_curPage = 0; } -void KyraEngine_v3::runStartupScript(int script, int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runStartupScript(%d, %d)", script, unk1); +void KyraEngine_MR::runStartupScript(int script, int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runStartupScript(%d, %d)", script, unk1); EMCState state; EMCData data; memset(&state, 0, sizeof(state)); @@ -735,8 +728,8 @@ void KyraEngine_v3::runStartupScript(int script, int unk1) { _emc->unload(&data); } -void KyraEngine_v3::openTalkFile(int file) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::openTalkFile(%d)", file); +void KyraEngine_MR::openTalkFile(int file) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::openTalkFile(%d)", file); char talkFilename[16]; if (file == 0) { @@ -755,27 +748,8 @@ void KyraEngine_v3::openTalkFile(int file) { #pragma mark - -void KyraEngine_v3::addShapeToPool(const uint8 *data, int realIndex, int shape) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::addShapeToPool(%p, %d, %d)", data, realIndex, shape); - ShapeMap::iterator iter = _gameShapes.find(realIndex); - if (iter != _gameShapes.end()) { - delete [] iter->_value; - iter->_value = 0; - } - _gameShapes[realIndex] = _screen->makeShapeCopy(data, shape); - assert(_gameShapes[realIndex]); -} - -uint8 *KyraEngine_v3::getShapePtr(int shape) const { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getShapePtr(%d)", shape); - ShapeMap::iterator iter = _gameShapes.find(shape); - if (iter == _gameShapes.end()) - return 0; - return iter->_value; -} - -void KyraEngine_v3::loadMalcolmShapes(int newShapes) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadMalcolmShapes(%d)", newShapes); +void KyraEngine_MR::loadMalcolmShapes(int newShapes) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadMalcolmShapes(%d)", newShapes); static const uint8 numberOffset[] = { 3, 3, 4, 4, 3, 3 }; static const uint8 startShape[] = { 0x32, 0x58, 0x78, 0x98, 0xB8, 0xD8 }; static const uint8 endShape[] = { 0x57, 0x77, 0x97, 0xB7, 0xD7, 0xF7 }; @@ -820,8 +794,8 @@ void KyraEngine_v3::loadMalcolmShapes(int newShapes) { updateMalcolmShapes(); } -void KyraEngine_v3::updateMalcolmShapes() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateMalcolmShapes()"); +void KyraEngine_MR::updateMalcolmShapes() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateMalcolmShapes()"); assert(_malcolmShapes >= 0 && _malcolmShapes < _shapeDescsSize); _malcolmShapeXOffset = _shapeDescs[_malcolmShapes].xOffset; _malcolmShapeYOffset = _shapeDescs[_malcolmShapes].yOffset; @@ -831,8 +805,8 @@ void KyraEngine_v3::updateMalcolmShapes() { #pragma mark - -void KyraEngine_v3::moveCharacter(int facing, int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::moveCharacter(%d, %d, %d)", facing, x, y); +void KyraEngine_MR::moveCharacter(int facing, int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::moveCharacter(%d, %d, %d)", facing, x, y); x &= ~3; y &= ~1; _mainCharacter.facing = facing; @@ -865,14 +839,14 @@ void KyraEngine_v3::moveCharacter(int facing, int x, int y) { _screen->showMouse(); } -void KyraEngine_v3::updateCharPosWithUpdate() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPosWithUpdate()"); +void KyraEngine_MR::updateCharPosWithUpdate() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPosWithUpdate()"); updateCharPos(0, 0); update(); } -int KyraEngine_v3::updateCharPos(int *table, int force) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPos(%p, %d)", (const void*)table, force); +int KyraEngine_MR::updateCharPos(int *table, int force) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPos(%p, %d)", (const void*)table, force); if (_updateCharPosNextUpdate > _system->getMillis() && !force) return 0; _mainCharacter.x1 += _updateCharPosXTable[_mainCharacter.facing]; @@ -882,8 +856,8 @@ int KyraEngine_v3::updateCharPos(int *table, int force) { return 1; } -void KyraEngine_v3::updateCharAnimFrame(int character, int *table) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPos(%d, %p)", character, (const void*)table); +void KyraEngine_MR::updateCharAnimFrame(int character, int *table) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPos(%d, %p)", character, (const void*)table); ++_mainCharacter.animFrame; int facing = _mainCharacter.facing; @@ -938,8 +912,8 @@ void KyraEngine_v3::updateCharAnimFrame(int character, int *table) { updateCharacterAnim(0); } -void KyraEngine_v3::updateCharPal(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateCharPal(%d)", unk1); +void KyraEngine_MR::updateCharPal(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateCharPal(%d)", unk1); int layer = _screen->getLayer(_mainCharacter.x1, _mainCharacter.y1) - 1; const uint8 *src = _costPalBuffer + _malcolmShapes * 72; uint8 *dst = _screen->getPalette(0) + 432; @@ -984,8 +958,8 @@ void KyraEngine_v3::updateCharPal(int unk1) { } } -bool KyraEngine_v3::checkCharCollision(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::checkCharCollision(%d, %d)", x, y); +bool KyraEngine_MR::checkCharCollision(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::checkCharCollision(%d, %d)", x, y); int scale = getScale(_mainCharacter.x1, _mainCharacter.y1); int width = (scale * 37) >> 8; @@ -1003,8 +977,8 @@ bool KyraEngine_v3::checkCharCollision(int x, int y) { #pragma mark - -void KyraEngine_v3::runLoop() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runLoop()"); +void KyraEngine_MR::runLoop() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runLoop()"); _runFlag = true; while (_runFlag && !_quitFlag) { @@ -1032,8 +1006,8 @@ void KyraEngine_v3::runLoop() { } } -void KyraEngine_v3::handleInput(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::handleInput(%d, %d)", x, y); +void KyraEngine_MR::handleInput(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::handleInput(%d, %d)", x, y); if (_inventoryState) return; setNextIdleAnimTimer(); @@ -1105,8 +1079,8 @@ void KyraEngine_v3::handleInput(int x, int y) { inputSceneChange(x, y, 1, 1); } -int KyraEngine_v3::inputSceneChange(int x, int y, int unk1, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::inputSceneChange(%d, %d, %d, %d)", x, y, unk1, unk2); +int KyraEngine_MR::inputSceneChange(int x, int y, int unk1, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::inputSceneChange(%d, %d, %d, %d)", x, y, unk1, unk2); uint16 curScene = _mainCharacter.sceneId; _pathfinderFlag = 15; @@ -1148,17 +1122,17 @@ int KyraEngine_v3::inputSceneChange(int x, int y, int unk1, int unk2) { x &= ~3; y &= ~1; - int size = findWay(x1, y1, x, y, _moveFacingTable, 600); + int size = findWay(x1, y1, x, y, _movFacingTable, 600); _pathfinderFlag = 0; if (!size || size == 0x7D00) return 0; - return trySceneChange(_moveFacingTable, unk1, unk2); + return trySceneChange(_movFacingTable, unk1, unk2); } -void KyraEngine_v3::update() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::update()"); +void KyraEngine_MR::update() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::update()"); updateInput(); musicUpdate(0); @@ -1173,8 +1147,8 @@ void KyraEngine_v3::update() { _screen->updateScreen(); } -void KyraEngine_v3::updateWithText() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::update()"); +void KyraEngine_MR::updateWithText() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::update()"); updateInput(); musicUpdate(0); @@ -1197,8 +1171,8 @@ void KyraEngine_v3::updateWithText() { _screen->updateScreen(); } -void KyraEngine_v3::updateMouse() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateMouse()"); +void KyraEngine_MR::updateMouse() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateMouse()"); int shape = 0, offsetX = 0, offsetY = 0; Common::Point mouse = getMousePos(); bool hasItemCollision = checkItemCollision(mouse.x, mouse.y) != -1; @@ -1316,8 +1290,8 @@ void KyraEngine_v3::updateMouse() { } } -void KyraEngine_v3::delay(uint32 millis, bool doUpdate, bool isMainLoop) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::delay(%d, %d, %d)", millis, doUpdate, isMainLoop); +void KyraEngine_MR::delay(uint32 millis, bool doUpdate, bool isMainLoop) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::delay(%d, %d, %d)", millis, doUpdate, isMainLoop); uint32 endTime = _system->getMillis() + millis; while (endTime > _system->getMillis()) { if (doUpdate) { @@ -1331,42 +1305,8 @@ void KyraEngine_v3::delay(uint32 millis, bool doUpdate, bool isMainLoop) { #pragma mark - -void KyraEngine_v3::updateInput() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateInput()"); - Common::Event event; - - while (_eventMan->pollEvent(event)) { - switch (event.type) { - case Common::EVENT_QUIT: - _quitFlag = true; - break; - - case Common::EVENT_KEYDOWN: - if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE) - _eventList.push_back(Event(event, true)); - else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL) - _quitFlag = true; - else - _eventList.push_back(event); - break; - - case Common::EVENT_LBUTTONDOWN: - _eventList.push_back(Event(event, true)); - break; - - case Common::EVENT_LBUTTONUP: - case Common::EVENT_MOUSEMOVE: - _eventList.push_back(event); - break; - - default: - break; - } - } -} - -int KyraEngine_v3::checkInput(Button *buttonList, bool mainLoop) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::checkInput(%p, %d)", (const void*)buttonList, mainLoop); +int KyraEngine_MR::checkInput(Button *buttonList, bool mainLoop) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::checkInput(%p, %d)", (const void*)buttonList, mainLoop); updateInput(); int keys = 0; @@ -1428,36 +1368,8 @@ int KyraEngine_v3::checkInput(Button *buttonList, bool mainLoop) { return _gui->processButtonList(buttonList, keys | 0x8000); } -void KyraEngine_v3::removeInputTop() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::removeInputTop()"); - if (!_eventList.empty()) - _eventList.erase(_eventList.begin()); -} - -bool KyraEngine_v3::skipFlag() const { - debugC(9, kDebugLevelMain, "KyraEngine_v3::skipFlag()"); - for (Common::List<Event>::const_iterator i = _eventList.begin(); i != _eventList.end(); ++i) { - if (i->causedSkip) - return true; - } - return false; -} - -void KyraEngine_v3::resetSkipFlag(bool removeEvent) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::resetSkipFlag(%d)", removeEvent); - for (Common::List<Event>::iterator i = _eventList.begin(); i != _eventList.end(); ++i) { - if (i->causedSkip) { - if (removeEvent) - _eventList.erase(i); - else - i->causedSkip = false; - return; - } - } -} - -void KyraEngine_v3::makeCharFacingMouse() { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::makeCharFacingMouse()"); +void KyraEngine_MR::makeCharFacingMouse() { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::makeCharFacingMouse()"); if (_mainCharacter.x1 > _mouseX) _mainCharacter.facing = 5; else @@ -1469,34 +1381,34 @@ void KyraEngine_v3::makeCharFacingMouse() { #pragma mark - -int KyraEngine_v3::getDrawLayer(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getDrawLayer(%d, %d)", x, y); +int KyraEngine_MR::getDrawLayer(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getDrawLayer(%d, %d)", x, y); int layer = _screen->getLayer(x, y) - 1; layer = _sceneDatLayerTable[layer]; return MAX(0, MIN(layer, 6)); } -int KyraEngine_v3::getScale(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getScale(%d, %d)", x, y); +int KyraEngine_MR::getScale(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getScale(%d, %d)", x, y); return _scaleTable[_screen->getLayer(x, y) - 1]; } #pragma mark - -void KyraEngine_v3::backUpGfxRect32x32(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::backUpGfxRect32x32(%d, %d)", x, y); +void KyraEngine_MR::backUpGfxRect32x32(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::backUpGfxRect32x32(%d, %d)", x, y); _screen->copyRegionToBuffer(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect); } -void KyraEngine_v3::restoreGfxRect32x32(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::restoreGfxRect32x32(%d, %d)", x, y); +void KyraEngine_MR::restoreGfxRect32x32(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::restoreGfxRect32x32(%d, %d)", x, y); _screen->copyBlockToPage(_screen->_curPage, x, y, 32, 32, _gfxBackUpRect); } #pragma mark - -char *KyraEngine_v3::appendLanguage(char *buf, int lang, int bufSize) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::appendLanguage([%p|'%s'], %d, %d)", (const void*)buf, buf, lang, bufSize); +char *KyraEngine_MR::appendLanguage(char *buf, int lang, int bufSize) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::appendLanguage([%p|'%s'], %d, %d)", (const void*)buf, buf, lang, bufSize); assert(lang < _languageExtensionSize); int size = strlen(buf) + strlen(_languageExtension[lang]); @@ -1514,8 +1426,8 @@ char *KyraEngine_v3::appendLanguage(char *buf, int lang, int bufSize) { return buf; } -int KyraEngine_v3::loadLanguageFile(const char *file, uint8 *&buffer) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadLanguageFile('%s', %p)", file, (const void*)buffer); +int KyraEngine_MR::loadLanguageFile(const char *file, uint8 *&buffer) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadLanguageFile('%s', %p)", file, (const void*)buffer); uint32 size = 0; char nBuf[32]; @@ -1525,8 +1437,8 @@ int KyraEngine_v3::loadLanguageFile(const char *file, uint8 *&buffer) { return buffer ? size : 0 ; } -uint8 *KyraEngine_v3::getTableEntry(uint8 *buffer, int id) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getTableEntry(%p, %d)", (const void*)buffer, id); +uint8 *KyraEngine_MR::getTableEntry(uint8 *buffer, int id) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getTableEntry(%p, %d)", (const void*)buffer, id); uint16 tableEntries = READ_LE_UINT16(buffer); const uint16 *indexTable = (const uint16*)(buffer + 2); const uint16 *offsetTable = indexTable + tableEntries; @@ -1540,8 +1452,8 @@ uint8 *KyraEngine_v3::getTableEntry(uint8 *buffer, int id) { return buffer + READ_LE_UINT16(offsetTable + num); } -void KyraEngine_v3::getTableEntry(Common::SeekableReadStream *stream, int id, char *dst) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::getTableEntry(%p, %d, %p)", (const void*)stream, id, (const void*)dst); +void KyraEngine_MR::getTableEntry(Common::SeekableReadStream *stream, int id, char *dst) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::getTableEntry(%p, %d, %p)", (const void*)stream, id, (const void*)dst); stream->seek(0, SEEK_SET); uint16 tableEntries = stream->readUint16LE(); @@ -1559,8 +1471,8 @@ void KyraEngine_v3::getTableEntry(Common::SeekableReadStream *stream, int id, ch #pragma mark - -bool KyraEngine_v3::talkObjectsInCurScene() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::talkObjectsInCurScene()"); +bool KyraEngine_MR::talkObjectsInCurScene() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::talkObjectsInCurScene()"); for (int i = 0; i < 88; ++i) { if (_talkObjectList[i].sceneId == _mainCharacter.sceneId) @@ -1572,8 +1484,8 @@ bool KyraEngine_v3::talkObjectsInCurScene() { #pragma mark - -bool KyraEngine_v3::updateScore(int scoreId, int strId) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateScore(%d, %d)", scoreId, strId); +bool KyraEngine_MR::updateScore(int scoreId, int strId) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateScore(%d, %d)", scoreId, strId); int scoreIndex = (scoreId >> 3); int scoreBit = scoreId & 7; @@ -1598,8 +1510,8 @@ bool KyraEngine_v3::updateScore(int scoreId, int strId) { return true; } -void KyraEngine_v3::scoreIncrease(int count, const char *str) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::scoreIncrease(%d, '%s')", count, str); +void KyraEngine_MR::scoreIncrease(int count, const char *str) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::scoreIncrease(%d, '%s')", count, str); int drawOld = 1; _screen->hideMouse(); @@ -1630,8 +1542,8 @@ void KyraEngine_v3::scoreIncrease(int count, const char *str) { #pragma mark - -void KyraEngine_v3::changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::changeChapter(%d, %d, %d, %d)", newChapter, sceneId, malcolmShapes, facing); +void KyraEngine_MR::changeChapter(int newChapter, int sceneId, int malcolmShapes, int facing) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::changeChapter(%d, %d, %d, %d)", newChapter, sceneId, malcolmShapes, facing); resetItemList(); _currentChapter = newChapter; diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_mr.h index c666f25eba..e166998bc8 100644 --- a/engines/kyra/kyra_v3.h +++ b/engines/kyra/kyra_mr.h @@ -26,8 +26,8 @@ #ifndef KYRA_KYRA_V3_H #define KYRA_KYRA_V3_H -#include "kyra/kyra.h" -#include "kyra/screen_v3.h" +#include "kyra/kyra_v2.h" +#include "kyra/screen_mr.h" #include "kyra/script.h" #include "common/hashmap.h" @@ -36,23 +36,24 @@ namespace Kyra { class SoundDigital; -class Screen_v3; +class Screen_MR; class MainMenu; class WSAMovieV2; -class TextDisplayer_v3; +class TextDisplayer_MR; class Debugger_v3; class GUI_v3; struct Button; -class KyraEngine_v3 : public KyraEngine { +class KyraEngine_MR : public KyraEngine_v2 { friend class Debugger_v3; -friend class TextDisplayer_v3; +friend class TextDisplayer_MR; friend class GUI_v3; public: - KyraEngine_v3(OSystem *system, const GameFlags &flags); - ~KyraEngine_v3(); + KyraEngine_MR(OSystem *system, const GameFlags &flags); + ~KyraEngine_MR(); Screen *screen() { return _screen; } + Screen_v2 *screen_v2() const { return _screen; } SoundDigital *soundDigital() { return _soundDigital; } int language() const { return _lang; } @@ -60,8 +61,12 @@ public: void playVQA(const char *name); -private: - Screen_v3 *_screen; +protected: + // KyraEngine_v2 API + int getFirstSpecialSceneScript() const { return 9; } + + // -- + Screen_MR *_screen; SoundDigital *_soundDigital; int init(); @@ -89,27 +94,7 @@ private: void delay(uint32 millis, bool update = false, bool isMainLoop = false); // - Input - void updateInput(); int checkInput(Button *buttonList, bool mainLoop = false); - void removeInputTop(); - - int _mouseX, _mouseY; - int _mouseState; - - struct Event { - Common::Event event; - bool causedSkip; - - Event() : event(), causedSkip(false) {} - Event(Common::Event e) : event(e), causedSkip(false) {} - Event(Common::Event e, bool skip) : event(e), causedSkip(skip) {} - - operator Common::Event() const { return event; } - }; - Common::List<Event> _eventList; - - bool skipFlag() const; - void resetSkipFlag(bool removeEvent = true); // sound specific private: @@ -164,7 +149,6 @@ private: void uninitMainMenu(); WSAMovieV2 *_menuAnim; - MainMenu *_menu; // timer void setupTimers(); @@ -180,10 +164,6 @@ private: void setNextIdleAnimTimer(); // pathfinder - int *_moveFacingTable; - int _pathfinderFlag; - - int findWay(int x1, int y1, int x2, int y2, int *moveTable, int moveTableSize); bool lineIsPassable(int x, int y); private: @@ -191,50 +171,20 @@ private: static const char *_mainMenuStrings[]; // animator - struct AnimObj { - uint16 index; - uint16 type; - bool enabled; - bool needRefresh; - uint16 unk8; - uint16 flags; - int16 xPos1, yPos1; - uint8 *shapePtr; - uint16 shapeIndex; - uint16 animNum; - uint16 shapeIndex3; - uint16 shapeIndex2; - int16 xPos2, yPos2; - int16 xPos3, yPos3; - int16 width, height; - int16 width2, height2; - uint16 palette; - AnimObj *nextObject; - }; + uint8 *_gamePlayBuffer; + void restorePage3(); AnimObj *_animObjects; - uint8 *_gamePlayBuffer; void clearAnimObjects(); - AnimObj *_animList; - bool _drawNoShapeFlag; - AnimObj *initAnimList(AnimObj *list, AnimObj *entry); - AnimObj *addToAnimListSorted(AnimObj *list, AnimObj *entry); - AnimObj *deleteAnimListEntry(AnimObj *list, AnimObj *entry); - void animSetupPaletteEntry(AnimObj *anim); - void restorePage3(); - void drawAnimObjects(); void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer); void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer); void refreshAnimObjects(int force); - void refreshAnimObjectsIfNeed(); - - void flagAnimObjsForRefresh(); bool _loadingState; void updateCharacterAnim(int charId); @@ -369,12 +319,6 @@ private: int _handItemSet; // shapes - typedef Common::HashMap<int, uint8*> ShapeMap; - ShapeMap _gameShapes; - - void addShapeToPool(const uint8 *data, int realIndex, int shape); - uint8 *getShapePtr(int shape) const; - void initMouseShapes(); int _malcolmShapes; @@ -391,50 +335,15 @@ private: static const int _shapeDescsSize; // scene animation - struct SceneAnim { - uint16 flags; - int16 x, y; - int16 x2, y2; - int16 width, height; - uint16 unk10; - uint16 specialSize; - uint16 unk14; - uint16 shapeIndex; - uint16 wsaFlag; - char filename[13]; - }; - - SceneAnim *_sceneAnims; - WSAMovieV2 *_sceneAnimMovie[16]; uint8 *_sceneShapes[20]; void freeSceneShapes(); - void freeSceneAnims(); // voice int _currentTalkFile; void openTalkFile(int file); // scene - struct SceneDesc { - char filename1[10]; - char filename2[10]; - uint16 exit1, exit2, exit3, exit4; - uint8 flags, sound; - }; - - SceneDesc *_sceneList; - int _sceneListSize; - uint16 _sceneExit1, _sceneExit2, _sceneExit3, _sceneExit4; - int _sceneEnterX1, _sceneEnterY1; - int _sceneEnterX2, _sceneEnterY2; - int _sceneEnterX3, _sceneEnterY3; - int _sceneEnterX4, _sceneEnterY4; - - int _specialExitCount; - uint16 _specialExitTable[25]; - bool checkSpecialSceneExit(int index, int x, int y); - bool _noScriptEnter; void enterNewScene(uint16 scene, int facing, int unk1, int unk2, int unk3); void enterNewSceneUnk1(int facing, int unk1, int unk2); @@ -462,15 +371,6 @@ private: EMCState _sceneScriptState; EMCData _sceneScriptData; - bool _specialSceneScriptState[10]; - bool _specialSceneScriptStateBackup[10]; - EMCState _sceneSpecialScripts[10]; - uint32 _sceneSpecialScriptsTimer[10]; - int _lastProcessedSceneScript; - bool _specialSceneScriptRunFlag; - - void updateSpecialSceneScripts(); - int trySceneChange(int *moveTable, int unk1, int unk2); int checkSceneChange(); @@ -813,7 +713,7 @@ private: int o3_dummy(EMCState *script); // misc - TextDisplayer_v3 *_text; + TextDisplayer_MR *_text; Debugger_v3 *_debugger; bool _wsaPlayingVQA; diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h deleted file mode 100644 index 7cd1f609dd..0000000000 --- a/engines/kyra/kyra_v2.h +++ /dev/null @@ -1,1166 +0,0 @@ -/* 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. - * - * 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 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef KYRA_KYRA_V2_H -#define KYRA_KYRA_V2_H - -#include "kyra/kyra.h" -#include "kyra/script.h" -#include "kyra/script_tim.h" -#include "kyra/screen_v2.h" -#include "kyra/text_v2.h" -#include "kyra/gui_v2.h" - -#include "common/list.h" -#include "common/func.h" - -namespace Kyra { - -enum kSequences { - kSequenceVirgin = 0, - kSequenceWestwood, - kSequenceTitle, - kSequenceOverview, - kSequenceLibrary, - kSequenceHand, - kSequencePoint, - kSequenceZanfaun, - - kSequenceFunters, - kSequenceFerb, - kSequenceFish, - kSequenceFheep, - kSequenceFarmer, - kSequenceFuards, - kSequenceFirates, - kSequenceFrash, - - kSequenceArraySize -}; - -enum kNestedSequences { - kSequenceFiggle = 0, - kSequenceOver1, - kSequenceOver2, - kSequenceForest, - kSequenceDragon, - kSequenceDarm, - kSequenceLibrary2, - kSequenceLibrary3, - kSequenceMarco, - kSequenceHand1a, - kSequenceHand1b, - kSequenceHand1c, - kSequenceHand2, - kSequenceHand3, - kSequenceHand4 -}; - -enum kSequencesDemo { - kSequenceDemoVirgin = 0, - kSequenceDemoWestwood, - kSequenceDemoTitle, - kSequenceDemoHill, - kSequenceDemoOuthome, - kSequenceDemoWharf, - kSequenceDemoDinob, - kSequenceDemoFisher -}; - -enum kNestedSequencesDemo { - kSequenceDemoWharf2 = 0, - kSequenceDemoDinob2, - kSequenceDemoWater, - kSequenceDemoBail, - kSequenceDemoDig -}; - -class WSAMovieV2; -class KyraEngine_v2; -class TextDisplayer_v2; -class Debugger_v2; - -struct TIM; - -typedef int (KyraEngine_v2::*SeqProc)(WSAMovieV2*, int, int, int); - -struct FrameControl { - uint16 index; - uint16 delay; -}; - -struct ActiveWSA { - int16 flags; - WSAMovieV2 *movie; - uint16 startFrame; - uint16 endFrame; - uint16 frameDelay; - SeqProc callback; - uint32 nextFrame; - uint16 currentFrame; - uint16 lastFrame; - uint16 x; - uint16 y; - const FrameControl *control; - uint16 startupCommand; - uint16 finalCommand; -}; - -struct ActiveText { - uint16 strIndex; - uint16 x; - uint16 y; - int duration; - uint16 width; - uint32 startTime; - int16 textcolor; -}; - -struct Sequence { - uint16 flags; - const char * wsaFile; - const char * cpsFile; - uint8 startupCommand; - uint8 finalCommand; - int16 stringIndex1; - int16 stringIndex2; - uint16 startFrame; - uint16 numFrames; - uint16 frameDelay; - uint16 xPos; - uint16 yPos; - uint16 duration; -}; - -struct NestedSequence { - uint16 flags; - const char * wsaFile; - uint16 startframe; - uint16 endFrame; - uint16 frameDelay; - uint16 x; - uint16 y; - const FrameControl *wsaControl; - uint16 startupCommand; - uint16 finalCommand; -}; - -struct HofSeqData { - const Sequence *seq; - int numSeq; - const NestedSequence *seqn; - int numSeqn; -}; - -struct ItemAnimData_v1 { - int16 itemIndex; - uint16 y; - const uint16 *frames; -}; - -struct ItemAnimData_v2 { - int16 itemIndex; - uint8 numFrames; - const FrameControl *frames; -}; - -struct ActiveItemAnim { - uint16 currentFrame; - uint32 nextFrame; -}; - -class KyraEngine_v2 : public KyraEngine { -friend class Debugger_v2; -friend class TextDisplayer_v2; -friend class GUI_v2; -public: - KyraEngine_v2(OSystem *system, const GameFlags &flags); - ~KyraEngine_v2(); - - virtual Screen *screen() { return _screen; } - Screen_v2 *screen_v2() { return _screen; } - virtual TextDisplayer *text() { return _text; } - int language() const { return _lang; } -protected: - // intro/outro - void seq_playSequences(int startSeq, int endSeq = -1); - - int seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm); - - int seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm); - - int seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm); - - int seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm); - - int seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm); - - int seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm); - int seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm); - - void seq_sequenceCommand(int command); - void seq_loadNestedSequence(int wsaNum, int seqNum); - void seq_nestedSequenceFrame(int command, int wsaNum); - void seq_animatedSubFrame(int srcPage, int dstPage, int delaytime, - int steps, int x, int y, int w, int h, int openClose, int directionFlags); - bool seq_processNextSubFrame(int wsaNum); - void seq_resetActiveWSA(int wsaNum); - void seq_unloadWSA(int wsaNum); - void seq_processWSAs(); - void seq_cmpFadeFrame(const char *cmpFile); - void seq_playTalkText(uint8 chatNum); - void seq_resetAllTextEntries(); - uint32 seq_activeTextsTimeLeft(); - void seq_waitForTextsTimeout(); - int seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width); - void seq_processText(); - char *seq_preprocessString(const char *str, int width); - void seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor); - void seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, - WSAMovieV2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos); - void seq_finaleActorScreen(); - void seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = 0, const char *const *specialData = 0); - void seq_scrollPage(); - void seq_showStarcraftLogo(); - - void seq_init(); - void seq_uninit(); - - int init(); - int go(); - - Screen_v2 *_screen; - TextDisplayer_v2 *_text; - Debugger_v2 *_debugger; - TIMInterpreter *_tim; - - uint8 *_mouseSHPBuf; - - static const int8 _dosTrackMap[]; - static const int _dosTrackMapSize; - - const AudioDataStruct *_soundData; - -protected: - // game initialization - void startup(); - void runLoop(); - void cleanup(); - - void registerDefaultSettings(); - void writeSettings(); - void readSettings(); - uint8 _configTextspeed; - - // TODO: get rid of all variables having pointers to the static resources if possible - // i.e. let them directly use the _staticres functions - void initStaticResource(); - - void setupTimers(); - void setupOpcodeTable(); - - void loadMouseShapes(); - void loadItemShapes(); - - // run - MainMenu *_menu; - - bool _runFlag; - bool _showCredits; - - void update(); - void updateWithText(); - - Common::Functor0Mem<void, KyraEngine_v2> _updateFunctor; - - void updateMouse(); - - void dinoRide(); - - int checkInput(Button *buttonList, bool mainLoop = false); - void removeInputTop(); - void handleInput(int x, int y); - bool handleInputUnkSub(int x, int y); - - int inputSceneChange(int x, int y, int unk1, int unk2); - - // - Input - void updateInput(); - - int _mouseX, _mouseY; - int _mouseState; - - struct Event { - Common::Event event; - bool causedSkip; - - Event() : event(), causedSkip(false) {} - Event(Common::Event e) : event(e), causedSkip(false) {} - Event(Common::Event e, bool skip) : event(e), causedSkip(skip) {} - - operator Common::Event() const { return event; } - }; - Common::List<Event> _eventList; - - bool skipFlag() const; - void resetSkipFlag(bool removeEvent = true); - - // gfx/animation specific - uint8 *_gamePlayBuffer; - void restorePage3(); - - uint8 *_screenBuffer; - bool _inventorySaved; - void backUpPage0(); - void restorePage0(); - - uint8 *_gfxBackUpRect; - - void backUpGfxRect24x24(int x, int y); - void restoreGfxRect24x24(int x, int y); - void backUpGfxRect32x32(int x, int y); - void restoreGfxRect32x32(int x, int y); - - uint8 *getShapePtr(int index) { return _defaultShapeTable[index]; } - uint8 *_defaultShapeTable[250]; - uint8 *_sceneShapeTable[50]; - - WSAMovieV2 *_wsaSlots[10]; - - void freeSceneShapePtrs(); - - struct ShapeDesc { - uint8 unk0, unk1, unk2, unk3, unk4; - uint16 width, height; - int16 xAdd, yAdd; - }; - - ShapeDesc *_shapeDescTable; - - struct SceneAnim { - uint16 flags; - int16 x, y; - int16 x2, y2; - int16 width, height; - uint16 unkE; - uint16 specialSize; - uint16 unk12; - int16 shapeIndex; - uint16 wsaFlag; - char filename[14]; - }; - - SceneAnim _sceneAnims[10]; - WSAMovieV2 *_sceneAnimMovie[10]; - bool _specialSceneScriptState[10]; - bool _specialSceneScriptStateBackup[10]; - EMCState _sceneSpecialScripts[10]; - uint32 _sceneSpecialScriptsTimer[10]; - int _lastProcessedSceneScript; - bool _specialSceneScriptRunFlag; - - void updateSpecialSceneScripts(); - void freeSceneAnims(); - - int _loadedZTable; - void loadZShapes(int shapes); - void loadInventoryShapes(); - - void resetScaleTable(); - void setScaleTableItem(int item, int data); - int getScale(int x, int y); - uint16 _scaleTable[15]; - - void setDrawLayerTableEntry(int entry, int data); - int getDrawLayer(int x, int y); - int _drawLayerTable[15]; - - int _layerFlagTable[16]; // seems to indicate layers where items get destroyed when dropped to (TODO: check this!) - - char _newShapeFilename[13]; - int _newShapeLastEntry; - int _newShapeWidth, _newShapeHeight; - int _newShapeXAdd, _newShapeYAdd; - int _newShapeFlag; - uint8 *_newShapeFiledata; - int _newShapeCount; - int _newShapeAnimFrame; - int _newShapeDelay; - - int initNewShapes(uint8 *filedata); - void processNewShapes(int allowSkip, int resetChar); - void resetNewShapes(int count, uint8 *filedata); - - // animator - struct AnimObj { - uint16 index; - uint16 type; - uint16 enabled; - uint16 needRefresh; - uint16 unk8; - uint16 animFlags; - uint16 flags; - int16 xPos1, yPos1; - uint8 *shapePtr; - uint16 shapeIndex1; - uint16 animNum; - uint16 shapeIndex3; - uint16 shapeIndex2; - uint16 unk1E; - uint8 unk20; - uint8 unk21; - uint8 unk22; - uint8 unk23; - int16 xPos2, yPos2; - int16 xPos3, yPos3; - int16 width, height; - int16 width2, height2; - AnimObj *nextObject; - }; - - AnimObj _animObjects[42]; - void clearAnimObjects(); - - AnimObj *_animList; - bool _drawNoShapeFlag; - AnimObj *initAnimList(AnimObj *list, AnimObj *entry); - AnimObj *addToAnimListSorted(AnimObj *list, AnimObj *entry); - AnimObj *deleteAnimListEntry(AnimObj *list, AnimObj *entry); - - void drawAnimObjects(); - void drawSceneAnimObject(AnimObj *obj, int x, int y, int drawLayer); - void drawCharacterAnimObject(AnimObj *obj, int x, int y, int drawLayer); - - void refreshAnimObjects(int force); - void refreshAnimObjectsIfNeed(); - void updateItemAnimations(); - - void flagAnimObjsUnk8(); - void flagAnimObjsForRefresh(); - - void updateCharFacing(); - void updateCharacterAnim(int); - void updateSceneAnim(int anim, int newFrame); - - void addItemToAnimList(int item); - void deleteItemAnimEntry(int item); - - int _animObj0Width, _animObj0Height; - void setCharacterAnimDim(int w, int h); - void resetCharacterAnimDim(); - - // scene - struct SceneDesc { - char filename[10]; - uint16 exit1, exit2, exit3, exit4; - uint8 flags; - uint8 sound; - }; - - SceneDesc *_sceneList; - int _sceneListSize; - uint16 _currentScene; - - const char *_sceneCommentString; - uint16 _sceneExit1, _sceneExit2, _sceneExit3, _sceneExit4; - int _sceneEnterX1, _sceneEnterY1, _sceneEnterX2, _sceneEnterY2, - _sceneEnterX3, _sceneEnterY3, _sceneEnterX4, _sceneEnterY4; - int _specialExitCount; - uint16 _specialExitTable[25]; - bool checkSpecialSceneExit(int num, int x, int y); - uint8 _scenePal[688]; - bool _overwriteSceneFacing; - - void enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3); - void enterNewSceneUnk1(int facing, int unk1, int unk2); - void enterNewSceneUnk2(int unk1); - void unloadScene(); - - void loadScenePal(); - void loadSceneMsc(); - - void fadeScenePal(int srcIndex, int delay); - - void startSceneScript(int unk1); - void runSceneScript2(); - void runSceneScript4(int unk1); - void runSceneScript6(); - void runSceneScript7(); - - void initSceneAnims(int unk1); - void initSceneScreen(int unk1); - - int trySceneChange(int *moveTable, int unk1, int updateChar); - int checkSceneChange(); - - // pathfinder - int _movFacingTable[600]; - int findWay(int curX, int curY, int dstX, int dstY, int *moveTable, int moveTableSize); - bool lineIsPassable(int x, int y); - bool directLinePassable(int x, int y, int toX, int toY); - - int pathfinderInitPositionTable(int *moveTable); - int pathfinderAddToPositionTable(int index, int v1, int v2); - int pathfinderInitPositionIndexTable(int tableLen, int x, int y); - int pathfinderAddToPositionIndexTable(int index, int v); - void pathfinderFinializePath(int *moveTable, int unk1, int x, int y, int moveTableSize); - - int _pathfinderPositionTable[400]; - int _pathfinderPositionIndexTable[200]; - - // item - uint8 _itemHtDat[176]; - - struct Item { - uint16 id; - uint16 sceneId; - int16 x; - uint8 y; - uint16 unk7; - }; - Item *_itemList; - - uint16 _hiddenItems[20]; - - int findFreeItem(); - int countAllItems(); - int findItem(uint16 sceneId, uint16 id); - int checkItemCollision(int x, int y); - void resetItemList(); - void updateWaterFlasks(); - - int _itemInHand; - int _handItemSet; - - bool dropItem(int unk1, uint16 item, int x, int y, int unk2); - bool processItemDrop(uint16 sceneId, uint16 item, int x, int y, int unk1, int unk2); - void itemDropDown(int startX, int startY, int dstX, int dstY, int itemSlot, uint16 item); - void exchangeMouseItem(int itemPos); - bool pickUpItem(int x, int y); - - bool isDropable(int x, int y); - - static const byte _itemStringMap[]; - static const int _itemStringMapSize; - - void setMouseCursor(uint16 item); - void setHandItem(uint16 item); - void removeHandItem(); - - static const int16 _flaskTable[]; - bool itemIsFlask(int item); - - // inventory - static const int _inventoryX[]; - static const int _inventoryY[]; - static const uint16 _itemMagicTable[]; - - int getInventoryItemSlot(uint16 item); - void removeItemFromInventory(int slot); - bool checkInventoryItemExchange(uint16 item, int slot); - void drawInventoryShape(int page, uint16 item, int slot); - void clearInventorySlot(int slot, int page); - void redrawInventory(int page); - void scrollInventoryWheel(); - int findFreeVisibleInventorySlot(); - - ActiveItemAnim _activeItemAnim[15]; - int _nextAnimItem; - - // gui - bool _menuDirectlyToLoad; - GUI_v2 *_gui; - - void loadButtonShapes(); - void setupLangButtonShapes(); - uint8 *_buttonShapes[19]; - - void initInventoryButtonList(); - Button *_inventoryButtons; - Button *_buttonList; - - int scrollInventory(Button *button); - int buttonInventory(Button *button); - int bookButton(Button *button); - int cauldronButton(Button *button); - int cauldronClearButton(Button *button); - - // book - static const int _bookPageYOffset[]; - static const byte _bookTextColorMap[]; - - int _bookMaxPage; - int _bookNewPage; - int _bookCurPage; - int _bookBkgd; - bool _bookShown; - - void loadBookBkgd(); - void showBookPage(); - void bookLoop(); - - void bookDecodeText(uint8 *text); - void bookPrintText(int dstPage, const uint8 *text, int x, int y, uint8 color); - - int bookPrevPage(Button *button); - int bookNextPage(Button *button); - int bookClose(Button *button); - - // cauldron - uint8 _cauldronState; - int16 _cauldronUseCount; - int16 _cauldronTable[25]; - int16 _cauldronStateTables[23][7]; - - static const int16 _cauldronProtectedItems[]; - static const int16 _cauldronBowlTable[]; - static const int16 _cauldronMagicTable[]; - static const int16 _cauldronMagicTableScene77[]; - static const uint8 _cauldronStateTable[]; - - void resetCauldronStateTable(int idx); - bool addToCauldronStateTable(int data, int idx); - - void setCauldronState(uint8 state, bool paletteFade); - void clearCauldronTable(); - void addFrontCauldronTable(int item); - void cauldronItemAnim(int item); - void cauldronRndPaletteFade(); - bool updateCauldron(); - void listItemsInCauldron(); - - // localization - void loadCCodeBuffer(const char *file); - void loadOptionsBuffer(const char *file); - void loadChapterBuffer(int chapter); - uint8 *_optionsBuffer; - uint8 *_cCodeBuffer; - - uint8 *_chapterBuffer; - int _currentChapter; - int _newChapterFile; - - uint8 *getTableEntry(uint8 *buffer, int id); - char *getTableString(int id, uint8 *buffer, int decode); - const char *getChapterString(int id); - int decodeString1(const char *src, char *dst); - void decodeString2(const char *src, char *dst); - - void changeFileExtension(char *buffer); - - // - Just used in French version - int getItemCommandStringDrop(uint16 item); - int getItemCommandStringPickUp(uint16 item); - int getItemCommandStringInv(uint16 item); - // - - - char _internStringBuf[200]; - static const char *_languageExtension[]; - static const char *_scriptLangExt[]; - - // character - struct Character { - uint16 sceneId; - uint16 dlgIndex; - uint8 height; - uint8 facing; - uint16 animFrame; - uint8 unk8; - uint8 unk9; - uint8 unkA; - uint16 inventory[20]; - int16 x1, y1; - int16 x2, y2; - }; - - int8 _deathHandler; - Character _mainCharacter; - bool _useCharPal; - int _charPalEntry; - uint8 _charPalTable[16]; - void updateCharPal(int unk1); - void setCharPalEntry(int entry, int value); - - void moveCharacter(int facing, int x, int y); - int updateCharPos(int *table); - void updateCharPosWithUpdate(); - void updateCharAnimFrame(int num, int *table); - - int checkCharCollision(int x, int y); - - int _mainCharX, _mainCharY; - int _charScaleX, _charScaleY; - - static const int _characterFrameTable[]; - - // text - void showMessageFromCCode(int id, int16 palIndex, int); - void showMessage(const char *string, int16 palIndex); - void showChapterMessage(int id, int16 palIndex); - - void updateCommandLineEx(int str1, int str2, int16 palIndex); - - const char *_shownMessage; - - byte _messagePal[3]; - bool _fadeMessagePalette; - void fadeMessagePalette(); - - // chat - int _vocHigh; - - const char *_chatText; - int _chatObject; - bool _chatIsNote; - uint32 _chatEndTime; - int _chatVocHigh, _chatVocLow; - - EMCData _chatScriptData; - EMCState _chatScriptState; - - int chatGetType(const char *text); - int chatCalcDuration(const char *text); - - void objectChat(const char *text, int object, int vocHigh = -1, int vocLow = -1); - void objectChatInit(const char *text, int object, int vocHigh = -1, int vocLow = -1); - void objectChatPrintText(const char *text, int object); - void objectChatProcess(const char *script); - void objectChatWaitToFinish(); - - void startDialogue(int dlgIndex); - - void zanthSceneStartupChat(); - void zanthRandomIdleChat(); - void updateDlgBuffer(); - void loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2); - void processDialogue(int dlgOffset, int vocH = 0, int csEntry = 0); - void npcChatSequence(const char *str, int objectId, int vocHigh = -1, int vocLow = -1); - void setNewDlgIndex(int dlgIndex); - - int _npcTalkChpIndex; - int _npcTalkDlgIndex; - uint8 _newSceneDlgState[32]; - int8 **_conversationState; - uint8 *_dlgBuffer; - - // Talk object handling - void initTalkObject(int index); - void deinitTalkObject(int index); - - struct TalkObject { - char filename[13]; - int8 scriptId; - int16 x, y; - int8 color; - }; - TalkObject *_talkObjectList; - - struct TalkSections { - TIM *STATim; - TIM *TLKTim; - TIM *ENDTim; - }; - TalkSections _currentTalkSections; - - char _TLKFilename[13]; - - // tim - void playTim(const char *filename); - - int t2_initChat(const TIM *tim, const uint16 *param); - int t2_updateSceneAnim(const TIM *tim, const uint16 *param); - int t2_resetChat(const TIM *tim, const uint16 *param); - int t2_playSoundEffect(const TIM *tim, const uint16 *param); - - Common::Array<const TIMOpcode*> _timOpcodes; - - // sound - int _oldTalkFile; - int _currentTalkFile; - void openTalkFile(int newFile); - int _lastSfxTrack; - - virtual void snd_playVoiceFile(int id); - void snd_loadSoundFile(int id); - - void playVoice(int high, int low); - void snd_playSoundEffect(int track, int volume=0xFF); - - // timer - void timerFadeOutMessage(int); - void timerCauldronAnimation(int); - void timerFunc4(int); - void timerFunc5(int); - void timerBurnZanthia(int); - - void setTimer1DelaySecs(int secs); - - uint32 _nextIdleAnim; - int _lastIdleScript; - - void setNextIdleAnimTimer(); - void showIdleAnim(); - void runIdleScript(int script); - - void setWalkspeed(uint8 speed); - - // delay - void delay(uint32 millis, bool updateGame = false, bool isMainLoop = false); - - // ingame static sequence handling - void seq_makeBookOrCauldronAppear(int type); - void seq_makeBookAppear(); - - struct InventoryWsa { - int x, y, x2, y2, w, h; - int page; - int curFrame, lastFrame, specialFrame; - int sfx; - int delay; - bool running; - uint32 timer; - WSAMovieV2 *wsa; - } _invWsa; - - // TODO: move inside KyraEngine_v2::InventoryWsa? - void loadInvWsa(const char *filename, int run, int delay, int page, int sfx, int sFrame, int flags); - void closeInvWsa(); - - void updateInvWsa(); - void displayInvWsaLastFrame(); - - // opcodes - int o2_setCharacterFacingRefresh(EMCState *script); - int o2_setCharacterPos(EMCState *script); - int o2_defineObject(EMCState *script); - int o2_refreshCharacter(EMCState *script); - int o2_getCharacterX(EMCState *script); - int o2_getCharacterY(EMCState *script); - int o2_getCharacterFacing(EMCState *script); - int o2_getCharacterScene(EMCState *script); - int o2_setSceneComment(EMCState *script); - int o2_setCharacterAnimFrame(EMCState *script); - int o2_setCharacterFacing(EMCState *script); - int o2_trySceneChange(EMCState *script); - int o2_moveCharacter(EMCState *script); - int o2_customCharacterChat(EMCState *script); - int o2_soundFadeOut(EMCState *script); - int o2_showChapterMessage(EMCState *script); - int o2_restoreTalkTextMessageBkgd(EMCState *script); - int o2_wsaClose(EMCState *script); - int o2_meanWhileScene(EMCState *script); - int o2_backUpScreen(EMCState *script); - int o2_restoreScreen(EMCState *script); - int o2_displayWsaFrame(EMCState *script); - int o2_displayWsaSequentialFramesLooping(EMCState *script); - int o2_wsaOpen(EMCState *script); - int o2_displayWsaSequentialFrames(EMCState *script); - int o2_displayWsaSequence(EMCState *script); - int o2_addItemToInventory(EMCState *script); - int o2_drawShape(EMCState *script); - int o2_addItemToCurScene(EMCState *script); - int o2_checkForItem(EMCState *script); - int o2_loadSoundFile(EMCState *script); - int o2_removeItemSlotFromInventory(EMCState *script); - int o2_defineItem(EMCState *script); - int o2_removeItemFromInventory(EMCState *script); - int o2_countItemInInventory(EMCState *script); - int o2_countItemsInScene(EMCState *script); - int o2_queryGameFlag(EMCState *script); - int o2_resetGameFlag(EMCState *script); - int o2_setGameFlag(EMCState *script); - int o2_setHandItem(EMCState *script); - int o2_removeHandItem(EMCState *script); - int o2_handItemSet(EMCState *script); - int o2_hideMouse(EMCState *script); - int o2_addSpecialExit(EMCState *script); - int o2_setMousePos(EMCState *script); - int o2_showMouse(EMCState *script); - int o2_wipeDownMouseItem(EMCState *script); - int o2_getElapsedSecs(EMCState *script); - int o2_getTimerDelay(EMCState *script); - //int o2_playSoundEffect(EMCState *script); - int o2_delaySecs(EMCState *script); - int o2_delay(EMCState *script); - int o2_setTimerDelay(EMCState *script); - int o2_setScaleTableItem(EMCState *script); - int o2_setDrawLayerTableItem(EMCState *script); - int o2_setCharPalEntry(EMCState *script); - int o2_loadZShapes(EMCState *script); - int o2_drawSceneShape(EMCState *script); - int o2_drawSceneShapeOnPage(EMCState *script); - int o2_disableAnimObject(EMCState *script); - int o2_enableAnimObject(EMCState *script); - int o2_loadPalette384(EMCState *script); - int o2_setPalette384(EMCState *script); - int o2_restoreBackBuffer(EMCState *script); - int o2_backUpInventoryGfx(EMCState *script); - int o2_disableSceneAnim(EMCState *script); - int o2_enableSceneAnim(EMCState *script); - int o2_restoreInventoryGfx(EMCState *script); - int o2_setSceneAnimPos2(EMCState *script); - int o2_update(EMCState *script); - int o2_fadeScenePal(EMCState *script); - int o2_enterNewSceneEx(EMCState *script); - int o2_switchScene(EMCState *script); - int o2_getShapeFlag1(EMCState *script); - int o2_setPathfinderFlag(EMCState *script); - int o2_getSceneExitToFacing(EMCState *script); - int o2_setLayerFlag(EMCState *script); - int o2_setZanthiaPos(EMCState *script); - int o2_loadMusicTrack(EMCState *script); - int o2_playWanderScoreViaMap(EMCState *script); - int o2_playSoundEffect(EMCState *script); - int o2_setSceneAnimPos(EMCState *script); - int o2_blockInRegion(EMCState *script); - int o2_blockOutRegion(EMCState *script); - int o2_setCauldronState(EMCState *script); - int o2_showItemString(EMCState *script); - int o2_getRand(EMCState *script); - int o2_isAnySoundPlaying(EMCState *script); - int o2_setDeathHandlerFlag(EMCState *script); - int o2_setDrawNoShapeFlag(EMCState *script); - int o2_setRunFlag(EMCState *script); - int o2_showLetter(EMCState *script); - int o2_fillRect(EMCState *script); - int o2_waitForConfirmationClick(EMCState *script); - int o2_encodeShape(EMCState *script); - int o2_defineRoomEntrance(EMCState *script); - int o2_runTemporaryScript(EMCState *script); - int o2_setSpecialSceneScriptRunTime(EMCState *script); - int o2_defineSceneAnim(EMCState *script); - int o2_updateSceneAnim(EMCState *script); - int o2_addToSceneAnimPosAndUpdate(EMCState *script); - int o2_useItemOnMainChar(EMCState *script); - int o2_startDialogue(EMCState *script); - int o2_zanthRandomChat(EMCState *script); - int o2_setupDialogue(EMCState *script); - int o2_getDlgIndex(EMCState *script); - int o2_defineRoom(EMCState *script); - int o2_addCauldronStateTableEntry(EMCState *script); - int o2_setCountDown(EMCState *script); - int o2_getCountDown(EMCState *script); - int o2_pressColorKey(EMCState *script); - int o2_objectChat(EMCState *script); - int o2_chapterChange(EMCState *script); - int o2_getColorCodeFlag1(EMCState *script); - int o2_setColorCodeFlag1(EMCState *script); - int o2_getColorCodeFlag2(EMCState *script); - int o2_setColorCodeFlag2(EMCState *script); - int o2_getColorCodeValue(EMCState *script); - int o2_setColorCodeValue(EMCState *script); - int o2_countItemInstances(EMCState *script); - int o2_removeItemFromScene(EMCState *script); - int o2_initObject(EMCState *script); - int o2_npcChat(EMCState *script); - int o2_deinitObject(EMCState *script); - int o2_playTimSequence(EMCState *script); - int o2_makeBookOrCauldronAppear(EMCState *script); - int o2_setSpecialSceneScriptState(EMCState *script); - int o2_clearSpecialSceneScriptState(EMCState *script); - int o2_querySpecialSceneScriptState(EMCState *script); - int o2_resetInputColorCode(EMCState *script); - int o2_setHiddenItemsEntry(EMCState *script); - int o2_getHiddenItemsEntry(EMCState *script); - int o2_mushroomEffect(EMCState *script); - int o2_customChat(EMCState *script); - int o2_customChatFinish(EMCState *script); - int o2_setupSceneAnimation(EMCState *script); - int o2_stopSceneAnimation(EMCState *script); - int o2_disableTimer(EMCState *script); - int o2_enableTimer(EMCState *script); - int o2_setTimerCountdown(EMCState *script); - int o2_processPaletteIndex(EMCState *script); - int o2_updateTwoSceneAnims(EMCState *script); - int o2_getRainbowRoomData(EMCState *script); - int o2_drawSceneShapeEx(EMCState *script); - int o2_getBoolFromStack(EMCState *script); - int o2_getSfxDriver(EMCState *script); - int o2_getVocSupport(EMCState *script); - int o2_getMusicDriver(EMCState *script); - int o2_setVocHigh(EMCState *script); - int o2_getVocHigh(EMCState *script); - int o2_zanthiaChat(EMCState *script); - int o2_isVoiceEnabled(EMCState *script); - int o2_isVoicePlaying(EMCState *script); - int o2_stopVoicePlaying(EMCState *script); - int o2_getGameLanguage(EMCState *script); - int o2_demoFinale(EMCState *script); - int o2_dummy(EMCState *script); - - // opcodes temporary - // TODO: rename it from temporary to something more appropriate - int o2t_defineNewShapes(EMCState *script); - int o2t_setCurrentFrame(EMCState *script); - int o2t_playSoundEffect(EMCState *script); - int o2t_fadeScenePal(EMCState *script); - int o2t_setShapeFlag(EMCState *script); - - // script - void runStartScript(int script, int unk1); - void loadNPCScript(); - - bool _noScriptEnter; - - EMCData _npcScriptData; - - EMCData _sceneScriptData; - EMCState _sceneScriptState; - - EMCData _temporaryScriptData; - EMCState _temporaryScriptState; - bool _temporaryScriptExecBit; - Common::Array<const Opcode*> _opcodesTemporary; - - void runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload); - - // pathfinder - int _pathfinderFlag; - - uint8 *_unkBuf500Bytes; - uint8 *_unkBuf200kByte; - bool _chatAltFlag; - int _unk3, _unk4, _unk5; - bool _unkSceneScreenFlag1; - bool _unkHandleSceneChangeFlag; - - // sequence player - ActiveWSA *_activeWSA; - ActiveText *_activeText; - - const char *const *_sequencePakList; - int _sequencePakListSize; - const char *const *_ingamePakList; - int _ingamePakListSize; - - const char *const *_musicFileListIntro; - int _musicFileListIntroSize; - const char *const *_musicFileListFinale; - int _musicFileListFinaleSize; - const char *const *_musicFileListIngame; - int _musicFileListIngameSize; - const uint8 *_cdaTrackTableIntro; - int _cdaTrackTableIntroSize; - const uint8 *_cdaTrackTableIngame; - int _cdaTrackTableIngameSize; - const uint8 *_cdaTrackTableFinale; - int _cdaTrackTableFinaleSize; - const char *const *_sequenceSoundList; - int _sequenceSoundListSize; - const char *const *_ingameSoundList; - int _ingameSoundListSize; - const uint16 *_ingameSoundIndex; - int _ingameSoundIndexSize; - const char *const *_sequenceStrings; - int _sequenceStringsSize; - const uint16 *_ingameTalkObjIndex; - int _ingameTalkObjIndexSize; - const char *const *_ingameTimJpStr; - int _ingameTimJpStrSize; - const HofSeqData *_sequences; - const ItemAnimData_v2 *_itemAnimData; - int _itemAnimDataSize; - const ItemAnimData_v1 *_demoAnimData; - int _demoAnimSize; - - int _sequenceStringsDuration[33]; - - static const uint8 _seqTextColorPresets[]; - char *_seqProcessedString; - WSAMovieV2 *_seqWsa; - - bool _abortIntroFlag; - int _menuChoice; - - uint32 _seqFrameDelay; - uint32 _seqStartTime; - uint32 _seqEndTime; - int _seqFrameCounter; - int _seqScrollTextCounter; - int _seqWsaCurrentFrame; - bool _seqSpecialFlag; - bool _seqSubframePlaying; - uint8 _seqTextColor[2]; - uint8 _seqTextColorMap[16]; - - const SeqProc *_callbackS; - const SeqProc *_callbackN; - - static const uint8 _rainbowRoomData[]; - - // color code related vars - int _colorCodeFlag1; - int _colorCodeFlag2; - uint8 _presetColorCode[7]; - uint8 _inputColorCode[7]; - uint32 _scriptCountDown; - int _dbgPass; - - // save/load specific - void saveGame(const char *fileName, const char *saveName); - void loadGame(const char *fileName); -}; - -} // end of namespace Kyra - -#endif - - - - diff --git a/engines/kyra/module.mk b/engines/kyra/module.mk index d53479b133..a45891de46 100644 --- a/engines/kyra/module.mk +++ b/engines/kyra/module.mk @@ -3,7 +3,8 @@ MODULE := engines/kyra MODULE_OBJS := \ animator_v1.o \ animator_v2.o \ - animator_v3.o \ + animator_hof.o \ + animator_mr.o \ debugger.o \ detection.o \ gui.o \ @@ -11,34 +12,37 @@ MODULE_OBJS := \ gui_v2.o \ gui_v3.o \ items_v1.o \ - items_v2.o \ - items_v3.o \ + items_hof.o \ + items_mr.o \ kyra.o \ kyra_v1.o \ kyra_v2.o \ - kyra_v3.o \ + kyra_hof.o \ + kyra_mr.o \ resource.o \ saveload.o \ saveload_v1.o \ - saveload_v2.o \ - saveload_v3.o \ + saveload_hof.o \ + saveload_mr.o \ scene.o \ scene_v1.o \ scene_v2.o \ - scene_v3.o \ + scene_hof.o \ + scene_mr.o \ screen.o \ screen_v1.o \ screen_v2.o \ - screen_v3.o \ + screen_hof.o \ + screen_mr.o \ script_v1.o \ - script_v2.o \ - script_v3.o \ + script_hof.o \ + script_mr.o \ script.o \ script_tim.o \ seqplayer.o \ sequences_v1.o \ - sequences_v2.o \ - sequences_v3.o \ + sequences_hof.o \ + sequences_mr.o \ sound_adlib.o \ sound_digital.o \ sound_towns.o \ @@ -48,12 +52,12 @@ MODULE_OBJS := \ staticres.o \ text.o \ text_v1.o \ - text_v2.o \ - text_v3.o \ + text_hof.o \ + text_mr.o \ timer.o \ timer_v1.o \ - timer_v2.o \ - timer_v3.o \ + timer_hof.o \ + timer_mr.o \ vqa.o \ wsamovie.o diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 7a6bdbd73e..f414cacee8 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -37,7 +37,7 @@ #include "common/ptr.h" #include "kyra/kyra.h" -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" namespace Kyra { diff --git a/engines/kyra/saveload_v2.cpp b/engines/kyra/saveload_hof.cpp index 94824c9895..00a54ea916 100644 --- a/engines/kyra/saveload_v2.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -35,8 +35,8 @@ namespace Kyra { -void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::saveGame('%s', '%s')", fileName, saveName); +void KyraEngine_HoF::saveGame(const char *fileName, const char *saveName) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::saveGame('%s', '%s')", fileName, saveName); Common::OutSaveFile *out = openSaveForWriting(fileName, saveName); if (!out) { @@ -104,7 +104,7 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) { } for (int i = 0; i < 86; ++i) { - out->write(_sceneList[i].filename, 10); + out->write(_sceneList[i].filename1, 10); out->writeUint16BE(_sceneList[i].exit1); out->writeUint16BE(_sceneList[i].exit2); out->writeUint16BE(_sceneList[i].exit3); @@ -130,8 +130,8 @@ void KyraEngine_v2::saveGame(const char *fileName, const char *saveName) { delete out; } -void KyraEngine_v2::loadGame(const char *fileName) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::loadGame('%s')", fileName); +void KyraEngine_HoF::loadGame(const char *fileName) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::loadGame('%s')", fileName); SaveHeader header; Common::InSaveFile *saveFile = openSaveForReading(fileName, header); @@ -241,10 +241,10 @@ void KyraEngine_v2::loadGame(const char *fileName) { for (int i = 0; i < 86; ++i) { if (!header.originalSave) { - in.read(_sceneList[i].filename, 10); + in.read(_sceneList[i].filename1, 10); } else { - in.read(_sceneList[i].filename, 9); - _sceneList[i].filename[9] = 0; + in.read(_sceneList[i].filename1, 9); + _sceneList[i].filename1[9] = 0; } _sceneList[i].exit1 = in.readUint16(); diff --git a/engines/kyra/saveload_v3.cpp b/engines/kyra/saveload_mr.cpp index 4d975c2a67..cab86c3cfe 100644 --- a/engines/kyra/saveload_v3.cpp +++ b/engines/kyra/saveload_mr.cpp @@ -27,13 +27,13 @@ #include "common/savefile.h" #include "common/system.h" -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" #include "kyra/timer.h" namespace Kyra { -void KyraEngine_v3::saveGame(const char *fileName, const char *saveName) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::saveGame('%s', '%s')", fileName, saveName); +void KyraEngine_MR::saveGame(const char *fileName, const char *saveName) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::saveGame('%s', '%s')", fileName, saveName); Common::OutSaveFile *out = openSaveForWriting(fileName, saveName); if (!out) { @@ -119,8 +119,8 @@ void KyraEngine_v3::saveGame(const char *fileName, const char *saveName) { delete out; } -void KyraEngine_v3::loadGame(const char *fileName) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadGame('%s')", fileName); +void KyraEngine_MR::loadGame(const char *fileName) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadGame('%s')", fileName); SaveHeader header; Common::InSaveFile *saveFile = openSaveForReading(fileName, header); diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_hof.cpp index f46d993719..216c453b4b 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_hof.cpp @@ -23,17 +23,18 @@ * */ -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/screen_v2.h" #include "kyra/sound.h" #include "kyra/wsamovie.h" +#include "kyra/resource.h" #include "common/func.h" namespace Kyra { -void KyraEngine_v2::enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::enterNewScene(%d, %d, %d, %d, %d)", newScene, facing, unk1, unk2, unk3); +void KyraEngine_HoF::enterNewScene(uint16 newScene, int facing, int unk1, int unk2, int unk3) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::enterNewScene(%d, %d, %d, %d, %d)", newScene, facing, unk1, unk2, unk3); if (_newChapterFile != _currentTalkFile) { _currentTalkFile = _newChapterFile; if (_flags.isTalkie) { @@ -143,8 +144,8 @@ void KyraEngine_v2::enterNewScene(uint16 newScene, int facing, int unk1, int unk _currentScene = newScene; } -void KyraEngine_v2::enterNewSceneUnk1(int facing, int unk1, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2); +void KyraEngine_HoF::enterNewSceneUnk1(int facing, int unk1, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2); int x = 0, y = 0; int x2 = 0, y2 = 0; bool needProc = true; @@ -239,8 +240,8 @@ void KyraEngine_v2::enterNewSceneUnk1(int facing, int unk1, int unk2) { moveCharacter(facing, x, y); } -void KyraEngine_v2::enterNewSceneUnk2(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::enterNewSceneUnk2(%d)", unk1); +void KyraEngine_HoF::enterNewSceneUnk2(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::enterNewSceneUnk2(%d)", unk1); _unk3 = -1; if (_flags.isTalkie) { @@ -268,8 +269,8 @@ void KyraEngine_v2::enterNewSceneUnk2(int unk1) { _unk3 = -1; } -int KyraEngine_v2::trySceneChange(int *moveTable, int unk1, int updateChar) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar); +int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar); bool running = true; bool unkFlag = false; int8 updateType = -1; @@ -335,8 +336,8 @@ int KyraEngine_v2::trySceneChange(int *moveTable, int unk1, int updateChar) { return changedScene; } -int KyraEngine_v2::checkSceneChange() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::checkSceneChange()"); +int KyraEngine_HoF::checkSceneChange() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::checkSceneChange()"); SceneDesc &curScene = _sceneList[_mainCharacter.sceneId]; int charX = _mainCharacter.x1, charY = _mainCharacter.y1; int facing = 0; @@ -389,20 +390,20 @@ int KyraEngine_v2::checkSceneChange() { return 1; } -void KyraEngine_v2::unloadScene() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::unloadScene()"); +void KyraEngine_HoF::unloadScene() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::unloadScene()"); _emc->unload(&_sceneScriptData); freeSceneShapePtrs(); freeSceneAnims(); } -void KyraEngine_v2::loadScenePal() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::loadScenePal()"); +void KyraEngine_HoF::loadScenePal() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::loadScenePal()"); uint16 sceneId = _mainCharacter.sceneId; memcpy(_screen->getPalette(1), _screen->getPalette(0), 768); char filename[14]; - strcpy(filename, _sceneList[sceneId].filename); + strcpy(filename, _sceneList[sceneId].filename1); strcat(filename, ".COL"); _screen->loadBitmap(filename, 3, 3, 0); memcpy(_screen->getPalette(1), _screen->getCPagePtr(3), 384); @@ -410,21 +411,21 @@ void KyraEngine_v2::loadScenePal() { memcpy(_scenePal, _screen->getCPagePtr(3)+336, 432); } -void KyraEngine_v2::loadSceneMsc() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::loadSceneMsc()"); +void KyraEngine_HoF::loadSceneMsc() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::loadSceneMsc()"); uint16 sceneId = _mainCharacter.sceneId; char filename[14]; - strcpy(filename, _sceneList[sceneId].filename); + strcpy(filename, _sceneList[sceneId].filename1); strcat(filename, ".MSC"); _screen->loadBitmap(filename, 3, 5, 0); } -void KyraEngine_v2::startSceneScript(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::startSceneScript(%d)", unk1); +void KyraEngine_HoF::startSceneScript(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::startSceneScript(%d)", unk1); uint16 sceneId = _mainCharacter.sceneId; char filename[14]; - strcpy(filename, _sceneList[sceneId].filename); + strcpy(filename, _sceneList[sceneId].filename1); if (sceneId == 68 && (queryGameFlag(0x1BC) || queryGameFlag(0x1BD))) strcpy(filename, "DOORX"); strcat(filename, ".CPS"); @@ -448,7 +449,7 @@ void KyraEngine_v2::startSceneScript(int unk1) { _sceneCommentString = "Undefined scene comment string!"; _emc->init(&_sceneScriptState, &_sceneScriptData); - strcpy(filename, _sceneList[sceneId].filename); + strcpy(filename, _sceneList[sceneId].filename1); strcat(filename, "."); strcat(filename, _scriptLangExt[(_flags.platform == Common::kPlatformPC && !_flags.isTalkie) ? 0 : _lang]); @@ -480,8 +481,8 @@ void KyraEngine_v2::startSceneScript(int unk1) { _sceneEnterY4 &= ~1; } -void KyraEngine_v2::runSceneScript2() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript2()"); +void KyraEngine_HoF::runSceneScript2() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript2()"); _emc->init(&_sceneScriptState, &_sceneScriptData); _sceneScriptState.regs[4] = _itemInHand; _emc->start(&_sceneScriptState, 2); @@ -490,8 +491,8 @@ void KyraEngine_v2::runSceneScript2() { _emc->run(&_sceneScriptState); } -void KyraEngine_v2::runSceneScript4(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript4(%d)", unk1); +void KyraEngine_HoF::runSceneScript4(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript4(%d)", unk1); _sceneScriptState.regs[4] = _itemInHand; _sceneScriptState.regs[5] = unk1; @@ -500,8 +501,8 @@ void KyraEngine_v2::runSceneScript4(int unk1) { _emc->run(&_sceneScriptState); } -void KyraEngine_v2::runSceneScript6() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript6()"); +void KyraEngine_HoF::runSceneScript6() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript6()"); _emc->init(&_sceneScriptState, &_sceneScriptData); _sceneScriptState.regs[0] = _mainCharacter.sceneId; @@ -514,8 +515,8 @@ void KyraEngine_v2::runSceneScript6() { _emc->run(&_sceneScriptState); } -void KyraEngine_v2::runSceneScript7() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::runSceneScript7()"); +void KyraEngine_HoF::runSceneScript7() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::runSceneScript7()"); int oldPage = _screen->_curPage; _screen->_curPage = 2; @@ -526,8 +527,8 @@ void KyraEngine_v2::runSceneScript7() { _screen->_curPage = oldPage; } -void KyraEngine_v2::initSceneAnims(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::initSceneAnims(%d)", unk1); +void KyraEngine_HoF::initSceneAnims(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::initSceneAnims(%d)", unk1); for (int i = 0; i < ARRAYSIZE(_animObjects); ++i) _animObjects[i].enabled = 0; @@ -541,7 +542,7 @@ void KyraEngine_v2::initSceneAnims(int unk1) { animState->enabled = 1; animState->xPos1 = _mainCharacter.x1; animState->yPos1 = _mainCharacter.y1; - animState->shapePtr = _defaultShapeTable[_mainCharacter.animFrame]; + animState->shapePtr = getShapePtr(_mainCharacter.animFrame); animState->shapeIndex1 = animState->shapeIndex2 = _mainCharacter.animFrame; int frame = _mainCharacter.animFrame - 9; @@ -561,7 +562,7 @@ void KyraEngine_v2::initSceneAnims(int unk1) { animState->xPos3 = animState->xPos2; animState->yPos3 = animState->yPos2; animState->needRefresh = 1; - animState->unk8 = 1; + animState->specialRefresh = 1; _animList = 0; @@ -571,12 +572,12 @@ void KyraEngine_v2::initSceneAnims(int unk1) { animState = &_animObjects[i+1]; animState->enabled = 0; animState->needRefresh = 0; - animState->unk8 = 0; + animState->specialRefresh = 0; if (_sceneAnims[i].flags & 1) { animState->enabled = 1; animState->needRefresh = 1; - animState->unk8 = 1; + animState->specialRefresh = 1; } animState->animFlags = _sceneAnims[i].flags & 8; @@ -637,11 +638,11 @@ void KyraEngine_v2::initSceneAnims(int unk1) { if (shapeIndex == 0xFFFF || _itemList[i].sceneId != _mainCharacter.sceneId) { animState->enabled = 0; animState->needRefresh = 0; - animState->unk8 = 0; + animState->specialRefresh = 0; } else { animState->xPos1 = _itemList[i].x; animState->yPos1 = _itemList[i].y; - animState->shapePtr = _defaultShapeTable[64+shapeIndex]; + animState->shapePtr = getShapePtr(64+shapeIndex); animState->shapeIndex1 = animState->shapeIndex2 = shapeIndex+64; animState->xPos2 = _itemList[i].x; @@ -656,7 +657,7 @@ void KyraEngine_v2::initSceneAnims(int unk1) { animState->enabled = 1; animState->needRefresh = 1; - animState->unk8 = 1; + animState->specialRefresh = 1; if (animInit) { _animList = addToAnimListSorted(_animList, animState); @@ -667,13 +668,13 @@ void KyraEngine_v2::initSceneAnims(int unk1) { } } - _animObjects[0].unk8 = 1; + _animObjects[0].specialRefresh = 1; _animObjects[0].needRefresh = 1; for (int i = 1; i < 41; ++i) { if (_animObjects[i].enabled) { _animObjects[i].needRefresh = 1; - _animObjects[i].unk8 = 1; + _animObjects[i].specialRefresh = 1; } } @@ -685,8 +686,8 @@ void KyraEngine_v2::initSceneAnims(int unk1) { refreshAnimObjects(0); } -void KyraEngine_v2::initSceneScreen(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::initSceneScreen(%d)", unk1); +void KyraEngine_HoF::initSceneScreen(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::initSceneScreen(%d)", unk1); if (_unkSceneScreenFlag1) { _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK); return; @@ -712,52 +713,15 @@ void KyraEngine_v2::initSceneScreen(int unk1) { _emc->run(&_sceneScriptState); } -void KyraEngine_v2::updateSpecialSceneScripts() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::updateSpecialSceneScripts()"); - uint32 nextTime = _system->getMillis() + _tickLength; - const int startScript = _lastProcessedSceneScript; - - while (_system->getMillis() <= nextTime) { - if (_sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis() && - !_specialSceneScriptState[_lastProcessedSceneScript]) { - _specialSceneScriptRunFlag = true; - - while (_specialSceneScriptRunFlag && _sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis()) { - if (!_emc->run(&_sceneSpecialScripts[_lastProcessedSceneScript])) - _specialSceneScriptRunFlag = false; - } - } - - if (!_emc->isValid(&_sceneSpecialScripts[_lastProcessedSceneScript])) { - _emc->start(&_sceneSpecialScripts[_lastProcessedSceneScript], 8+_lastProcessedSceneScript); - _specialSceneScriptRunFlag = false; - } - - ++_lastProcessedSceneScript; - if (_lastProcessedSceneScript >= 10) - _lastProcessedSceneScript = 0; - - if (_lastProcessedSceneScript == startScript) - return; - } -} - -void KyraEngine_v2::freeSceneShapePtrs() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::freeSceneShapePtrs()"); +void KyraEngine_HoF::freeSceneShapePtrs() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::freeSceneShapePtrs()"); for (int i = 0; i < ARRAYSIZE(_sceneShapeTable); ++i) delete [] _sceneShapeTable[i]; memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable)); } -void KyraEngine_v2::freeSceneAnims() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::freeSceneAnims()"); - for (int i = 0; i < ARRAYSIZE(_sceneAnims); ++i) - _sceneAnims[i].flags = 0; - Common::for_each(_sceneAnimMovie, _sceneAnimMovie+ARRAYSIZE(_sceneAnimMovie), Common::mem_fun(&WSAMovieV2::close)); -} - -void KyraEngine_v2::fadeScenePal(int srcIndex, int delayTime) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::fadeScenePal(%d, %d)", srcIndex, delayTime); +void KyraEngine_HoF::fadeScenePal(int srcIndex, int delayTime) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::fadeScenePal(%d, %d)", srcIndex, delayTime); uint8 *dst = _screen->getPalette(0) + 336; const uint8 *src = _scenePal + (srcIndex << 4)*3; memcpy(dst, src, 48); @@ -769,24 +733,8 @@ void KyraEngine_v2::fadeScenePal(int srcIndex, int delayTime) { #pragma mark - Pathfinder #pragma mark - -int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize); - x &= ~3; toX &= ~3; - y &= ~1; toY &= ~1; - int size = KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize); - static bool usePostProcess = false; - if (size && !usePostProcess) { - usePostProcess = true; - int temp = pathfinderInitPositionTable(moveTable); - temp = pathfinderInitPositionIndexTable(temp, x, y); - pathfinderFinializePath(moveTable, temp, x, y, moveTableSize); - usePostProcess = false; - } - return usePostProcess ? size : getMoveTableSize(moveTable); -} - -bool KyraEngine_v2::lineIsPassable(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::lineIsPassable(%d, %d)", x, y); +bool KyraEngine_HoF::lineIsPassable(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::lineIsPassable(%d, %d)", x, y); static int unkTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 }; if (_pathfinderFlag & 2) { @@ -825,135 +773,5 @@ bool KyraEngine_v2::lineIsPassable(int x, int y) { return true; } -bool KyraEngine_v2::directLinePassable(int x, int y, int toX, int toY) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::directLinePassable(%d, %d, %d, %d)", x, y, toX, toY); - while (x != toX && y != toY) { - int facing = getFacingFromPointToPoint(x, y, toX, toY); - x += _addXPosTable[facing]; - y += _addYPosTable[facing]; - if (!_screen->getShapeFlag1(x, y)) - return false; - } - return true; -} - -int KyraEngine_v2::pathfinderInitPositionTable(int *moveTable) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::pathfinderInitPositionTable(%p)", (const void*)moveTable); - bool breakLoop = false; - int *moveTableCur = moveTable; - int oldEntry = *moveTableCur, curEntry = *moveTableCur; - int oldX = 0, newX = 0, oldY = 0, newY = 0; - int lastEntry = 0; - lastEntry = pathfinderAddToPositionTable(lastEntry, 0, 0); - - while (*moveTableCur != 8) { - oldEntry = curEntry; - - while (true) { - curEntry = *moveTableCur; - if (curEntry >= 0 && curEntry <= 7) - break; - - if (curEntry == 8) { - breakLoop = true; - break; - } else { - ++moveTableCur; - } - } - - if (breakLoop) - break; - - oldX = newX; - oldY = newY; - - newX += _addXPosTable[curEntry]; - newY += _addYPosTable[curEntry]; - - int temp = ABS(curEntry - oldEntry); - if (temp > 4) { - temp = 8 - temp; - } - - if (temp > 1 || oldEntry != curEntry) - lastEntry = pathfinderAddToPositionTable(lastEntry, oldX, oldY); - - ++moveTableCur; - } - - lastEntry = pathfinderAddToPositionTable(lastEntry, newX, newY); - _pathfinderPositionTable[lastEntry*2+0] = -1; - _pathfinderPositionTable[lastEntry*2+1] = -1; - return lastEntry; -} - -int KyraEngine_v2::pathfinderAddToPositionTable(int index, int v1, int v2) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::pathfinderAddToPositionTable(%d, %d, %d)", index, v1, v2); - _pathfinderPositionTable[index<<1] = v1; - _pathfinderPositionTable[(index<<1)+1] = v2; - ++index; - if (index >= 199) - --index; - return index; -} - -int KyraEngine_v2::pathfinderInitPositionIndexTable(int tableLen, int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::pathfinderInitPositionIndexTable(%d, %d, %d)", tableLen, x, y); - int x1 = 0, y1 = 0; - int x2 = 0, y2 = 0; - int lastEntry = 0; - int index2 = tableLen-1, index1 = 0; - while (index2 > index1) { - x1 = _pathfinderPositionTable[index1*2+0] + x; - y1 = _pathfinderPositionTable[index1*2+1] + y; - x2 = _pathfinderPositionTable[index2*2+0] + x; - y2 = _pathfinderPositionTable[index2*2+1] + y; - - if (directLinePassable(x1, y1, x2, y2)) { - lastEntry = pathfinderAddToPositionIndexTable(lastEntry, index2); - if (tableLen-1 == index2) - break; - index1 = index2; - index2 = tableLen-1; - } else if (index1+1 == index2) { - lastEntry = pathfinderAddToPositionIndexTable(lastEntry, index2); - index1 = index2; - index2 = tableLen-1; - } else { - --index2; - } - } - return lastEntry; -} - -int KyraEngine_v2::pathfinderAddToPositionIndexTable(int index, int v) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::pathfinderAddToPositionIndexTable(%d, %d)", index, v); - _pathfinderPositionIndexTable[index] = v; - ++index; - if (index >= 199) - --index; - return index; -} - -void KyraEngine_v2::pathfinderFinializePath(int *moveTable, int tableLen, int x, int y, int moveTableSize) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::pathfinderFinializePath(%p, %d, %d, %d, %d)", (void *)moveTable, tableLen, x, y, moveTableSize); - int x1 = 0, y1 = 0; - int x2 = 0, y2 = 0; - int index1 = 0, index2 = 0; - int sizeLeft = moveTableSize; - for (int i = 0; i < tableLen; ++i) { - index2 = _pathfinderPositionIndexTable[i]; - x1 = _pathfinderPositionTable[index1*2+0] + x; - y1 = _pathfinderPositionTable[index1*2+1] + y; - x2 = _pathfinderPositionTable[index2*2+0] + x; - y2 = _pathfinderPositionTable[index2*2+1] + y; - - int wayLen = findWay(x1, y1, x2, y2, moveTable, sizeLeft); - moveTable += wayLen; - sizeLeft -= wayLen; // unlike the original we want to be sure that the size left is correct - index1 = index2; - } -} - } // end of namespace Kyra + diff --git a/engines/kyra/scene_v3.cpp b/engines/kyra/scene_mr.cpp index b74e9da22e..c5a1c28ce2 100644 --- a/engines/kyra/scene_v3.cpp +++ b/engines/kyra/scene_mr.cpp @@ -23,15 +23,16 @@ * */ -#include "kyra/kyra_v3.h" -#include "kyra/screen_v3.h" +#include "kyra/kyra_mr.h" +#include "kyra/screen_mr.h" #include "kyra/wsamovie.h" #include "kyra/sound.h" +#include "kyra/resource.h" namespace Kyra { -void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2, int unk3) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::enterNewScene('%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, unk3); +void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2, int unk3) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::enterNewScene('%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, unk3); ++_enterNewSceneLock; _screen->hideMouse(); @@ -192,8 +193,8 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2 _screen->showMouse(); } -void KyraEngine_v3::enterNewSceneUnk1(int facing, int unk1, int unk2) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2); +void KyraEngine_MR::enterNewSceneUnk1(int facing, int unk1, int unk2) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::enterNewSceneUnk1(%d, %d, %d)", facing, unk1, unk2); int x = 0, y = 0; int x2 = 0, y2 = 0; bool needProc = true; @@ -290,8 +291,8 @@ void KyraEngine_v3::enterNewSceneUnk1(int facing, int unk1, int unk2) { moveCharacter(facing, x, y); } -void KyraEngine_v3::enterNewSceneUnk2(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::enterNewSceneUnk2(%d)", unk1); +void KyraEngine_MR::enterNewSceneUnk2(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::enterNewSceneUnk2(%d)", unk1); _unk3 = -1; if (_mainCharX == -1 && _mainCharY == -1 && !unk1) { _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing]; @@ -308,8 +309,8 @@ void KyraEngine_v3::enterNewSceneUnk2(int unk1) { _unk3 = -1; } -void KyraEngine_v3::unloadScene() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::unloadScene()"); +void KyraEngine_MR::unloadScene() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::unloadScene()"); delete [] _sceneStrings; _sceneStrings = 0; musicUpdate(0); @@ -321,24 +322,16 @@ void KyraEngine_v3::unloadScene() { musicUpdate(0); } -void KyraEngine_v3::freeSceneShapes() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::freeSceneShapes()"); +void KyraEngine_MR::freeSceneShapes() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::freeSceneShapes()"); for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i) { delete [] _sceneShapes[i]; _sceneShapes[i] = 0; } } -void KyraEngine_v3::freeSceneAnims() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::freeSceneAnims()"); - for (int i = 0; i < 16; ++i) { - _sceneAnims[i].flags = 0; - _sceneAnimMovie[i]->close(); - } -} - -void KyraEngine_v3::loadScenePal() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadScenePal()"); +void KyraEngine_MR::loadScenePal() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadScenePal()"); char filename[16]; memcpy(_screen->getPalette(2), _screen->getPalette(0), 768); strcpy(filename, _sceneList[_mainCharacter.sceneId].filename1); @@ -361,8 +354,8 @@ void KyraEngine_v3::loadScenePal() { memcpy(palette, costPal, 24*3); } -void KyraEngine_v3::loadSceneMsc() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadSceneMsc()"); +void KyraEngine_MR::loadSceneMsc() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadSceneMsc()"); char filename[16]; strcpy(filename, _sceneList[_mainCharacter.sceneId].filename1); strcat(filename, ".MSC"); @@ -393,8 +386,8 @@ void KyraEngine_v3::loadSceneMsc() { musicUpdate(0); } -void KyraEngine_v3::initSceneScript(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::initSceneScript(%d)", unk1); +void KyraEngine_MR::initSceneScript(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::initSceneScript(%d)", unk1); const SceneDesc &scene = _sceneList[_mainCharacter.sceneId]; musicUpdate(0); @@ -496,8 +489,8 @@ void KyraEngine_v3::initSceneScript(int unk1) { musicUpdate(0); } -void KyraEngine_v3::initSceneAnims(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::initSceneAnims(%d)", unk1); +void KyraEngine_MR::initSceneAnims(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::initSceneAnims(%d)", unk1); for (int i = 0; i < 67; ++i) _animObjects[i].enabled = false; @@ -510,7 +503,7 @@ void KyraEngine_v3::initSceneAnims(int unk1) { obj->xPos1 = _mainCharacter.x1; obj->yPos1 = _mainCharacter.y1; obj->shapePtr = getShapePtr(_mainCharacter.animFrame); - obj->shapeIndex2 = obj->shapeIndex = _mainCharacter.animFrame; + obj->shapeIndex2 = obj->shapeIndex1 = _mainCharacter.animFrame; obj->xPos2 = _mainCharacter.x1; obj->yPos2 = _mainCharacter.y1; _charScale = getScale(_mainCharacter.x1, _mainCharacter.y1); @@ -532,7 +525,7 @@ void KyraEngine_v3::initSceneAnims(int unk1) { obj->needRefresh = true; } - obj->unk8 = (anim.flags & 0x20) ? 1 : 0; + obj->specialRefresh = (anim.flags & 0x20) ? 1 : 0; obj->flags = (anim.flags & 0x10) ? 0x800 : 0; if (anim.flags & 2) obj->flags |= 1; @@ -540,7 +533,7 @@ void KyraEngine_v3::initSceneAnims(int unk1) { obj->xPos1 = anim.x; obj->yPos1 = anim.y; - if ((anim.flags & 4) && anim.shapeIndex != 0xFFFF) + if ((anim.flags & 4) && anim.shapeIndex != -1) obj->shapePtr = _sceneShapes[anim.shapeIndex]; else obj->shapePtr = 0; @@ -580,12 +573,12 @@ void KyraEngine_v3::initSceneAnims(int unk1) { obj->yPos1 = item.y; animSetupPaletteEntry(obj); obj->shapePtr = 0; - obj->shapeIndex = obj->shapeIndex2 = item.id + 248; + obj->shapeIndex1 = obj->shapeIndex2 = item.id + 248; obj->xPos2 = item.x; obj->yPos2 = item.y; int scale = getScale(obj->xPos1, obj->yPos1); - const uint8 *shape = getShapePtr(obj->shapeIndex); + const uint8 *shape = getShapePtr(obj->shapeIndex1); obj->xPos3 = obj->xPos2 -= (_screen->getShapeScaledWidth(shape, scale) >> 1); obj->yPos3 = obj->yPos2 -= _screen->getShapeScaledHeight(shape, scale) - 1; obj->enabled = true; @@ -612,8 +605,8 @@ void KyraEngine_v3::initSceneAnims(int unk1) { refreshAnimObjects(0); } -void KyraEngine_v3::initSceneScreen(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::initSceneScreen(%d)", unk1); +void KyraEngine_MR::initSceneScreen(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::initSceneScreen(%d)", unk1); _screen->copyBlockToPage(2, 0, 188, 320, 12, _interfaceCommandLine); if (_unkSceneScreenFlag1) { @@ -650,38 +643,8 @@ void KyraEngine_v3::initSceneScreen(int unk1) { } } -void KyraEngine_v3::updateSpecialSceneScripts() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateSpecialSceneScripts()"); - uint32 nextTime = _system->getMillis() + _tickLength; - const int startScript = _lastProcessedSceneScript; - - while (_system->getMillis() <= nextTime) { - if (_sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis() && - !_specialSceneScriptState[_lastProcessedSceneScript]) { - _specialSceneScriptRunFlag = true; - - while (_specialSceneScriptRunFlag && _sceneSpecialScriptsTimer[_lastProcessedSceneScript] <= _system->getMillis()) { - if (!_emc->run(&_sceneSpecialScripts[_lastProcessedSceneScript])) - _specialSceneScriptRunFlag = false; - } - } - - if (!_emc->isValid(&_sceneSpecialScripts[_lastProcessedSceneScript])) { - _emc->start(&_sceneSpecialScripts[_lastProcessedSceneScript], 9+_lastProcessedSceneScript); - _specialSceneScriptRunFlag = false; - } - - ++_lastProcessedSceneScript; - if (_lastProcessedSceneScript >= 10) - _lastProcessedSceneScript = 0; - - if (_lastProcessedSceneScript == startScript) - return; - } -} - -int KyraEngine_v3::trySceneChange(int *moveTable, int unk1, int updateChar) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar); +int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::trySceneChange(%p, %d, %d)", (const void*)moveTable, unk1, updateChar); bool running = true; bool unkFlag = false; int changedScene = 0; @@ -738,8 +701,8 @@ int KyraEngine_v3::trySceneChange(int *moveTable, int unk1, int updateChar) { return changedScene; } -int KyraEngine_v3::checkSceneChange() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::checkSceneChange()"); +int KyraEngine_MR::checkSceneChange() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::checkSceneChange()"); const SceneDesc &curScene = _sceneList[_mainCharacter.sceneId]; int charX = _mainCharacter.x1, charY = _mainCharacter.y1; int facing = 0; @@ -791,8 +754,8 @@ int KyraEngine_v3::checkSceneChange() { enterNewScene(newScene, facing, 1, 1, 0); return 1; } -int KyraEngine_v3::runSceneScript1(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript1(%d, %d)", x, y); +int KyraEngine_MR::runSceneScript1(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript1(%d, %d)", x, y); if (y > 187 && _unk3 > -4) return 0; if (_deathHandler >= 0) @@ -811,8 +774,8 @@ int KyraEngine_v3::runSceneScript1(int x, int y) { return _sceneScriptState.regs[3]; } -int KyraEngine_v3::runSceneScript2() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript2()"); +int KyraEngine_MR::runSceneScript2() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript2()"); _sceneScriptState.regs[1] = _mouseX; _sceneScriptState.regs[2] = _mouseY; _sceneScriptState.regs[3] = 0; @@ -825,8 +788,8 @@ int KyraEngine_v3::runSceneScript2() { return _sceneScriptState.regs[3]; } -void KyraEngine_v3::runSceneScript4(int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript4(%d)", unk1); +void KyraEngine_MR::runSceneScript4(int unk1) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript4(%d)", unk1); _sceneScriptState.regs[4] = _itemInHand; _sceneScriptState.regs[5] = unk1; _sceneScriptState.regs[3] = 0; @@ -840,8 +803,8 @@ void KyraEngine_v3::runSceneScript4(int unk1) { _noStartupChat = true; } -void KyraEngine_v3::runSceneScript6() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript6()"); +void KyraEngine_MR::runSceneScript6() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript6()"); _emc->init(&_sceneScriptState, &_sceneScriptData); _sceneScriptState.regs[0] = _mainCharacter.sceneId; @@ -854,8 +817,8 @@ void KyraEngine_v3::runSceneScript6() { _emc->run(&_sceneScriptState); } -void KyraEngine_v3::runSceneScript8() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runSceneScript8()"); +void KyraEngine_MR::runSceneScript8() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runSceneScript8()"); _emc->start(&_sceneScriptState, 8); while (_emc->isValid(&_sceneScriptState)) { musicUpdate(0); @@ -863,25 +826,8 @@ void KyraEngine_v3::runSceneScript8() { } } -bool KyraEngine_v3::checkSpecialSceneExit(int index, int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::checkSpecialSceneExit(%d, %d, %d)", index, x, y); - if (_specialExitTable[index] < x && _specialExitTable[5+index] < y && - _specialExitTable[10+index] > x && _specialExitTable[15+index] > y) - return true; - - return false; -} - -int KyraEngine_v3::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize); - int ret = KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize); - if (ret == 0x7D00) - return 0; - return getMoveTableSize(moveTable); -} - -bool KyraEngine_v3::lineIsPassable(int x, int y) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::lineIsPassable(%d, %d)", x, y); +bool KyraEngine_MR::lineIsPassable(int x, int y) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::lineIsPassable(%d, %d)", x, y); static const uint8 widthTable[] = { 1, 1, 1, 1, 1, 2, 4, 6, 8 }; if ((_pathfinderFlag & 2) && x >= 320) diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index de0c079293..298483465e 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -3112,305 +3112,5 @@ void Screen::drawCharSJIS(uint16 c, int x, int y) { #pragma mark - -uint8 *ScreenEx::generateOverlay(const uint8 *palette, uint8 *buffer, int startColor, uint16 factor) { - if (!palette || !buffer) - return buffer; - - factor = MIN<uint16>(255, factor); - factor >>= 1; - factor &= 0xFF; - - const byte col1 = palette[startColor * 3 + 0]; - const byte col2 = palette[startColor * 3 + 1]; - const byte col3 = palette[startColor * 3 + 2]; - - uint8 *dst = buffer; - *dst++ = 0; - - for (int i = 1; i != 255; ++i) { - uint8 processedPalette[3]; - const uint8 *src = palette + i*3; - byte col; - - col = *src++; - col -= ((((col - col1) * factor) << 1) >> 8) & 0xFF; - processedPalette[0] = col; - - col = *src++; - col -= ((((col - col2) * factor) << 1) >> 8) & 0xFF; - processedPalette[1] = col; - - col = *src++; - col -= ((((col - col3) * factor) << 1) >> 8) & 0xFF; - processedPalette[2] = col; - - *dst++ = findLeastDifferentColor(processedPalette, palette+3, 255)+1; - } - - return buffer; -} - -void ScreenEx::applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay) { - if (pageNum == 0 || pageNum == 1) - addDirtyRect(x, y, w, h); - - uint8 *dst = getPagePtr(pageNum) + y * 320 + x; - while (h--) { - for (int wi = 0; wi < w; ++wi) { - uint8 index = *dst; - *dst++ = overlay[index]; - } - dst += 320 - w; - } -} - -int ScreenEx::findLeastDifferentColor(const uint8 *paletteEntry, const uint8 *palette, uint16 numColors) { - int m = 0x7fff; - int r = 0x101; - - for (int i = 0; i < numColors; i++) { - int v = paletteEntry[0] - *palette++; - int c = v * v; - v = paletteEntry[1] - *palette++; - c += (v * v); - v = paletteEntry[2] - *palette++; - c += (v * v); - - if (c <= m) { - m = c; - r = i; - } - } - - return r; -} - -void ScreenEx::copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src, - int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2) { - uint8 *dstPtr = getPagePtr(_curPage); - uint8 *origDst = dstPtr; - - const ScreenDim *dim = getScreenDim(dimState); - int dimX1 = dim->sx << 3; - int dimX2 = dim->w << 3; - dimX2 += dimX1; - - int dimY1 = dim->sy; - int dimY2 = dim->h; - dimY2 += dimY1; - - int temp = y - dimY1; - if (temp < 0) { - if ((temp += h) <= 0) - return; - else { - SWAP(temp, h); - y += temp - h; - src += (temp - h) * w; - } - } - - temp = dimY2 - y; - if (temp <= 0) - return; - - if (temp < h) - h = temp; - - int srcOffset = 0; - temp = x - dimX1; - if (temp < 0) { - temp = -temp; - srcOffset = temp; - x += temp; - w -= temp; - } - - int srcAdd = 0; - - temp = dimX2 - x; - if (temp <= 0) - return; - - if (temp < w) { - SWAP(w, temp); - temp -= w; - srcAdd = temp; - } - - dstPtr += y * SCREEN_W + x; - uint8 *dst = dstPtr; - - if (_curPage == 0 || _curPage == 1) - addDirtyRect(x, y, w, h); - - clearOverlayRect(_curPage, x, y, w, h); - - temp = h; - int curY = y; - while (h--) { - src += srcOffset; - ++curY; - int cW = w; - - switch (plotFunc) { - case 0: - memcpy(dst, src, cW); - dst += cW; src += cW; - break; - - case 1: - while (cW--) { - uint8 d = *src++; - uint8 t = unkPtr1[d]; - if (t != 0xFF) - d = unkPtr2[*dst + (t << 8)]; - *dst++ = d; - } - break; - - case 4: - while (cW--) { - uint8 d = *src++; - if (d) - *dst = d; - ++dst; - } - break; - - case 5: - while (cW--) { - uint8 d = *src++; - if (d) { - uint8 t = unkPtr1[d]; - if (t != 0xFF) - d = unkPtr2[*dst + (t << 8)]; - *dst = d; - } - ++dst; - } - break; - - case 8: - case 9: - while (cW--) { - uint8 d = *src++; - uint8 t = _shapePages[0][dst - origDst] & 7; - if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY)) - d = _shapePages[1][dst - origDst]; - *dst++ = d; - } - break; - - case 12: - case 13: - while (cW--) { - uint8 d = *src++; - if (d) { - uint8 t = _shapePages[0][dst - origDst] & 7; - if (unk1 < t && (curY > _maskMinY && curY < _maskMaxY)) - d = _shapePages[1][dst - origDst]; - *dst++ = d; - } else { - d = _shapePages[1][dst - origDst]; - *dst++ = d; - } - } - break; - - default: - break; - } - - dst = (dstPtr += SCREEN_W); - src += srcAdd; - } -} - -const uint8 *ScreenEx::getPtrToShape(const uint8 *shpFile, int shape) { - debugC(9, kDebugLevelScreen, "ScreenEx::getPtrToShape(%p, %d)", (const void *)shpFile, shape); - uint16 shapes = READ_LE_UINT16(shpFile); - - if (shapes <= shape) - return 0; - - uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2); - - return shpFile + offset + 2; -} - -uint8 *ScreenEx::getPtrToShape(uint8 *shpFile, int shape) { - debugC(9, kDebugLevelScreen, "ScreenEx::getPtrToShape(%p, %d)", (void *)shpFile, shape); - uint16 shapes = READ_LE_UINT16(shpFile); - - if (shapes <= shape) - return 0; - - uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2); - - return shpFile + offset + 2; -} - -int ScreenEx::getShapeScaledWidth(const uint8 *shpFile, int scale) { - int width = READ_LE_UINT16(shpFile+3); - return (width * scale) >> 8; -} - -int ScreenEx::getShapeScaledHeight(const uint8 *shpFile, int scale) { - int height = shpFile[2]; - return (height * scale) >> 8; -} - -uint16 ScreenEx::getShapeSize(const uint8 *shp) { - debugC(9, kDebugLevelScreen, "ScreenEx::getShapeSize(%p)", (const void *)shp); - - return READ_LE_UINT16(shp+6); -} - -uint8 *ScreenEx::makeShapeCopy(const uint8 *src, int index) { - debugC(9, kDebugLevelScreen, "ScreenEx::makeShapeCopy(%p, %d)", (const void *)src, index); - - const uint8 *shape = getPtrToShape(src, index); - int size = getShapeSize(shape); - - uint8 *copy = new uint8[size]; - assert(copy); - memcpy(copy, shape, size); - - return copy; -} - -int ScreenEx::getLayer(int x, int y) { - if (x < 0) - x = 0; - else if (x >= 320) - x = 319; - if (y < 0) - y = 0; - else if (y >= 144) - y = 143; - - uint8 pixel = *(getCPagePtr(5) + y * 320 + x); - pixel &= 0x7F; - pixel >>= 3; - - if (pixel < 1) - pixel = 1; - else if (pixel > 15) - pixel = 15; - return pixel; -} - -int ScreenEx::getRectSize(int w, int h) { - if (w > 320 || h > 200) - return 0; - return w*h; -} - -void ScreenEx::setTextColorMap(const uint8 *cmap) { - debugC(9, kDebugLevelScreen, "ScreenEx::setTextColorMap(%p)", (const void *)cmap); - setTextColor(cmap, 0, 15); -} - } // End of namespace Kyra diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 5e806b36fc..bf23747daf 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -358,41 +358,6 @@ protected: bool _debugEnabled; }; -class ScreenEx : public Screen { -public: - ScreenEx(KyraEngine *vm, OSystem *system) : Screen(vm, system) {} - - // screen page handling - void copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src, - int unk1, const uint8 *unkPtr1, const uint8 *unkPtr2); - - // palette handling - uint8 *generateOverlay(const uint8 *palette, uint8 *buffer, int color, uint16 factor); - void applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay); - int findLeastDifferentColor(const uint8 *paletteEntry, const uint8 *palette, uint16 numColors); - - // shape handling - uint8 *getPtrToShape(uint8 *shpFile, int shape); - const uint8 *getPtrToShape(const uint8 *shpFile, int shape); - - int getShapeScaledWidth(const uint8 *shpFile, int scale); - int getShapeScaledHeight(const uint8 *shpFile, int scale); - - uint16 getShapeSize(const uint8 *shp); - - uint8 *makeShapeCopy(const uint8 *src, int index); - - // rect handling - int getRectSize(int w, int h); - - // text display - void setTextColorMap(const uint8 *cmap); - - // layer handling - virtual int getLayer(int x, int y); -protected: -}; - } // End of namespace Kyra #endif diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_hof.cpp index f3eb840ca2..9192626159 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_hof.cpp @@ -25,34 +25,34 @@ #include "common/endian.h" -#include "kyra/kyra_v2.h" -#include "kyra/screen_v2.h" +#include "kyra/kyra_hof.h" +#include "kyra/screen_hof.h" namespace Kyra { -Screen_v2::Screen_v2(KyraEngine_v2 *vm, OSystem *system) - : ScreenEx(vm, system) { +Screen_HoF::Screen_HoF(KyraEngine_HoF *vm, OSystem *system) + : Screen_v2(vm, system) { _vm = vm; _wsaFrameAnimBuffer = new uint8[1024]; } -Screen_v2::~Screen_v2() { +Screen_HoF::~Screen_HoF() { delete [] _wsaFrameAnimBuffer; } -void Screen_v2::setScreenDim(int dim) { - debugC(9, kDebugLevelScreen, "Screen_v2::setScreenDim(%d)", dim); +void Screen_HoF::setScreenDim(int dim) { + debugC(9, kDebugLevelScreen, "Screen_HoF::setScreenDim(%d)", dim); assert(dim < _screenDimTableCount); _curDim = &_screenDimTable[dim]; } -const ScreenDim *Screen_v2::getScreenDim(int dim) { - debugC(9, kDebugLevelScreen, "Screen_v2::getScreenDim(%d)", dim); +const ScreenDim *Screen_HoF::getScreenDim(int dim) { + debugC(9, kDebugLevelScreen, "Screen_HoF::getScreenDim(%d)", dim); assert(dim < _screenDimTableCount); return &_screenDimTable[dim]; } -void Screen_v2::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag) { +void Screen_HoF::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag) { uint8 tmpPal[768]; for (int i = 0; i != lastColor; i++) { @@ -74,7 +74,7 @@ void Screen_v2::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int grayOverlay[i] = findLeastDifferentColor(tmpPal + 3 * i, srcPal, lastColor); } -void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2, +void Screen_HoF::wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) { if (!(w1 || h1 || w2 || h2)) @@ -144,7 +144,7 @@ void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2, } while (++nb < h2); } -void Screen_v2::cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW, +void Screen_HoF::cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW, int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage) { if (!(cmpW || cmpH )) @@ -186,14 +186,14 @@ void Screen_v2::cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int } } -void Screen_v2::copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes) { +void Screen_HoF::copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes) { const uint8 *src = getPagePtr(srcPage) + srcPos; uint8 *dst = getPagePtr(dstPage) + dstPos; memcpy(dst, src, numBytes); } -void Screen_v2::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) { +void Screen_HoF::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) { int x0 = dim->sx << 3; int y0 = dim->sy; int w0 = dim->w << 3; @@ -229,7 +229,7 @@ void Screen_v2::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int d } } -bool Screen_v2::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) { +bool Screen_HoF::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) { x2 = 0; y2 = 0; w2 = w1; diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_hof.h index 665f71ace4..a6df749538 100644 --- a/engines/kyra/screen_v2.h +++ b/engines/kyra/screen_hof.h @@ -23,23 +23,23 @@ * */ -#ifndef KYRA_SCREEN_V2_H -#define KYRA_SCREEN_V2_H +#ifndef KYRA_SCREEN_HOF_H +#define KYRA_SCREEN_HOF_H -#include "kyra/screen.h" +#include "kyra/screen_v2.h" namespace Kyra { -class KyraEngine_v2; +class KyraEngine_HoF; -class Screen_v2 : public ScreenEx { +class Screen_HoF : public Screen_v2 { friend class Debugger_v2; public: - Screen_v2(KyraEngine_v2 *vm, OSystem *system); - virtual ~Screen_v2(); + Screen_HoF(KyraEngine_HoF *vm, OSystem *system); + ~Screen_HoF(); - virtual void setScreenDim(int dim); - virtual const ScreenDim *getScreenDim(int dim); + void setScreenDim(int dim); + const ScreenDim *getScreenDim(int dim); // sequence player void generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag); @@ -49,7 +49,7 @@ public: void copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes); void copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *d, bool flag = false); private: - KyraEngine_v2 *_vm; + KyraEngine_HoF *_vm; static const ScreenDim _screenDimTable[]; static const int _screenDimTableCount; @@ -60,3 +60,4 @@ private: } // End of namespace Kyra #endif + diff --git a/engines/kyra/screen_v3.cpp b/engines/kyra/screen_mr.cpp index 938307b774..0fcfe00879 100644 --- a/engines/kyra/screen_v3.cpp +++ b/engines/kyra/screen_mr.cpp @@ -23,32 +23,32 @@ * */ -#include "kyra/screen_v3.h" +#include "kyra/screen_mr.h" -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" namespace Kyra { -Screen_v3::Screen_v3(KyraEngine_v3 *vm, OSystem *system) : ScreenEx(vm, system) { +Screen_MR::Screen_MR(KyraEngine_MR *vm, OSystem *system) : Screen_v2(vm, system) { } -Screen_v3::~Screen_v3() { +Screen_MR::~Screen_MR() { } -void Screen_v3::setScreenDim(int dim) { - debugC(9, kDebugLevelScreen, "Screen_v3::setScreenDim(%d)", dim); +void Screen_MR::setScreenDim(int dim) { + debugC(9, kDebugLevelScreen, "Screen_MR::setScreenDim(%d)", dim); assert(dim < _screenDimTableCount); _curDim = &_screenDimTable[dim]; } -const ScreenDim *Screen_v3::getScreenDim(int dim) { - debugC(9, kDebugLevelScreen, "Screen_v3::getScreenDim(%d)", dim); +const ScreenDim *Screen_MR::getScreenDim(int dim) { + debugC(9, kDebugLevelScreen, "Screen_MR::getScreenDim(%d)", dim); assert(dim < _screenDimTableCount); return &_screenDimTable[dim]; } -int Screen_v3::getLayer(int x, int y) { - debugC(9, kDebugLevelScreen, "Screen_v3::getLayer(%d, %d)", x, y); +int Screen_MR::getLayer(int x, int y) { + debugC(9, kDebugLevelScreen, "Screen_MR::getLayer(%d, %d)", x, y); if (x < 0) x = 0; else if (x >= 320) @@ -72,8 +72,8 @@ int Screen_v3::getLayer(int x, int y) { return pixel; } -byte Screen_v3::getShapeFlag1(int x, int y) { - debugC(9, kDebugLevelScreen, "Screen_v3::getShapeFlag1(%d, %d)", x, y); +byte Screen_MR::getShapeFlag1(int x, int y) { + debugC(9, kDebugLevelScreen, "Screen_MR::getShapeFlag1(%d, %d)", x, y); if (y < _maskMinY || y > _maskMaxY) return 0; @@ -86,8 +86,8 @@ byte Screen_v3::getShapeFlag1(int x, int y) { return 0; } -byte Screen_v3::getShapeFlag2(int x, int y) { - debugC(9, kDebugLevelScreen, "Screen_v3::getShapeFlag2(%d, %d)", x, y); +byte Screen_MR::getShapeFlag2(int x, int y) { + debugC(9, kDebugLevelScreen, "Screen_MR::getShapeFlag2(%d, %d)", x, y); if (y < _maskMinY || y > _maskMaxY) return 0; @@ -97,8 +97,8 @@ byte Screen_v3::getShapeFlag2(int x, int y) { return color; } -int Screen_v3::getDrawLayer(int x, int y) { - debugC(9, kDebugLevelScreen, "Screen_v3::getDrawLayer(%d, %d)", x, y); +int Screen_MR::getDrawLayer(int x, int y) { + debugC(9, kDebugLevelScreen, "Screen_MR::getDrawLayer(%d, %d)", x, y); int xpos = x - 8; int ypos = y; int layer = 1; @@ -115,8 +115,8 @@ int Screen_v3::getDrawLayer(int x, int y) { return layer; } -int Screen_v3::getDrawLayer2(int x, int y, int height) { - debugC(9, kDebugLevelScreen, "Screen_v3::getDrawLayer2(%d, %d, %d)", x, y, height); +int Screen_MR::getDrawLayer2(int x, int y, int height) { + debugC(9, kDebugLevelScreen, "Screen_MR::getDrawLayer2(%d, %d, %d)", x, y, height); int xpos = x - 8; int ypos = y; int layer = 1; diff --git a/engines/kyra/screen_v3.h b/engines/kyra/screen_mr.h index dc49268ad6..fe3ae2a930 100644 --- a/engines/kyra/screen_v3.h +++ b/engines/kyra/screen_mr.h @@ -23,22 +23,22 @@ * */ -#ifndef KYRA_SCREEN_V3_H -#define KYRA_SCREEN_V3_H +#ifndef KYRA_SCREEN_MR_H +#define KYRA_SCREEN_MR_H -#include "kyra/screen.h" +#include "kyra/screen_v2.h" namespace Kyra { -class KyraEngine_v3; +class KyraEngine_MR; -class Screen_v3 : public ScreenEx { +class Screen_MR : public Screen_v2 { public: - Screen_v3(KyraEngine_v3 *vm, OSystem *system); - virtual ~Screen_v3(); + Screen_MR(KyraEngine_MR *vm, OSystem *system); + ~Screen_MR(); - virtual void setScreenDim(int dim); - virtual const ScreenDim *getScreenDim(int dim); + void setScreenDim(int dim); + const ScreenDim *getScreenDim(int dim); int getLayer(int x, int y); diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_hof.cpp index 585ce98295..25c1499df6 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_hof.cpp @@ -23,19 +23,20 @@ * */ -#include "kyra/kyra_v2.h" -#include "kyra/text_v2.h" +#include "kyra/kyra_hof.h" +#include "kyra/text_hof.h" #include "kyra/wsamovie.h" #include "kyra/sound.h" #include "kyra/timer.h" #include "kyra/script_tim.h" +#include "kyra/resource.h" #include "common/endian.h" namespace Kyra { -int KyraEngine_v2::o2_setCharacterFacingRefresh(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_setCharacterFacingRefresh(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); int animFrame = stackPos(2); if (animFrame >= 0) _mainCharacter.animFrame = animFrame; @@ -45,8 +46,8 @@ int KyraEngine_v2::o2_setCharacterFacingRefresh(EMCState *script) { return 0; } -int KyraEngine_v2::o2_setCharacterPos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_setCharacterPos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); int x = stackPos(1); int y = stackPos(2); @@ -61,8 +62,8 @@ int KyraEngine_v2::o2_setCharacterPos(EMCState *script) { return 0; } -int KyraEngine_v2::o2_defineObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineObject(%p) (%d, '%s', %d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_defineObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineObject(%p) (%d, '%s', %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); TalkObject *object = &_talkObjectList[stackPos(0)]; strcpy(object->filename, stackPosString(1)); @@ -73,8 +74,8 @@ int KyraEngine_v2::o2_defineObject(EMCState *script) { return 0; } -int KyraEngine_v2::o2_refreshCharacter(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_refreshCharacter(%p) (-, %d, %d, %d)", (const void *)script, stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_HoF::o2_refreshCharacter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_refreshCharacter(%p) (-, %d, %d, %d)", (const void *)script, stackPos(1), stackPos(2), stackPos(3)); int unk = stackPos(1); int facing = stackPos(2); int refresh = stackPos(3); @@ -88,34 +89,34 @@ int KyraEngine_v2::o2_refreshCharacter(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getCharacterX(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterX(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getCharacterX(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getCharacterX(%p) ()", (const void *)script); return _mainCharacter.x1; } -int KyraEngine_v2::o2_getCharacterY(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterY(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getCharacterY(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getCharacterY(%p) ()", (const void *)script); return _mainCharacter.y1; } -int KyraEngine_v2::o2_getCharacterFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterFacing(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getCharacterFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getCharacterFacing(%p) ()", (const void *)script); return _mainCharacter.facing; } -int KyraEngine_v2::o2_getCharacterScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCharacterScene(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getCharacterScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getCharacterScene(%p) ()", (const void *)script); return _mainCharacter.sceneId; } -int KyraEngine_v2::o2_setSceneComment(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneComment(%p) ('%s')", (const void *)script, stackPosString(0)); +int KyraEngine_HoF::o2_setSceneComment(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneComment(%p) ('%s')", (const void *)script, stackPosString(0)); _sceneCommentString = stackPosString(0); return 0; } -int KyraEngine_v2::o2_setCharacterAnimFrame(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterAnimFrame(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_setCharacterAnimFrame(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterAnimFrame(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); int animFrame = stackPos(1); int updateAnim = stackPos(2); @@ -126,15 +127,15 @@ int KyraEngine_v2::o2_setCharacterAnimFrame(EMCState *script) { return 0; } -int KyraEngine_v2::o2_setCharacterFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setCharacterFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0)); _mainCharacter.facing = stackPos(0); _overwriteSceneFacing = 1; return 0; } -int KyraEngine_v2::o2_trySceneChange(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_trySceneChange(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _unkHandleSceneChangeFlag = 1; @@ -152,46 +153,46 @@ int KyraEngine_v2::o2_trySceneChange(EMCState *script) { } } -int KyraEngine_v2::o2_moveCharacter(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_moveCharacter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); moveCharacter(stackPos(0), stackPos(1), stackPos(2)); return 0; } -int KyraEngine_v2::o2_customCharacterChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customCharacterChat(%p) ('%s', %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); +int KyraEngine_HoF::o2_customCharacterChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_customCharacterChat(%p) ('%s', %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); playVoice(_vocHigh, stackPos(4)); _text->printCustomCharacterText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), 0, 2); return 0; } -int KyraEngine_v2::o2_soundFadeOut(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_soundFadeOut(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_soundFadeOut(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_soundFadeOut(%p) ()", (const void *)script); _sound->beginFadeOut(); return 0; } -int KyraEngine_v2::o2_showChapterMessage(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showChapterMessage(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_showChapterMessage(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showChapterMessage(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); showChapterMessage(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_restoreTalkTextMessageBkgd(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreTalkTextMessageBkgd(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_restoreTalkTextMessageBkgd(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreTalkTextMessageBkgd(%p) ()", (const void *)script); _text->restoreTalkTextMessageBkgd(2, 0); return 0; } -int KyraEngine_v2::o2_wsaClose(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_wsaClose(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_wsaClose(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wsaClose(%p) (%d)", (const void *)script, stackPos(0)); assert(stackPos(0) >= 0 && stackPos(0) < ARRAYSIZE(_wsaSlots)); _wsaSlots[stackPos(0)]->close(); return 0; } -int KyraEngine_v2::o2_meanWhileScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_meanWhileScene(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_meanWhileScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_meanWhileScene(%p) (%d)", (const void *)script, stackPos(0)); static const uint8 jpSubtitle[] = { 0x88, 0xEA, 0x95, 0xFB, 0x81, 0x45, 0x81, 0x45, 0x81, 0x45 }; const char *cpsfile = stackPosString(0); const char *palfile = stackPosString(1); @@ -211,20 +212,20 @@ int KyraEngine_v2::o2_meanWhileScene(EMCState *script) { return 0; } -int KyraEngine_v2::o2_backUpScreen(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_backUpScreen(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_backUpScreen(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_backUpScreen(%p) (%d)", (const void *)script, stackPos(0)); _screen->copyRegionToBuffer(stackPos(0), 0, 0, 320, 144, _screenBuffer); return 0; } -int KyraEngine_v2::o2_restoreScreen(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreScreen(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_restoreScreen(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreScreen(%p) (%d)", (const void *)script, stackPos(0)); _screen->copyBlockToPage(stackPos(0), 0, 0, 320, 144, _screenBuffer); return 0; } -int KyraEngine_v2::o2_displayWsaFrame(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaFrame(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_displayWsaFrame(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaFrame(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8)); int frame = stackPos(0); int x = stackPos(1); @@ -258,8 +259,8 @@ int KyraEngine_v2::o2_displayWsaFrame(EMCState *script) { return 0; } -int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaSequentialFramesLooping(%p) (%d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(%p) (%d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7)); int startFrame = stackPos(0); int endFrame = stackPos(1); @@ -321,15 +322,15 @@ int KyraEngine_v2::o2_displayWsaSequentialFramesLooping(EMCState *script) { return 0; } -int KyraEngine_v2::o2_wsaOpen(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_wsaOpen(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); +int KyraEngine_HoF::o2_wsaOpen(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wsaOpen(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); assert(stackPos(1) >= 0 && stackPos(1) < ARRAYSIZE(_wsaSlots)); _wsaSlots[stackPos(1)]->open(stackPosString(0), 1, 0); return 0; } -int KyraEngine_v2::o2_displayWsaSequentialFrames(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaSequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6)); +int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaSequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6)); uint16 frameDelay = stackPos(2) * _tickLength; uint16 currentFrame = stackPos(3); @@ -358,8 +359,8 @@ int KyraEngine_v2::o2_displayWsaSequentialFrames(EMCState *script) { return 0; } -int KyraEngine_v2::o2_displayWsaSequence(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_displayWsaSequence(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); +int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_displayWsaSequence(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); const int frameDelay = stackPos(2) * _tickLength; const int index = stackPos(3); @@ -392,8 +393,8 @@ int KyraEngine_v2::o2_displayWsaSequence(EMCState *script) { return 0; } -int KyraEngine_v2::o2_addItemToInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addItemToInventory(%p) (%d, -, %d)", (const void *)script, stackPos(0), stackPos(2)); +int KyraEngine_HoF::o2_addItemToInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addItemToInventory(%p) (%d, -, %d)", (const void *)script, stackPos(0), stackPos(2)); int slot = findFreeVisibleInventorySlot(); if (slot != -1) { _mainCharacter.inventory[slot] = stackPos(0); @@ -403,8 +404,8 @@ int KyraEngine_v2::o2_addItemToInventory(EMCState *script) { return slot; } -int KyraEngine_v2::o2_drawShape(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); +int KyraEngine_HoF::o2_drawShape(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); uint8 *shp = getShapePtr(stackPos(0) + 64); int x = stackPos(1); @@ -422,7 +423,7 @@ int KyraEngine_v2::o2_drawShape(EMCState *script) { _screen->drawShape(0, shp, x, y, 2, dsFlag ? 1 : 0); flagAnimObjsForRefresh(); - flagAnimObjsUnk8(); + flagAnimObjsSpecialRefresh(); refreshAnimObjectsIfNeed(); _screen->showMouse(); } @@ -430,8 +431,8 @@ int KyraEngine_v2::o2_drawShape(EMCState *script) { return 0; } -int KyraEngine_v2::o2_addItemToCurScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_addItemToCurScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const int16 id = stackPos(0); int x = stackPos(1); int y = stackPos(2); @@ -452,26 +453,26 @@ int KyraEngine_v2::o2_addItemToCurScene(EMCState *script) { return 0; } -int KyraEngine_v2::o2_checkForItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_checkForItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return findItem(stackPos(0), stackPos(1)) == -1 ? 0 : 1; } -int KyraEngine_v2::o2_loadSoundFile(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadSoundFile(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_loadSoundFile(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadSoundFile(%p) (%d)", (const void *)script, stackPos(0)); if (_sound->hasSoundFile(stackPos(0))) snd_playTheme(stackPos(0), -1); return 0; } -int KyraEngine_v2::o2_removeItemSlotFromInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeItemSlotFromInventory(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_removeItemSlotFromInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeItemSlotFromInventory(%p) (%d)", (const void *)script, stackPos(0)); removeItemFromInventory(stackPos(0)); return 0; } -int KyraEngine_v2::o2_defineItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineItem(%p) (%d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_defineItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineItem(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int freeItem = findFreeItem(); @@ -485,8 +486,8 @@ int KyraEngine_v2::o2_defineItem(EMCState *script) { return freeItem; } -int KyraEngine_v2::o2_removeItemFromInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeItemFromInventory(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_removeItemFromInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeItemFromInventory(%p) (%d)", (const void *)script, stackPos(0)); uint16 item = stackPos(0); int slot = -1; while ((slot = getInventoryItemSlot(item)) != -1) @@ -494,8 +495,8 @@ int KyraEngine_v2::o2_removeItemFromInventory(EMCState *script) { return 0; } -int KyraEngine_v2::o2_countItemInInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_countItemInInventory(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_countItemInInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_countItemInInventory(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); uint16 item = stackPos(1); int count = 0; @@ -510,8 +511,8 @@ int KyraEngine_v2::o2_countItemInInventory(EMCState *script) { return count; } -int KyraEngine_v2::o2_countItemsInScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_countItemsInScene(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_countItemsInScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_countItemsInScene(%p) (%d)", (const void *)script, stackPos(0)); int count = 0; for (int i = 0; i < 30; ++i) { if (_itemList[i].sceneId == stackPos(0) && _itemList[i].id != 0xFFFF) @@ -520,46 +521,46 @@ int KyraEngine_v2::o2_countItemsInScene(EMCState *script) { return count; } -int KyraEngine_v2::o2_queryGameFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_queryGameFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0)); return queryGameFlag(stackPos(0)); } -int KyraEngine_v2::o2_resetGameFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_resetGameFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0)); return resetGameFlag(stackPos(0)); } -int KyraEngine_v2::o2_setGameFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setGameFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setGameFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setGameFlag(%p) (%d)", (const void *)script, stackPos(0)); return setGameFlag(stackPos(0)); } -int KyraEngine_v2::o2_setHandItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setHandItem(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setHandItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setHandItem(%p) (%d)", (const void *)script, stackPos(0)); setHandItem(stackPos(0)); return 0; } -int KyraEngine_v2::o2_removeHandItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeHandItem(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_removeHandItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeHandItem(%p) ()", (const void *)script); removeHandItem(); return 0; } -int KyraEngine_v2::o2_handItemSet(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_handItemSet(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_handItemSet(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_handItemSet(%p) ()", (const void *)script); return _handItemSet; } -int KyraEngine_v2::o2_hideMouse(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_hideMouse(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_hideMouse(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_hideMouse(%p) ()", (const void *)script); _screen->hideMouse(); return 0; } -int KyraEngine_v2::o2_addSpecialExit(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_addSpecialExit(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); if (_specialExitCount < 5) { _specialExitTable[_specialExitCount+0] = stackPos(0); @@ -572,20 +573,20 @@ int KyraEngine_v2::o2_addSpecialExit(EMCState *script) { return 0; } -int KyraEngine_v2::o2_setMousePos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setMousePos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setMousePos(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_showMouse(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showMouse(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_showMouse(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showMouse(%p) ()", (const void *)script); _screen->showMouse(); return 0; } -int KyraEngine_v2::o2_wipeDownMouseItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_wipeDownMouseItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); _screen->hideMouse(); const int x = stackPos(1) - 8; const int y = stackPos(2) - 15; @@ -611,24 +612,24 @@ int KyraEngine_v2::o2_wipeDownMouseItem(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getElapsedSecs(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getElapsedSecs(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getElapsedSecs(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getElapsedSecs(%p) ()", (const void *)script); return _system->getMillis() / 1000; } -int KyraEngine_v2::o2_getTimerDelay(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getTimerDelay(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_getTimerDelay(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getTimerDelay(%p) (%d)", (const void *)script, stackPos(0)); return _timer->getDelay(stackPos(0)); } -int KyraEngine_v2::o2_delaySecs(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delaySecs(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_delaySecs(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_delaySecs(%p) (%d)", (const void *)script, stackPos(0)); delay(stackPos(0) * 1000, true); return 0; } -int KyraEngine_v2::o2_delay(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_delay(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); if (stackPos(1)) { uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength; while (_system->getMillis() < maxWaitTime) { @@ -650,38 +651,38 @@ int KyraEngine_v2::o2_delay(EMCState *script) { return 0; } -int KyraEngine_v2::o2_setTimerDelay(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setTimerDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setTimerDelay(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setTimerDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _timer->setDelay(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_setScaleTableItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setScaleTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setScaleTableItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setScaleTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setScaleTableItem(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_setDrawLayerTableItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDrawLayerTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setDrawLayerTableItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setDrawLayerTableItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setDrawLayerTableEntry(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_setCharPalEntry(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharPalEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setCharPalEntry(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCharPalEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setCharPalEntry(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_loadZShapes(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_loadZShapes(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0)); loadZShapes(stackPos(0)); return 0; } -int KyraEngine_v2::o2_drawSceneShape(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShape(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), +int KyraEngine_HoF::o2_drawSceneShape(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawSceneShape(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int shape = stackPos(0); @@ -698,15 +699,15 @@ int KyraEngine_v2::o2_drawSceneShape(EMCState *script) { _screen->drawShape(0, _sceneShapeTable[shape], x, y, 2, flag); - flagAnimObjsUnk8(); + flagAnimObjsSpecialRefresh(); flagAnimObjsForRefresh(); refreshAnimObjectsIfNeed(); _screen->showMouse(); return 0; } -int KyraEngine_v2::o2_drawSceneShapeOnPage(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShapeOnPage(%p) (%d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_drawSceneShapeOnPage(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawSceneShapeOnPage(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); int shape = stackPos(0); int x = stackPos(1); @@ -718,34 +719,34 @@ int KyraEngine_v2::o2_drawSceneShapeOnPage(EMCState *script) { return 0; } -int KyraEngine_v2::o2_disableAnimObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_disableAnimObject(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_disableAnimObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_disableAnimObject(%p) (%d)", (const void *)script, stackPos(0)); _animObjects[stackPos(0)+1].enabled = false; return 0; } -int KyraEngine_v2::o2_enableAnimObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enableAnimObject(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_enableAnimObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enableAnimObject(%p) (%d)", (const void *)script, stackPos(0)); _animObjects[stackPos(0)+1].enabled = true; return 0; } -int KyraEngine_v2::o2_loadPalette384(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadPalette384(%p) ('%s')", (const void *)script, stackPosString(0)); +int KyraEngine_HoF::o2_loadPalette384(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadPalette384(%p) ('%s')", (const void *)script, stackPosString(0)); memcpy(_screen->getPalette(1), _screen->getPalette(0), 768); _res->loadFileToBuf(stackPosString(0), _screen->getPalette(1), 384); return 0; } -int KyraEngine_v2::o2_setPalette384(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setPalette384(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_setPalette384(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setPalette384(%p) ()", (const void *)script); memcpy(_screen->getPalette(0), _screen->getPalette(1), 384); _screen->setScreenPalette(_screen->getPalette(0)); return 0; } -int KyraEngine_v2::o2_restoreBackBuffer(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreBackBuffer(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_restoreBackBuffer(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreBackBuffer(%p) (%d)", (const void *)script, stackPos(0)); int disable = stackPos(0); int oldState = 0; @@ -762,41 +763,41 @@ int KyraEngine_v2::o2_restoreBackBuffer(EMCState *script) { return 0; } -int KyraEngine_v2::o2_backUpInventoryGfx(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_backUpInventoryGfx(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_backUpInventoryGfx(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_backUpInventoryGfx(%p) ()", (const void *)script); _screen->copyRegionToBuffer(1, 0, 144, 320, 56, _screenBuffer); _inventorySaved = true; return 0; } -int KyraEngine_v2::o2_disableSceneAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_disableSceneAnim(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_disableSceneAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_disableSceneAnim(%p) (%d)", (const void *)script, stackPos(0)); _sceneAnims[stackPos(0)].flags &= ~1; return 0; } -int KyraEngine_v2::o2_enableSceneAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enableSceneAnim(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_enableSceneAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enableSceneAnim(%p) (%d)", (const void *)script, stackPos(0)); _sceneAnims[stackPos(0)].flags |= 1; return 0; } -int KyraEngine_v2::o2_restoreInventoryGfx(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_restoreInventoryGfx(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_restoreInventoryGfx(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_restoreInventoryGfx(%p) ()", (const void *)script); _screen->copyBlockToPage(1, 0, 144, 320, 56, _screenBuffer); _inventorySaved = false; return 0; } -int KyraEngine_v2::o2_setSceneAnimPos2(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneAnimPos2(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_setSceneAnimPos2(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneAnimPos2(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); _sceneAnims[stackPos(0)].x2 = stackPos(1); _sceneAnims[stackPos(0)].y2 = stackPos(2); return 0; } -int KyraEngine_v2::o2_update(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_update(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_update(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_update(%p) (%d)", (const void *)script, stackPos(0)); int times = stackPos(0); while (times--) { @@ -809,14 +810,14 @@ int KyraEngine_v2::o2_update(EMCState *script) { return 0; } -int KyraEngine_v2::o2_fadeScenePal(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_fadeScenePal(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); fadeScenePal(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_enterNewSceneEx(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enterNewSceneEx(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), +int KyraEngine_HoF::o2_enterNewSceneEx(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enterNewSceneEx(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); int skipNpcScript = stackPos(3); @@ -835,8 +836,8 @@ int KyraEngine_v2::o2_enterNewSceneEx(EMCState *script) { return 0; } -int KyraEngine_v2::o2_switchScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_switchScene(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_switchScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_switchScene(%p) (%d)", (const void *)script, stackPos(0)); setGameFlag(0x1EF); _mainCharX = _mainCharacter.x1; _mainCharY = _mainCharacter.y1; @@ -846,19 +847,19 @@ int KyraEngine_v2::o2_switchScene(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getShapeFlag1(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getShapeFlag1(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_getShapeFlag1(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getShapeFlag1(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return _screen->getShapeFlag1(stackPos(0), stackPos(1)); } -int KyraEngine_v2::o2_setPathfinderFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setPathfinderFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setPathfinderFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setPathfinderFlag(%p) (%d)", (const void *)script, stackPos(0)); _pathfinderFlag = stackPos(0); return 0; } -int KyraEngine_v2::o2_getSceneExitToFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getSceneExitToFacing(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_getSceneExitToFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getSceneExitToFacing(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int scene = stackPos(0); const int facing = stackPos(1); @@ -873,16 +874,16 @@ int KyraEngine_v2::o2_getSceneExitToFacing(EMCState *script) { return -1; } -int KyraEngine_v2::o2_setLayerFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setLayerFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setLayerFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setLayerFlag(%p) (%d)", (const void *)script, stackPos(0)); int layer = stackPos(0); if (layer >= 1 && layer <= 16) _layerFlagTable[layer] = 1; return 0; } -int KyraEngine_v2::o2_setZanthiaPos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setZanthiaPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setZanthiaPos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setZanthiaPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _mainCharX = stackPos(0); _mainCharY = stackPos(1); @@ -894,52 +895,52 @@ int KyraEngine_v2::o2_setZanthiaPos(EMCState *script) { return 0; } -int KyraEngine_v2::o2_loadMusicTrack(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadMusicTrack(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_loadMusicTrack(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_loadMusicTrack(%p) (%d)", (const void *)script, stackPos(0)); snd_loadSoundFile(stackPos(0)); return 0; } -int KyraEngine_v2::o2_playWanderScoreViaMap(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_playWanderScoreViaMap(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); snd_playWanderScoreViaMap(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_playSoundEffect(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_playSoundEffect(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0)); snd_playSoundEffect(stackPos(0)); return 0; } -int KyraEngine_v2::o2_setSceneAnimPos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_setSceneAnimPos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); _sceneAnims[stackPos(0)].x = stackPos(1); _sceneAnims[stackPos(0)].y = stackPos(2); return 0; } -int KyraEngine_v2::o2_blockInRegion(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_HoF::o2_blockInRegion(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1); return 0; } -int KyraEngine_v2::o2_blockOutRegion(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_HoF::o2_blockOutRegion(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1); return 0; } -int KyraEngine_v2::o2_setCauldronState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCauldronState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setCauldronState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCauldronState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setCauldronState(stackPos(0), stackPos(1) != 0); clearCauldronTable(); return 0; } -int KyraEngine_v2::o2_showItemString(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showItemString(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_showItemString(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showItemString(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int item = stackPos(0); int string = 0; @@ -959,31 +960,31 @@ int KyraEngine_v2::o2_showItemString(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getRand(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_getRand(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < stackPos(1)); return _rnd.getRandomNumberRng(stackPos(0), stackPos(1)); } -int KyraEngine_v2::o2_isAnySoundPlaying(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_isAnySoundPlaying(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_isAnySoundPlaying(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isAnySoundPlaying(%p) ()", (const void *)script); return _sound->voiceIsPlaying(); } -int KyraEngine_v2::o2_setDeathHandlerFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setDeathHandlerFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0)); _deathHandler = stackPos(0); return 0; } -int KyraEngine_v2::o2_setDrawNoShapeFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDrawNoShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setDrawNoShapeFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setDrawNoShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); _drawNoShapeFlag = (stackPos(0) != 0); return 0; } -int KyraEngine_v2::o2_setRunFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setRunFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setRunFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setRunFlag(%p) (%d)", (const void *)script, stackPos(0)); // this is usually just _runFlag, but since this is just used when the game should play the credits // we handle it a bit different :-) _showCredits = true; @@ -991,8 +992,8 @@ int KyraEngine_v2::o2_setRunFlag(EMCState *script) { return 0; } -int KyraEngine_v2::o2_showLetter(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showLetter(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_showLetter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showLetter(%p) (%d)", (const void *)script, stackPos(0)); const int letter = stackPos(0); char filename[16]; @@ -1051,14 +1052,14 @@ int KyraEngine_v2::o2_showLetter(EMCState *script) { return 0; } -int KyraEngine_v2::o2_fillRect(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_fillRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); +int KyraEngine_HoF::o2_fillRect(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_fillRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); _screen->fillRect(stackPos(1), stackPos(2), stackPos(1)+stackPos(3), stackPos(2)+stackPos(4), stackPos(5), stackPos(0)); return 0; } -int KyraEngine_v2::o2_waitForConfirmationClick(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_waitForConfirmationClick(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0)); resetSkipFlag(); uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength; @@ -1081,15 +1082,15 @@ int KyraEngine_v2::o2_waitForConfirmationClick(EMCState *script) { return 1; } -int KyraEngine_v2::o2_encodeShape(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_encodeShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), +int KyraEngine_HoF::o2_encodeShape(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_encodeShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); _sceneShapeTable[stackPos(0)] = _screen->encodeShape(stackPos(1), stackPos(2), stackPos(3), stackPos(4), 2); return 0; } -int KyraEngine_v2::o2_defineRoomEntrance(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineRoomEntrance(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_defineRoomEntrance(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineRoomEntrance(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); switch (stackPos(0)) { case 0: _sceneEnterX1 = stackPos(1); @@ -1117,23 +1118,23 @@ int KyraEngine_v2::o2_defineRoomEntrance(EMCState *script) { return 0; } -int KyraEngine_v2::o2_runTemporaryScript(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_runTemporaryScript(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), +int KyraEngine_HoF::o2_runTemporaryScript(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_runTemporaryScript(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3)); runTemporaryScript(stackPosString(0), stackPos(3), stackPos(2) ? 1 : 0, stackPos(1), stackPos(2)); return 0; } -int KyraEngine_v2::o2_setSpecialSceneScriptRunTime(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSpecialSceneScriptRunTime(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setSpecialSceneScriptRunTime(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSpecialSceneScriptRunTime(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) >= 0 && stackPos(0) < 10); _sceneSpecialScriptsTimer[stackPos(0)] = _system->getMillis() + stackPos(1) * _tickLength; return 0; } -int KyraEngine_v2::o2_defineSceneAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, +int KyraEngine_HoF::o2_defineSceneAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12)); int animId = stackPos(0); @@ -1145,9 +1146,7 @@ int KyraEngine_v2::o2_defineSceneAnim(EMCState *script) { anim.y2 = stackPos(5); anim.width = stackPos(6); anim.height = stackPos(7); - anim.unkE = stackPos(8); anim.specialSize = stackPos(9); - anim.unk12 = stackPos(10); anim.shapeIndex = stackPos(11); if (stackPosString(12) != 0) strcpy(anim.filename, stackPosString(12)); @@ -1165,8 +1164,8 @@ int KyraEngine_v2::o2_defineSceneAnim(EMCState *script) { return 0; } -int KyraEngine_v2::o2_updateSceneAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_updateSceneAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); updateSceneAnim(stackPos(0), stackPos(1)); // HACK: Some animations are really too fast because of missing delay times. @@ -1189,8 +1188,8 @@ int KyraEngine_v2::o2_updateSceneAnim(EMCState *script) { return 0; } -int KyraEngine_v2::o2_addToSceneAnimPosAndUpdate(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addToSceneAnimPosAndUpdate(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_HoF::o2_addToSceneAnimPosAndUpdate(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addToSceneAnimPosAndUpdate(%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); @@ -1203,7 +1202,7 @@ int KyraEngine_v2::o2_addToSceneAnimPosAndUpdate(EMCState *script) { return 0; } -int KyraEngine_v2::o2_useItemOnMainChar(EMCState *script) { +int KyraEngine_HoF::o2_useItemOnMainChar(EMCState *script) { EMCState tmpScript; _emc->init(&tmpScript, &_npcScriptData); _emc->start(&tmpScript, 0); @@ -1221,34 +1220,34 @@ int KyraEngine_v2::o2_useItemOnMainChar(EMCState *script) { return 0; } -int KyraEngine_v2::o2_startDialogue(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_startDialogue(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_startDialogue(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_startDialogue(%p) (%d)", (const void *)script, stackPos(0)); startDialogue(stackPos(0)); return 0; } -int KyraEngine_v2::o2_zanthRandomChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_zanthRandomChat(%p)", (const void *)script); +int KyraEngine_HoF::o2_zanthRandomChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_zanthRandomChat(%p)", (const void *)script); zanthRandomIdleChat(); return 0; } -int KyraEngine_v2::o2_setupDialogue(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setupDialogue(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setupDialogue(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setupDialogue(%p) (%d)", (const void *)script, stackPos(0)); setNewDlgIndex(stackPos(0)); return 0; } -int KyraEngine_v2::o2_getDlgIndex(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setNewDlgIndex(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_getDlgIndex(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setNewDlgIndex(%p) (%d)", (const void *)script, stackPos(0)); return _mainCharacter.dlgIndex; } -int KyraEngine_v2::o2_defineRoom(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_defineRoom(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_HoF::o2_defineRoom(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_defineRoom(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7)); SceneDesc *scene = &_sceneList[stackPos(0)]; - strcpy(scene->filename, stackPosString(1)); + strcpy(scene->filename1, stackPosString(1)); scene->exit1 = stackPos(2); scene->exit2 = stackPos(3); scene->exit3 = stackPos(4); @@ -1266,25 +1265,25 @@ int KyraEngine_v2::o2_defineRoom(EMCState *script) { return 0; } -int KyraEngine_v2::o2_addCauldronStateTableEntry(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addCauldronStateTableEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_addCauldronStateTableEntry(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addCauldronStateTableEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return addToCauldronStateTable(stackPos(0), stackPos(1)) ? 1 : 0; } -int KyraEngine_v2::o2_setCountDown(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCountDown(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setCountDown(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCountDown(%p) (%d)", (const void *)script, stackPos(0)); _scriptCountDown = _system->getMillis() + stackPos(0) * _tickLength; return 0; } -int KyraEngine_v2::o2_getCountDown(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getCountDown(%p)", (const void *)script); +int KyraEngine_HoF::o2_getCountDown(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getCountDown(%p)", (const void *)script); uint32 time = _system->getMillis(); return (time > _scriptCountDown) ? 0 : (_scriptCountDown - time) / _tickLength; } -int KyraEngine_v2::o2_pressColorKey(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_pressColorKey(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_pressColorKey(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_pressColorKey(%p) (%d)", (const void *)script, stackPos(0)); for (int i = 6; i; i--) _inputColorCode[i] = _inputColorCode[i - 1]; _inputColorCode[0] = stackPos(0) & 0xff; @@ -1295,8 +1294,8 @@ int KyraEngine_v2::o2_pressColorKey(EMCState *script) { return 1; } -int KyraEngine_v2::o2_objectChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); +int KyraEngine_HoF::o2_objectChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); if (_flags.isTalkie) warning("Unexpected call: o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); else @@ -1304,8 +1303,8 @@ int KyraEngine_v2::o2_objectChat(EMCState *script) { return 0; } -int KyraEngine_v2::o2_chapterChange(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_chapterChange(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_chapterChange(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_chapterChange(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int chapter = stackPos(0); const int scene = stackPos(1); @@ -1326,41 +1325,41 @@ int KyraEngine_v2::o2_chapterChange(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getColorCodeFlag1(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag1(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getColorCodeFlag1(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag1(%p) ()", (const void *)script); return _colorCodeFlag1; } -int KyraEngine_v2::o2_setColorCodeFlag1(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag1(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setColorCodeFlag1(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag1(%p) (%d)", (const void *)script, stackPos(0)); _colorCodeFlag1 = stackPos(0); return 0; } -int KyraEngine_v2::o2_getColorCodeFlag2(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag2(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getColorCodeFlag2(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag2(%p) ()", (const void *)script); return _colorCodeFlag2; } -int KyraEngine_v2::o2_setColorCodeFlag2(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeFlag2(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setColorCodeFlag2(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeFlag2(%p) (%d)", (const void *)script, stackPos(0)); _colorCodeFlag2 = stackPos(0); return 0; } -int KyraEngine_v2::o2_getColorCodeValue(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getColorCodeValue(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_getColorCodeValue(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getColorCodeValue(%p) (%d)", (const void *)script, stackPos(0)); return _presetColorCode[stackPos(0)]; } -int KyraEngine_v2::o2_setColorCodeValue(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setColorCodeValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setColorCodeValue(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setColorCodeValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _presetColorCode[stackPos(0)] = stackPos(1) & 0xff; return stackPos(1) & 0xff; } -int KyraEngine_v2::o2_countItemInstances(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_countItemInstances(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_countItemInstances(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_countItemInstances(%p) (%d)", (const void *)script, stackPos(0)); uint16 item = stackPos(0); int count = 0; @@ -1391,8 +1390,8 @@ int KyraEngine_v2::o2_countItemInstances(EMCState *script) { return count; } -int KyraEngine_v2::o2_removeItemFromScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeItemFromScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_removeItemFromScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeItemFromScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int scene = stackPos(0); const uint16 item = stackPos(1); for (int i = 0; i < 30; ++i) { @@ -1402,76 +1401,76 @@ int KyraEngine_v2::o2_removeItemFromScene(EMCState *script) { return 0; } -int KyraEngine_v2::o2_initObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_initObject(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_initObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_initObject(%p) (%d)", (const void *)script, stackPos(0)); initTalkObject(stackPos(0)); return 0; } -int KyraEngine_v2::o2_npcChat(EMCState *script) { +int KyraEngine_HoF::o2_npcChat(EMCState *script) { if (_flags.isTalkie) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_npcChat(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), _vocHigh, stackPos(2)); + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_npcChat(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), _vocHigh, stackPos(2)); npcChatSequence(stackPosString(0), stackPos(1), _vocHigh, stackPos(2)); } else { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_npcChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_npcChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); npcChatSequence(stackPosString(0), stackPos(1)); } return 0; } -int KyraEngine_v2::o2_deinitObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_deinitObject(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_deinitObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_deinitObject(%p) (%d)", (const void *)script, stackPos(0)); deinitTalkObject(stackPos(0)); return 0; } -int KyraEngine_v2::o2_playTimSequence(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playTimSequence(%p) ('%s')", (const void *)script, stackPosString(0)); +int KyraEngine_HoF::o2_playTimSequence(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playTimSequence(%p) ('%s')", (const void *)script, stackPosString(0)); playTim(stackPosString(0)); return 0; } -int KyraEngine_v2::o2_makeBookOrCauldronAppear(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_makeBookOrCauldronAppear(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_makeBookOrCauldronAppear(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_makeBookOrCauldronAppear(%p) (%d)", (const void *)script, stackPos(0)); seq_makeBookOrCauldronAppear(stackPos(0)); return 0; } -int KyraEngine_v2::o2_setSpecialSceneScriptState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setSpecialSceneScriptState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); _specialSceneScriptState[stackPos(0)] = 1; return 1; } -int KyraEngine_v2::o2_clearSpecialSceneScriptState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_clearSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_clearSpecialSceneScriptState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_clearSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); _specialSceneScriptState[stackPos(0)] = 0; return 0; } -int KyraEngine_v2::o2_querySpecialSceneScriptState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_querySpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_querySpecialSceneScriptState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_querySpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); return _specialSceneScriptState[stackPos(0)]; } -int KyraEngine_v2::o2_resetInputColorCode(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_resetInputColorCode(%p)", (const void *)script); +int KyraEngine_HoF::o2_resetInputColorCode(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_resetInputColorCode(%p)", (const void *)script); memset(_inputColorCode, 255, 7); return 0; } -int KyraEngine_v2::o2_setHiddenItemsEntry(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setHiddenItemsEntry(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return (_hiddenItems[stackPos(0)] = stackPos(1)); } -int KyraEngine_v2::o2_getHiddenItemsEntry(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_getHiddenItemsEntry(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0)); return _hiddenItems[stackPos(0)]; } -int KyraEngine_v2::o2_mushroomEffect(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_mushroomEffect(%p)", (const void *)script); +int KyraEngine_HoF::o2_mushroomEffect(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_mushroomEffect(%p)", (const void *)script); memcpy(_screen->getPalette(2), _screen->_currentPalette, 768); for (int i = 1; i < 768; i += 3) @@ -1495,8 +1494,8 @@ int KyraEngine_v2::o2_mushroomEffect(EMCState *script) { return 0; } -int KyraEngine_v2::o2_customChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customChat(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2)); +int KyraEngine_HoF::o2_customChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_customChat(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2)); strcpy((char*)_unkBuf500Bytes, stackPosString(0)); _chatText = (char*)_unkBuf500Bytes; _chatObject = stackPos(1); @@ -1507,16 +1506,16 @@ int KyraEngine_v2::o2_customChat(EMCState *script) { return 0; } -int KyraEngine_v2::o2_customChatFinish(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customChatFinish(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_customChatFinish(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_customChatFinish(%p) ()", (const void *)script); _text->restoreScreen(); _chatText = 0; _chatObject = -1; return 0; } -int KyraEngine_v2::o2_setupSceneAnimation(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setupSceneAnimation(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, +int KyraEngine_HoF::o2_setupSceneAnimation(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setupSceneAnimation(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12)); const int index = stackPos(0); const uint16 flags = stackPos(1); @@ -1531,9 +1530,7 @@ int KyraEngine_v2::o2_setupSceneAnimation(EMCState *script) { anim.y2 = stackPos(5); anim.width = stackPos(6); anim.height = stackPos(7); - anim.unkE = stackPos(8); anim.specialSize = stackPos(9); - anim.unk12 = stackPos(10); anim.shapeIndex = stackPos(11); if (stackPosString(12)) strcpy(anim.filename, stackPosString(12)); @@ -1549,7 +1546,7 @@ int KyraEngine_v2::o2_setupSceneAnimation(EMCState *script) { AnimObj *obj = &_animObjects[1+index]; obj->enabled = 1; obj->needRefresh = 1; - obj->unk8 = 1; + obj->specialRefresh = 1; obj->animFlags = anim.flags & 8; if (anim.flags & 2) @@ -1585,19 +1582,19 @@ int KyraEngine_v2::o2_setupSceneAnimation(EMCState *script) { _animList = addToAnimListSorted(_animList, obj); obj->needRefresh = 1; - obj->unk8 = 1; + obj->specialRefresh = 1; return 0; } -int KyraEngine_v2::o2_stopSceneAnimation(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_stopSceneAnimation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_stopSceneAnimation(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_stopSceneAnimation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int index = stackPos(0); AnimObj &obj = _animObjects[1+index]; restorePage3(); obj.shapeIndex3 = 0xFFFF; obj.animNum = 0xFFFF; obj.needRefresh = 1; - obj.unk8 = 1; + obj.specialRefresh = 1; if (stackPos(1)) refreshAnimObjectsIfNeed(); obj.enabled = 0; @@ -1609,26 +1606,26 @@ int KyraEngine_v2::o2_stopSceneAnimation(EMCState *script) { return 0; } -int KyraEngine_v2::o2_disableTimer(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_disableTimer(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_disableTimer(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_disableTimer(%p) (%d)", (const void *)script, stackPos(0)); _timer->disable(stackPos(0)); return 0; } -int KyraEngine_v2::o2_enableTimer(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_enableTimer(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_enableTimer(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_enableTimer(%p) (%d)", (const void *)script, stackPos(0)); _timer->enable(stackPos(0)); return 0; } -int KyraEngine_v2::o2_setTimerCountdown(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setTimerCountdown(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2_setTimerCountdown(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setTimerCountdown(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _timer->setCountdown(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2_processPaletteIndex(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_processPaletteIndex(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); +int KyraEngine_HoF::o2_processPaletteIndex(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_processPaletteIndex(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); uint8 *palette = _screen->getPalette(0); const int index = stackPos(0); const bool updatePalette = (stackPos(4) != 0); @@ -1645,21 +1642,21 @@ int KyraEngine_v2::o2_processPaletteIndex(EMCState *script) { return 0; } -int KyraEngine_v2::o2_updateTwoSceneAnims(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_updateTwoSceneAnims(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_HoF::o2_updateTwoSceneAnims(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_updateTwoSceneAnims(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); updateSceneAnim(stackPos(0), stackPos(1)); updateSceneAnim(stackPos(2), stackPos(3)); _specialSceneScriptRunFlag = false; return 0; } -int KyraEngine_v2::o2_getRainbowRoomData(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRainbowRoomData(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_getRainbowRoomData(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getRainbowRoomData(%p) (%d)", (const void *)script, stackPos(0)); return _rainbowRoomData[stackPos(0)]; } -int KyraEngine_v2::o2_drawSceneShapeEx(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShapeEx(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_HoF::o2_drawSceneShapeEx(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_drawSceneShapeEx(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); const int itemShape = stackPos(0) + 64; const int x = stackPos(1); const int y = stackPos(2); @@ -1676,13 +1673,13 @@ int KyraEngine_v2::o2_drawSceneShapeEx(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getBoolFromStack(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getBoolFromStack(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getBoolFromStack(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getBoolFromStack(%p) ()", (const void *)script); return stackPos(0) ? 1 : 0; } -int KyraEngine_v2::o2_getSfxDriver(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getSfxDriver(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getSfxDriver(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getSfxDriver(%p) ()", (const void *)script); if (_sound->getSfxType() == Sound::kAdlib) return 1; else if (_sound->getSfxType() == Sound::kMidiMT32) @@ -1693,14 +1690,14 @@ int KyraEngine_v2::o2_getSfxDriver(EMCState *script) { return 0; } -int KyraEngine_v2::o2_getVocSupport(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getVocSupport(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getVocSupport(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getVocSupport(%p) ()", (const void *)script); // we always support VOC file playback return 1; } -int KyraEngine_v2::o2_getMusicDriver(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getMusicDriver(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getMusicDriver(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getMusicDriver(%p) ()", (const void *)script); if (_sound->getMusicType() == Sound::kAdlib) return 1; else if (_sound->getMusicType() == Sound::kMidiMT32) @@ -1711,46 +1708,46 @@ int KyraEngine_v2::o2_getMusicDriver(EMCState *script) { return 0; } -int KyraEngine_v2::o2_setVocHigh(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setVocHigh(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2_setVocHigh(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setVocHigh(%p) (%d)", (const void *)script, stackPos(0)); _vocHigh = stackPos(0); return _vocHigh; } -int KyraEngine_v2::o2_getVocHigh(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getVocHigh(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getVocHigh(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getVocHigh(%p) ()", (const void *)script); return _vocHigh; } -int KyraEngine_v2::o2_zanthiaChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_zanthiaChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); +int KyraEngine_HoF::o2_zanthiaChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_zanthiaChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); objectChat(stackPosString(0), 0, _vocHigh, stackPos(1)); return 0; } -int KyraEngine_v2::o2_isVoiceEnabled(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_isVoiceEnabled(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_isVoiceEnabled(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isVoiceEnabled(%p) ()", (const void *)script); return speechEnabled() ? 1 : 0; } -int KyraEngine_v2::o2_isVoicePlaying(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_isVoicePlaying(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_isVoicePlaying(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isVoicePlaying(%p) ()", (const void *)script); return (snd_voiceIsPlaying() && !skipFlag()) ? 1 : 0; } -int KyraEngine_v2::o2_stopVoicePlaying(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_stopVoicePlaying(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_stopVoicePlaying(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_stopVoicePlaying(%p) ()", (const void *)script); snd_stopVoice(); return 0; } -int KyraEngine_v2::o2_getGameLanguage(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getGameLanguage(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_getGameLanguage(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getGameLanguage(%p) ()", (const void *)script); return _lang; } -int KyraEngine_v2::o2_demoFinale(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_demoFinale(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_demoFinale(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_demoFinale(%p) ()", (const void *)script); if (!_flags.isDemo) return 0; @@ -1783,15 +1780,15 @@ int KyraEngine_v2::o2_demoFinale(EMCState *script) { return 0; } -int KyraEngine_v2::o2_dummy(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_dummy(%p) ()", (const void *)script); +int KyraEngine_HoF::o2_dummy(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_dummy(%p) ()", (const void *)script); return 0; } #pragma mark - -int KyraEngine_v2::o2t_defineNewShapes(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_defineNewShapes(%p) ('%s', %d, %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), +int KyraEngine_HoF::o2t_defineNewShapes(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2t_defineNewShapes(%p) ('%s', %d, %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6)); strcpy(_newShapeFilename, stackPosString(0)); @@ -1805,28 +1802,28 @@ int KyraEngine_v2::o2t_defineNewShapes(EMCState *script) { return 0; } -int KyraEngine_v2::o2t_setCurrentFrame(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_setCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2t_setCurrentFrame(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2t_setCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _newShapeAnimFrame = stackPos(0); _newShapeDelay = stackPos(1); _temporaryScriptExecBit = true; return 0; } -int KyraEngine_v2::o2t_playSoundEffect(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2t_playSoundEffect(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2t_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0)); snd_playSoundEffect(stackPos(0)); return 0; } -int KyraEngine_v2::o2t_fadeScenePal(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_HoF::o2t_fadeScenePal(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2t_fadeScenePal(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); fadeScenePal(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v2::o2t_setShapeFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2t_setShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_HoF::o2t_setShapeFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2t_setShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); if (_flags.isTalkie) _newShapeFlag = stackPos(0); return 0; @@ -1834,8 +1831,8 @@ int KyraEngine_v2::o2t_setShapeFlag(EMCState *script) { #pragma mark - -int KyraEngine_v2::t2_initChat(const TIM *tim, const uint16 *param) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_initChat(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]); +int KyraEngine_HoF::t2_initChat(const TIM *tim, const uint16 *param) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_initChat(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]); _chatText = (const char*)tim->text + READ_LE_UINT16(tim->text + (param[0] << 1)); _chatObject = param[1]; @@ -1850,38 +1847,38 @@ int KyraEngine_v2::t2_initChat(const TIM *tim, const uint16 *param) { return 0; } -int KyraEngine_v2::t2_updateSceneAnim(const TIM *tim, const uint16 *param) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_updateSceneAnim(%p, %p) (%d, %d)", (const void*)tim, (const void*)param, param[0], param[1]); +int KyraEngine_HoF::t2_updateSceneAnim(const TIM *tim, const uint16 *param) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_updateSceneAnim(%p, %p) (%d, %d)", (const void*)tim, (const void*)param, param[0], param[1]); updateSceneAnim(param[1], param[0]); return 0; } -int KyraEngine_v2::t2_resetChat(const TIM *tim, const uint16 *param) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_resetChat(%p, %p) ()", (const void*)tim, (const void*)param); +int KyraEngine_HoF::t2_resetChat(const TIM *tim, const uint16 *param) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_resetChat(%p, %p) ()", (const void*)tim, (const void*)param); _text->restoreScreen(); _chatText = 0; _chatObject = -1; return 0; } -int KyraEngine_v2::t2_playSoundEffect(const TIM *tim, const uint16 *param) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::t2_playSoundEffect(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]); +int KyraEngine_HoF::t2_playSoundEffect(const TIM *tim, const uint16 *param) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::t2_playSoundEffect(%p, %p) (%d)", (const void*)tim, (const void*)param, param[0]); snd_playSoundEffect(*param); return 0; } #pragma mark - -typedef Common::Functor1Mem<EMCState*, int, KyraEngine_v2> OpcodeV2; +typedef Common::Functor1Mem<EMCState*, int, KyraEngine_HoF> OpcodeV2; #define SetOpcodeTable(x) table = &x; -#define Opcode(x) table->push_back(new OpcodeV2(this, &KyraEngine_v2::x)) +#define Opcode(x) table->push_back(new OpcodeV2(this, &KyraEngine_HoF::x)) #define OpcodeUnImpl() table->push_back(new OpcodeV2(this, 0)) -typedef Common::Functor2Mem<const TIM*, const uint16*, int, KyraEngine_v2> TIMOpcodeV2; -#define OpcodeTim(x) _timOpcodes.push_back(new TIMOpcodeV2(this, &KyraEngine_v2::x)) +typedef Common::Functor2Mem<const TIM*, const uint16*, int, KyraEngine_HoF> TIMOpcodeV2; +#define OpcodeTim(x) _timOpcodes.push_back(new TIMOpcodeV2(this, &KyraEngine_HoF::x)) #define OpcodeTimUnImpl() _timOpcodes.push_back(TIMOpcodeV2(this, 0)) -void KyraEngine_v2::setupOpcodeTable() { +void KyraEngine_HoF::setupOpcodeTable() { Common::Array<const Opcode*> *table = 0; SetOpcodeTable(_opcodes); diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_mr.cpp index 6cd469bdcd..de535148d1 100644 --- a/engines/kyra/script_v3.cpp +++ b/engines/kyra/script_mr.cpp @@ -23,24 +23,25 @@ * */ -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" #include "kyra/script.h" -#include "kyra/screen_v3.h" -#include "kyra/text_v3.h" +#include "kyra/screen_mr.h" +#include "kyra/text_mr.h" #include "kyra/wsamovie.h" #include "kyra/timer.h" +#include "kyra/resource.h" #include "common/endian.h" namespace Kyra { -int KyraEngine_v3::o3_getMalcolmShapes(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getMaloclmShapes(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getMalcolmShapes(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getMaloclmShapes(%p) ()", (const void *)script); return _malcolmShapes; } -int KyraEngine_v3::o3_setCharacterPos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setCharacterPos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); int x = stackPos(0); int y = stackPos(1); @@ -55,8 +56,8 @@ int KyraEngine_v3::o3_setCharacterPos(EMCState *script) { return 0; } -int KyraEngine_v3::o3_defineObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineObject(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3_defineObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineObject(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7)); TalkObject &obj = _talkObjectList[stackPos(0)]; strcpy(obj.filename, stackPosString(1)); @@ -69,8 +70,8 @@ int KyraEngine_v3::o3_defineObject(EMCState *script) { return 0; } -int KyraEngine_v3::o3_refreshCharacter(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_refreshCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_refreshCharacter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_refreshCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const int frame = stackPos(0); const int facing = stackPos(1); const bool updateNeed = stackPos(2) != 0; @@ -90,45 +91,45 @@ int KyraEngine_v3::o3_refreshCharacter(EMCState *script) { return 0; } -int KyraEngine_v3::o3_getCharacterX(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterX(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getCharacterX(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getCharacterX(%p) ()", (const void *)script); return _mainCharacter.x1; } -int KyraEngine_v3::o3_getCharacterY(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterY(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getCharacterY(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getCharacterY(%p) ()", (const void *)script); return _mainCharacter.y1; } -int KyraEngine_v3::o3_getCharacterFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterFacing(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getCharacterFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getCharacterFacing(%p) ()", (const void *)script); return _mainCharacter.facing; } -int KyraEngine_v3::o3_getCharacterScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterScene(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getCharacterScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getCharacterScene(%p) ()", (const void *)script); return _mainCharacter.sceneId; } -int KyraEngine_v3::o3_getMalcolmsMood(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getMalcolmsMood(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getMalcolmsMood(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getMalcolmsMood(%p) ()", (const void *)script); return _malcolmsMood; } -int KyraEngine_v3::o3_getCharacterFrameFromFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getCharacterFrameFromFacing(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getCharacterFrameFromFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getCharacterFrameFromFacing(%p) ()", (const void *)script); return _characterFrameTable[_mainCharacter.facing]; } -int KyraEngine_v3::o3_setCharacterFacingOverwrite(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterFacingOverwrite(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setCharacterFacingOverwrite(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterFacingOverwrite(%p) (%d)", (const void *)script, stackPos(0)); _mainCharacter.facing = stackPos(0); _overwriteSceneFacing = true; return 0; } -int KyraEngine_v3::o3_trySceneChange(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3_trySceneChange(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _unkHandleSceneChangeFlag = 1; @@ -146,26 +147,26 @@ int KyraEngine_v3::o3_trySceneChange(EMCState *script) { } } -int KyraEngine_v3::o3_moveCharacter(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_moveCharacter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); moveCharacter(stackPos(0), stackPos(1), stackPos(2)); return 0; } -int KyraEngine_v3::o3_setCharacterFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setCharacterFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0)); _mainCharacter.facing = stackPos(0); return 0; } -int KyraEngine_v3::o3_showSceneFileMessage(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showSceneFileMessage(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_showSceneFileMessage(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showSceneFileMessage(%p) (%d)", (const void *)script, stackPos(0)); showMessage((const char*)getTableEntry(_scenesFile, stackPos(0)), 0xFF, 0xF0); return 0; } -int KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(%p) ()", (const void *)script); +int KyraEngine_MR::o3_setCharacterAnimFrameFromFacing(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setCharacterAnimFrameFromFacing(%p) ()", (const void *)script); updateCharPal(0); _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing]; updateCharacterAnim(0); @@ -173,31 +174,31 @@ int KyraEngine_v3::o3_setCharacterAnimFrameFromFacing(EMCState *script) { return 0; } -int KyraEngine_v3::o3_showBadConscience(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showBadConscience(%p) ()", (const void *)script); +int KyraEngine_MR::o3_showBadConscience(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showBadConscience(%p) ()", (const void *)script); showBadConscience(); return 0; } -int KyraEngine_v3::o3_hideBadConscience(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_hideBadConscience(%p) ()", (const void *)script); +int KyraEngine_MR::o3_hideBadConscience(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_hideBadConscience(%p) ()", (const void *)script); hideBadConscience(); return 0; } -int KyraEngine_v3::o3_setInventorySlot(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setInventorySlot(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setInventorySlot(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setInventorySlot(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int slot = MAX<int16>(0, MIN<int16>(10, stackPos(0))); return (_mainCharacter.inventory[slot] = stackPos(1)); } -int KyraEngine_v3::o3_getInventorySlot(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getInventorySlot(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_getInventorySlot(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getInventorySlot(%p) (%d)", (const void *)script, stackPos(0)); return _mainCharacter.inventory[stackPos(0)]; } -int KyraEngine_v3::o3_addItemToInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_addItemToInventory(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_addItemToInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_addItemToInventory(%p) (%d)", (const void *)script, stackPos(0)); int slot = findFreeInventorySlot(); if (slot >= 0) { _mainCharacter.inventory[slot] = stackPos(0); @@ -210,8 +211,8 @@ int KyraEngine_v3::o3_addItemToInventory(EMCState *script) { return slot; } -int KyraEngine_v3::o3_addItemToCurScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_addItemToCurScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const uint16 item = stackPos(0); int x = stackPos(1); int y = stackPos(2); @@ -239,8 +240,8 @@ int KyraEngine_v3::o3_addItemToCurScene(EMCState *script) { return itemSlot; } -int KyraEngine_v3::o3_objectChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_objectChat(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_objectChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_objectChat(%p) (%d)", (const void *)script, stackPos(0)); int id = stackPos(0); const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id); if (str) { @@ -250,19 +251,19 @@ int KyraEngine_v3::o3_objectChat(EMCState *script) { return 0; } -int KyraEngine_v3::o3_checkForItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_checkForItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return findItem(stackPos(0), stackPos(1)) == -1 ? 0 : 1; } -int KyraEngine_v3::o3_resetInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_resetInventory(%p) ()", (const void *)script); +int KyraEngine_MR::o3_resetInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_resetInventory(%p) ()", (const void *)script); memset(_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory)); return 0; } -int KyraEngine_v3::o3_defineItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineItem(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_MR::o3_defineItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineItem(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int freeItem = findFreeItem(); if (freeItem != -1) { _itemList[freeItem].id = stackPos(0); @@ -273,8 +274,8 @@ int KyraEngine_v3::o3_defineItem(EMCState *script) { return freeItem; } -int KyraEngine_v3::o3_removeInventoryItemInstances(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeInventoryItemInstances(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_removeInventoryItemInstances(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeInventoryItemInstances(%p) (%d)", (const void *)script, stackPos(0)); const int item = stackPos(0); for (int i = 0; i < 10; ++i) { if (_mainCharacter.inventory[i] == item) @@ -283,8 +284,8 @@ int KyraEngine_v3::o3_removeInventoryItemInstances(EMCState *script) { return 0; } -int KyraEngine_v3::o3_countInventoryItemInstances(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_countInventoryItemInstances(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_countInventoryItemInstances(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_countInventoryItemInstances(%p) (%d)", (const void *)script, stackPos(0)); const int item = stackPos(0); int count = 0; @@ -299,8 +300,8 @@ int KyraEngine_v3::o3_countInventoryItemInstances(EMCState *script) { return count; } -int KyraEngine_v3::o3_npcChatSequence(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_npcChatSequence(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_npcChatSequence(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_npcChatSequence(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int id = stackPos(0); const char *str = (const char*)getTableEntry(_sceneStrings, id); if (str) @@ -308,48 +309,48 @@ int KyraEngine_v3::o3_npcChatSequence(EMCState *script) { return 0; } -int KyraEngine_v3::o3_queryGameFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_queryGameFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0)); return queryGameFlag(stackPos(0)); } -int KyraEngine_v3::o3_resetGameFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_resetGameFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0)); resetGameFlag(stackPos(0)); return 0; } -int KyraEngine_v3::o3_setGameFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setGameFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setGameFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setGameFlag(%p) (%d)", (const void *)script, stackPos(0)); setGameFlag(stackPos(0)); return 1; } -int KyraEngine_v3::o3_setHandItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setHandItem(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setHandItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setHandItem(%p) (%d)", (const void *)script, stackPos(0)); setHandItem(stackPos(0)); return 0; } -int KyraEngine_v3::o3_removeHandItem(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeHandItem(%p) ()", (const void *)script); +int KyraEngine_MR::o3_removeHandItem(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeHandItem(%p) ()", (const void *)script); removeHandItem(); return 0; } -int KyraEngine_v3::o3_handItemSet(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_handItemSet(%p) ()", (const void *)script); +int KyraEngine_MR::o3_handItemSet(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_handItemSet(%p) ()", (const void *)script); return _handItemSet; } -int KyraEngine_v3::o3_hideMouse(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_hideMouse(%p) ()", (const void *)script); +int KyraEngine_MR::o3_hideMouse(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_hideMouse(%p) ()", (const void *)script); _screen->hideMouse(); return 0; } -int KyraEngine_v3::o3_addSpecialExit(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3_addSpecialExit(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); if (_specialExitCount < 5) { _specialExitTable[_specialExitCount+0] = stackPos(0); @@ -362,27 +363,27 @@ int KyraEngine_v3::o3_addSpecialExit(EMCState *script) { return 0; } -int KyraEngine_v3::o3_setMousePos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setMousePos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); setMousePos(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_showMouse(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showMouse(%p) ()", (const void *)script); +int KyraEngine_MR::o3_showMouse(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showMouse(%p) ()", (const void *)script); _screen->showMouse(); return 0; } -int KyraEngine_v3::o3_badConscienceChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_badConscienceChat(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_badConscienceChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_badConscienceChat(%p) (%d)", (const void *)script, stackPos(0)); int id = stackPos(0); const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id); badConscienceChat(str, _vocHigh, id); return 0; } -int KyraEngine_v3::o3_wipeDownMouseItem(EMCState *script) { +int KyraEngine_MR::o3_wipeDownMouseItem(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); _screen->hideMouse(); const int x = stackPos(1) - 12; @@ -409,13 +410,13 @@ int KyraEngine_v3::o3_wipeDownMouseItem(EMCState *script) { return 0; } -int KyraEngine_v3::o3_setMalcolmsMood(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMalcolmsMood(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setMalcolmsMood(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setMalcolmsMood(%p) (%d)", (const void *)script, stackPos(0)); return (_malcolmsMood = stackPos(0)); } -int KyraEngine_v3::o3_delay(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_delay(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); if (stackPos(1)) { uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength; while (_system->getMillis() < maxWaitTime) { @@ -437,26 +438,26 @@ int KyraEngine_v3::o3_delay(EMCState *script) { return 0; } -int KyraEngine_v3::o3_updateScore(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_updateScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_updateScore(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_updateScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return updateScore(stackPos(0), stackPos(1)) ? 1 : 0; } -int KyraEngine_v3::o3_makeSecondChanceSave(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_makeSecondChanceSave(%p) ()", (const void *)script); +int KyraEngine_MR::o3_makeSecondChanceSave(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_makeSecondChanceSave(%p) ()", (const void *)script); saveGame(getSavegameFilename(999), "SECOND CHANCE SAVE GAME"); return 0; } -int KyraEngine_v3::o3_setSceneFilename(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSceneFilename(%p) (%d, '%s')", (const void *)script, stackPos(0), stackPosString(1)); +int KyraEngine_MR::o3_setSceneFilename(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneFilename(%p) (%d, '%s')", (const void *)script, stackPos(0), stackPosString(1)); strcpy(_sceneList[stackPos(0)].filename1, stackPosString(1)); _sceneList[stackPos(0)].filename1[9] = 0; return 0; } -int KyraEngine_v3::o3_removeItemsFromScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeItemsFromScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_removeItemsFromScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeItemsFromScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const uint16 itemId = stackPos(0); const uint16 sceneId = stackPos(1); const bool allItems = (stackPos(2) != 0); @@ -475,14 +476,14 @@ int KyraEngine_v3::o3_removeItemsFromScene(EMCState *script) { return retValue; } -int KyraEngine_v3::o3_disguiseMalcolm(EMCState *script) { +int KyraEngine_MR::o3_disguiseMalcolm(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_disguiseMalcolm(%p) (%d)", (const void *)script, stackPos(0)); loadMalcolmShapes(stackPos(0)); updateDlgIndex(); return 0; } -int KyraEngine_v3::o3_drawSceneShape(EMCState *script) { +int KyraEngine_MR::o3_drawSceneShape(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o3_drawSceneShape(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); int shape = stackPos(0); @@ -506,8 +507,8 @@ int KyraEngine_v3::o3_drawSceneShape(EMCState *script) { return 0; } -int KyraEngine_v3::o3_drawSceneShapeOnPage(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_drawSceneShapeOnPage(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_drawSceneShapeOnPage(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_drawSceneShapeOnPage(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const int shape = stackPos(0); int x = _sceneShapeDescs[shape].drawX; @@ -516,8 +517,8 @@ int KyraEngine_v3::o3_drawSceneShapeOnPage(EMCState *script) { return 0; } -int KyraEngine_v3::o3_checkInRect(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_checkInRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3_checkInRect(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_checkInRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); const int x1 = stackPos(0); const int y1 = stackPos(1); @@ -541,8 +542,8 @@ int KyraEngine_v3::o3_checkInRect(EMCState *script) { } } -int KyraEngine_v3::o3_updateConversations(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_updateConversations(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_updateConversations(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_updateConversations(%p) (%d)", (const void *)script, stackPos(0)); int dlgIndex = stackPos(0); switch (_currentChapter-2) { case 0: @@ -745,15 +746,15 @@ int KyraEngine_v3::o3_updateConversations(EMCState *script) { return 1; } -int KyraEngine_v3::o3_setSceneDim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSceneDim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setSceneDim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneDim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _sceneMinX = stackPos(0); _sceneMaxX = stackPos(1); return 0; } -int KyraEngine_v3::o3_setSceneAnimPosAndFrame(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSceneAnimPosAndFrame(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3_setSceneAnimPosAndFrame(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneAnimPosAndFrame(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); SceneAnim &anim = _sceneAnims[stackPos(0)]; const int newX2 = stackPos(1); @@ -781,8 +782,8 @@ int KyraEngine_v3::o3_setSceneAnimPosAndFrame(EMCState *script) { return 0; } -int KyraEngine_v3::o3_update(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_update(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_update(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_update(%p) (%d)", (const void *)script, stackPos(0)); for (int times = stackPos(0); times != 0; --times) { if (_chatText) updateWithText(); @@ -792,8 +793,8 @@ int KyraEngine_v3::o3_update(EMCState *script) { return 0; } -int KyraEngine_v3::o3_removeItemInstances(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeItemInstances(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_removeItemInstances(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeItemInstances(%p) (%d)", (const void *)script, stackPos(0)); const int16 item = stackPos(0); int deleted = 0; @@ -820,20 +821,20 @@ int KyraEngine_v3::o3_removeItemInstances(EMCState *script) { return deleted; } -int KyraEngine_v3::o3_disableInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_disableInventory(%p) ()", (const void *)script); +int KyraEngine_MR::o3_disableInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_disableInventory(%p) ()", (const void *)script); _enableInventory = false; return 0; } -int KyraEngine_v3::o3_enableInventory(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_enableInventory(%p) ()", (const void *)script); +int KyraEngine_MR::o3_enableInventory(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_enableInventory(%p) ()", (const void *)script); _enableInventory = true; return 1; } -int KyraEngine_v3::o3_enterNewScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), +int KyraEngine_MR::o3_enterNewScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); _screen->hideMouse(); @@ -850,8 +851,8 @@ int KyraEngine_v3::o3_enterNewScene(EMCState *script) { return 0; } -int KyraEngine_v3::o3_switchScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_switchScene(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_switchScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_switchScene(%p) (%d)", (const void *)script, stackPos(0)); setGameFlag(1); _mainCharX = _mainCharacter.x1; _mainCharY = _mainCharacter.y1; @@ -861,13 +862,13 @@ int KyraEngine_v3::o3_switchScene(EMCState *script) { return 0; } -int KyraEngine_v3::o3_getShapeFlag1(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getShapeFlag1(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_getShapeFlag1(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getShapeFlag1(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return _screen->getShapeFlag1(stackPos(0), stackPos(1)); } -int KyraEngine_v3::o3_setMalcolmPos(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMalcolmPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setMalcolmPos(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setMalcolmPos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _mainCharX = stackPos(0); _mainCharY = stackPos(1); @@ -879,31 +880,31 @@ int KyraEngine_v3::o3_setMalcolmPos(EMCState *script) { return 0; } -int KyraEngine_v3::o3_stopMusic(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_stopMusic(%p) ()", (const void *)script); +int KyraEngine_MR::o3_stopMusic(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_stopMusic(%p) ()", (const void *)script); stopMusicTrack(); return 0; } -int KyraEngine_v3::o3_playWanderScoreViaMap(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_playWanderScoreViaMap(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); snd_playWanderScoreViaMap(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_playSoundEffect(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playSoundEffect(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_playSoundEffect(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_playSoundEffect(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); snd_playSoundEffect(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_getScore(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getScore(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getScore(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getScore(%p) ()", (const void *)script); return _score; } -int KyraEngine_v3::o3_blockOutRegion(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_MR::o3_blockOutRegion(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); const int x1 = stackPos(0); int y1 = stackPos(1); const int x2 = stackPos(2); @@ -918,46 +919,46 @@ int KyraEngine_v3::o3_blockOutRegion(EMCState *script) { return 0; } -int KyraEngine_v3::o3_showSceneStringsMessage(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showSceneStringsMessage(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_showSceneStringsMessage(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showSceneStringsMessage(%p) (%d)", (const void *)script, stackPos(0)); showMessage((const char*)getTableEntry(_sceneStrings, stackPos(0)), 0xFF, 0xF0); return 0; } -int KyraEngine_v3::o3_getRand(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_getRand(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) < stackPos(1)); return _rnd.getRandomNumberRng(stackPos(0), stackPos(1)); } -int KyraEngine_v3::o3_setDeathHandler(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setDeathHandler(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0)); _deathHandler = stackPos(0); return 0; } -int KyraEngine_v3::o3_showGoodConscience(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showGoodConscience(%p) ()", (const void *)script); +int KyraEngine_MR::o3_showGoodConscience(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showGoodConscience(%p) ()", (const void *)script); showGoodConscience(); return 0; } -int KyraEngine_v3::o3_goodConscienceChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_goodConscienceChat(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_goodConscienceChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_goodConscienceChat(%p) (%d)", (const void *)script, stackPos(0)); int id = stackPos(0); const char *str = (const char*)getTableEntry(_useActorBuffer ? _actorFile : _sceneStrings, id); goodConscienceChat(str, _vocHigh, id); return 0; } -int KyraEngine_v3::o3_hideGoodConscience(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_hideGoodConscience(%p) ()", (const void *)script); +int KyraEngine_MR::o3_hideGoodConscience(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_hideGoodConscience(%p) ()", (const void *)script); hideGoodConscience(); return 0; } -int KyraEngine_v3::o3_waitForConfirmationClick(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_waitForConfirmationClick(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0)); resetSkipFlag(); uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength; @@ -980,8 +981,8 @@ int KyraEngine_v3::o3_waitForConfirmationClick(EMCState *script) { return 1; } -int KyraEngine_v3::o3_defineRoomEntrance(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineRoomEntrance(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_defineRoomEntrance(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineRoomEntrance(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); switch (stackPos(0)) { case 0: _sceneEnterX1 = stackPos(1); @@ -1009,8 +1010,8 @@ int KyraEngine_v3::o3_defineRoomEntrance(EMCState *script) { return 0; } -int KyraEngine_v3::o3_runTemporaryScript(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_runTemporaryScript(%p) ('%s', %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3_runTemporaryScript(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_runTemporaryScript(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3)); const int newShapes = stackPos(1); const int unloadShapes = stackPos(2); @@ -1019,15 +1020,15 @@ int KyraEngine_v3::o3_runTemporaryScript(EMCState *script) { return 0; } -int KyraEngine_v3::o3_setSpecialSceneScriptRunTime(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSpecialSceneScriptRunTime(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setSpecialSceneScriptRunTime(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSpecialSceneScriptRunTime(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); assert(stackPos(0) >= 0 && stackPos(0) < 10); _sceneSpecialScriptsTimer[stackPos(0)] = _system->getMillis() + stackPos(1) * _tickLength; return 0; } -int KyraEngine_v3::o3_defineSceneAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", +int KyraEngine_MR::o3_defineSceneAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineSceneAnim(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12)); const int animId = stackPos(0); @@ -1042,9 +1043,7 @@ int KyraEngine_v3::o3_defineSceneAnim(EMCState *script) { int y2 = anim.y2 = stackPos(5); int w = anim.width = stackPos(6); int h = anim.height = stackPos(7); - anim.unk10 = stackPos(8); anim.specialSize = stackPos(9); - anim.unk14 = stackPos(10); anim.shapeIndex = stackPos(11); const char *filename = stackPosString(12); @@ -1083,15 +1082,15 @@ int KyraEngine_v3::o3_defineSceneAnim(EMCState *script) { return 9; } -int KyraEngine_v3::o3_updateSceneAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_updateSceneAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_updateSceneAnim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); updateSceneAnim(stackPos(0), stackPos(1)); _specialSceneScriptRunFlag = false; return 0; } -int KyraEngine_v3::o3_runActorScript(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_runActorScript(%p) ()", (const void *)script); +int KyraEngine_MR::o3_runActorScript(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_runActorScript(%p) ()", (const void *)script); EMCData data; EMCState state; memset(&data, 0, sizeof(data)); @@ -1124,31 +1123,31 @@ int KyraEngine_v3::o3_runActorScript(EMCState *script) { return 0; } -int KyraEngine_v3::o3_runDialog(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_runDialog(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_runDialog(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_runDialog(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); runDialog(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_malcolmRandomChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_malcolmRandomChat(%p) ()", (const void *)script); +int KyraEngine_MR::o3_malcolmRandomChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_malcolmRandomChat(%p) ()", (const void *)script); malcolmRandomChat(); return 0; } -int KyraEngine_v3::o3_setDlgIndex(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setDlgIndex(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setDlgIndex(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setDlgIndex(%p) (%d)", (const void *)script, stackPos(0)); setDlgIndex(stackPos(0)); return 0; } -int KyraEngine_v3::o3_getDlgIndex(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getDlgIndex(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getDlgIndex(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getDlgIndex(%p) ()", (const void *)script); return _mainCharacter.dlgIndex; } -int KyraEngine_v3::o3_defineScene(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_defineScene(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", +int KyraEngine_MR::o3_defineScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_defineScene(%p) (%d, '%s', %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7)); const int scene = stackPos(0); strcpy(_sceneList[scene].filename1, stackPosString(1)); @@ -1173,8 +1172,8 @@ int KyraEngine_v3::o3_defineScene(EMCState *script) { return 0; } -int KyraEngine_v3::o3_setConversationState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setConversationState(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int KyraEngine_MR::o3_setConversationState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setConversationState(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); int id = stackPos(0); const int dlgIndex = stackPos(1); const int value = stackPos(2); @@ -1203,8 +1202,8 @@ int KyraEngine_v3::o3_setConversationState(EMCState *script) { return (_conversationState[id][dlgIndex] = value); } -int KyraEngine_v3::o3_getConversationState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getConversationState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_getConversationState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getConversationState(%p) (%d)", (const void *)script, stackPos(0)); int id = stackPos(0); const int dlgIndex = _mainCharacter.dlgIndex; @@ -1232,14 +1231,14 @@ int KyraEngine_v3::o3_getConversationState(EMCState *script) { return _conversationState[id][dlgIndex]; } -int KyraEngine_v3::o3_changeChapter(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_changeChapter(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int KyraEngine_MR::o3_changeChapter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_changeChapter(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); changeChapter(stackPos(0), stackPos(1), stackPos(2), stackPos(3)); return 0; } -int KyraEngine_v3::o3_countItemInstances(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_countItemInstances(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_countItemInstances(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_countItemInstances(%p) (%d)", (const void *)script, stackPos(0)); int count = 0; const int16 item = stackPos(0); @@ -1259,47 +1258,47 @@ int KyraEngine_v3::o3_countItemInstances(EMCState *script) { return count; } -int KyraEngine_v3::o3_dialogStartScript(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_dialogStartScript(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_dialogStartScript(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_dialogStartScript(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); dialogStartScript(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_dialogEndScript(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_dialogEndScript(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_dialogEndScript(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_dialogEndScript(%p) (%d)", (const void *)script, stackPos(0)); dialogEndScript(stackPos(0)); return 0; } -int KyraEngine_v3::o3_setSpecialSceneScriptState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setSpecialSceneScriptState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); _specialSceneScriptState[stackPos(0)] = 1; return 1; } -int KyraEngine_v3::o3_clearSpecialSceneScriptState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_clearSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_clearSpecialSceneScriptState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_clearSpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); _specialSceneScriptState[stackPos(0)] = 0; return 0; } -int KyraEngine_v3::o3_querySpecialSceneScriptState(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_querySpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_querySpecialSceneScriptState(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_querySpecialSceneScriptState(%p) (%d)", (const void *)script, stackPos(0)); return _specialSceneScriptState[stackPos(0)]; } -int KyraEngine_v3::o3_setHiddenItemsEntry(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setHiddenItemsEntry(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setHiddenItemsEntry(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); return (_hiddenItems[stackPos(0)] = (uint16)stackPos(1)); } -int KyraEngine_v3::o3_getHiddenItemsEntry(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_getHiddenItemsEntry(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getHiddenItemsEntry(%p) (%d)", (const void *)script, stackPos(0)); return (int16)_hiddenItems[stackPos(0)]; } -int KyraEngine_v3::o3_customChat(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_customChat(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_customChat(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_customChat(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); const int id = stackPos(0); const int object = stackPos(1); const char *str = (const char *)getTableEntry(_sceneStrings, id); @@ -1316,16 +1315,16 @@ int KyraEngine_v3::o3_customChat(EMCState *script) { return 0; } -int KyraEngine_v3::o3_customChatFinish(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_customChatFinish(%p) ()", (const void *)script); +int KyraEngine_MR::o3_customChatFinish(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_customChatFinish(%p) ()", (const void *)script); _text->restoreScreen(); _chatText = 0; _chatObject = -1; return 0; } -int KyraEngine_v3::o3_setupSceneAnimObject(EMCState *script) { - debugC(9, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setupSceneAnimObject(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, +int KyraEngine_MR::o3_setupSceneAnimObject(EMCState *script) { + debugC(9, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setupSceneAnimObject(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPosString(12)); musicUpdate(0); @@ -1334,50 +1333,50 @@ int KyraEngine_v3::o3_setupSceneAnimObject(EMCState *script) { return 0; } -int KyraEngine_v3::o3_removeSceneAnimObject(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeSceneAnimObject(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_removeSceneAnimObject(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeSceneAnimObject(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); removeSceneAnimObject(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_disableTimer(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_disableTimer(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_disableTimer(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_disableTimer(%p) (%d)", (const void *)script, stackPos(0)); _timer->disable(stackPos(0)); return 0; } -int KyraEngine_v3::o3_enableTimer(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_enableTimer(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_enableTimer(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_enableTimer(%p) (%d)", (const void *)script, stackPos(0)); _timer->enable(stackPos(0)); return 0; } -int KyraEngine_v3::o3_setTimerCountdown(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setTimerCountdown(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3_setTimerCountdown(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setTimerCountdown(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); _timer->setCountdown(stackPos(0), stackPos(1)); return 0; } -int KyraEngine_v3::o3_setVocHigh(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setVocHigh(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3_setVocHigh(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setVocHigh(%p) (%d)", (const void *)script, stackPos(0)); _vocHigh = stackPos(0); return 0; } -int KyraEngine_v3::o3_getVocHigh(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getVocHigh(%p) ()", (const void *)script); +int KyraEngine_MR::o3_getVocHigh(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_getVocHigh(%p) ()", (const void *)script); return _vocHigh; } -int KyraEngine_v3::o3_dummy(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_dummy(%p) ()", (const void *)script); +int KyraEngine_MR::o3_dummy(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_dummy(%p) ()", (const void *)script); return 0; } #pragma mark - -int KyraEngine_v3::o3t_defineNewShapes(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3t_defineNewShapes(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script, +int KyraEngine_MR::o3t_defineNewShapes(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3t_defineNewShapes(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); strcpy(_newShapeFilename, stackPosString(0)); _newShapeLastEntry = stackPos(1); @@ -1388,8 +1387,8 @@ int KyraEngine_v3::o3t_defineNewShapes(EMCState *script) { return 0; } -int KyraEngine_v3::o3t_setCurrentFrame(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3t_setCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); +int KyraEngine_MR::o3t_setCurrentFrame(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3t_setCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); static const uint8 frameTable[] = { 0x58, 0xD8, 0xD8, 0x98, 0x78, 0x78, 0xB8, 0xB8 }; @@ -1403,23 +1402,23 @@ int KyraEngine_v3::o3t_setCurrentFrame(EMCState *script) { return 0; } -int KyraEngine_v3::o3t_setNewShapeFlag(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3t_setNewShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3t_setNewShapeFlag(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3t_setNewShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); _newShapeFlag = stackPos(0); return 0; } #pragma mark - -int KyraEngine_v3::o3d_updateAnim(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3d_updateAnim(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3d_updateAnim(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_updateAnim(%p) (%d)", (const void *)script, stackPos(0)); if (_dialogSceneAnim >= 0) updateSceneAnim(_dialogSceneAnim, stackPos(0)); return 0; } -int KyraEngine_v3::o3d_delay(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3d_delay(%p) (%d)", (const void *)script, stackPos(0)); +int KyraEngine_MR::o3d_delay(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_delay(%p) (%d)", (const void *)script, stackPos(0)); const uint32 endTime = _system->getMillis() + stackPos(0) * _tickLength; while (_system->getMillis() < endTime) { if (_chatText) @@ -1433,11 +1432,11 @@ int KyraEngine_v3::o3d_delay(EMCState *script) { #pragma mark - -typedef Common::Functor1Mem<EMCState*, int, KyraEngine_v3> OpcodeV3; +typedef Common::Functor1Mem<EMCState*, int, KyraEngine_MR> OpcodeV3; #define SetOpcodeTable(x) table = &x; -#define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_v3::x)) +#define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_MR::x)) #define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0)) -void KyraEngine_v3::setupOpcodeTable() { +void KyraEngine_MR::setupOpcodeTable() { Common::Array<const Opcode*> *table = 0; SetOpcodeTable(_opcodes); diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_hof.cpp index 8e089f58be..6a170b1127 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -24,19 +24,20 @@ */ #include "kyra/kyra.h" -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/screen.h" #include "kyra/wsamovie.h" #include "kyra/sound.h" -#include "kyra/text_v2.h" +#include "kyra/text_hof.h" #include "kyra/timer.h" +#include "kyra/resource.h" #include "common/system.h" namespace Kyra { -void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_playSequences(%i, %i)", startSeq, endSeq); +void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_playSequences(%i, %i)", startSeq, endSeq); seq_init(); bool allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (startSeq == kSequenceTitle)) ? false : true; @@ -329,8 +330,8 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { seq_uninit(); } -int KyraEngine_v2::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introWestwood(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); +int KyraEngine_HoF::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introWestwood(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); if (frm == -2) { if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) @@ -342,8 +343,8 @@ int KyraEngine_v2::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) return 0; } -int KyraEngine_v2::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introTitle(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); +int KyraEngine_HoF::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introTitle(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); if (frm == 1) { _sound->playTrack(3); @@ -364,8 +365,8 @@ int KyraEngine_v2::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introOverview(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); +int KyraEngine_HoF::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introOverview(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); uint8 *tmpPal = &(_screen->getPalette(3)[0x101]); memset(tmpPal, 0, 256); @@ -464,8 +465,8 @@ int KyraEngine_v2::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm) return 0; } -int KyraEngine_v2::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introLibrary(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); +int KyraEngine_HoF::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introLibrary(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); switch (_seqFrameCounter) { case 0: @@ -540,8 +541,8 @@ int KyraEngine_v2::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm) { } -int KyraEngine_v2::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introHand(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); +int KyraEngine_HoF::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introHand(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm); switch (_seqFrameCounter) { case 0: @@ -624,7 +625,7 @@ int KyraEngine_v2::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == -2) { seq_waitForTextsTimeout(); _seqEndTime = 0; @@ -657,7 +658,7 @@ int KyraEngine_v2::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == -2) { seq_waitForTextsTimeout(); _seqEndTime = 0; @@ -746,7 +747,7 @@ int KyraEngine_v2::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 2) seq_waitForTextsTimeout(); else if (frm == 3) @@ -755,13 +756,13 @@ int KyraEngine_v2::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) { } -int KyraEngine_v2::seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 1) seq_playTalkText(12); return frm; } -int KyraEngine_v2::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 11) seq_waitForTextsTimeout(); else if (frm == 12) @@ -770,7 +771,7 @@ int KyraEngine_v2::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -int KyraEngine_v2::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 11) seq_waitForTextsTimeout(); else if (frm == 3) @@ -778,17 +779,17 @@ int KyraEngine_v2::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -int KyraEngine_v2::seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm) { //NULLSUB (at least in fm-towns version) return frm; } -int KyraEngine_v2::seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm) { //NULLSUB (at least in fm-towns version) return frm; } -int KyraEngine_v2::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 36) { seq_waitForTextsTimeout(); _seqEndTime = 0; @@ -796,34 +797,34 @@ int KyraEngine_v2::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -int KyraEngine_v2::seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm) { //NULLSUB (at least in fm-towns version) return frm; } -int KyraEngine_v2::seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 15) frm = 12; return frm; } -int KyraEngine_v2::seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 8) frm = 4; return frm; } -int KyraEngine_v2::seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm) { //NULLSUB (at least in fm-towns version) return frm; } -int KyraEngine_v2::seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm) { //NULLSUB (at least in fm-towns version) return frm; } -int KyraEngine_v2::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -907,7 +908,7 @@ int KyraEngine_v2::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm) return 0; } -int KyraEngine_v2::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -991,7 +992,7 @@ int KyraEngine_v2::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -1068,7 +1069,7 @@ int KyraEngine_v2::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -1150,7 +1151,7 @@ int KyraEngine_v2::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -1220,7 +1221,7 @@ int KyraEngine_v2::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -1320,7 +1321,7 @@ int KyraEngine_v2::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm) { uint32 endtime = 0; int chatX = 0; int chatY = 0; @@ -1412,7 +1413,7 @@ int KyraEngine_v2::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm) return 0; } -int KyraEngine_v2::seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm) { int tmp = 0; switch (frm) { @@ -1506,7 +1507,7 @@ int KyraEngine_v2::seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -void KyraEngine_v2::seq_finaleActorScreen() { +void KyraEngine_HoF::seq_finaleActorScreen() { static const uint8 colormap[] = {0, 0, 102, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static const ScreenDim d = { 0x00, 0x0C, 0x28, 0xB4, 0xFF, 0x00, 0x00, 0x00 }; @@ -1540,7 +1541,7 @@ void KyraEngine_v2::seq_finaleActorScreen() { _sound->loadSoundFile(0); } -int KyraEngine_v2::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (_seqFrameCounter == 10) _seqEndTime = 0; if (_seqFrameCounter == 10 || _seqFrameCounter == 5 || _seqFrameCounter == 7) @@ -1550,18 +1551,18 @@ int KyraEngine_v2::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -int KyraEngine_v2::seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (!frm) delay(50 * _tickLength); return 0; } -int KyraEngine_v2::seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (!frm) _sound->playTrack(2); return 0; } -int KyraEngine_v2::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (!frm) { _sound->playTrack(3); } else if (frm == 25) { @@ -1572,7 +1573,7 @@ int KyraEngine_v2::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (!frm) { _sound->playTrack(4); } else if (frm == 25) { @@ -1592,7 +1593,7 @@ int KyraEngine_v2::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) { switch (frm) { case 12: seq_playTalkText(4); @@ -1633,7 +1634,7 @@ int KyraEngine_v2::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (!_seqFrameCounter) seq_loadNestedSequence(0, kSequenceDemoWharf2); @@ -1674,7 +1675,7 @@ int KyraEngine_v2::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 0) { if (!(_seqFrameCounter/8)) { seq_loadNestedSequence(0, kSequenceDemoDinob2); @@ -1695,7 +1696,7 @@ int KyraEngine_v2::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (((_system->getMillis() - _seqStartTime) / (5 * _tickLength)) > 0) { _seqStartTime = _system->getMillis(); if (!_seqFrameCounter) { @@ -1737,14 +1738,14 @@ int KyraEngine_v2::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) { return 0; } -int KyraEngine_v2::seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 69) _seqWsaCurrentFrame = 8; return frm; } -int KyraEngine_v2::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) { switch (frm) { case 19: seq_playTalkText(13); @@ -1774,21 +1775,21 @@ int KyraEngine_v2::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -int KyraEngine_v2::seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm) { if (frm == 1) seq_playTalkText(11); return frm; } -int KyraEngine_v2::seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -int KyraEngine_v2::seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm) { +int KyraEngine_HoF::seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm) { return frm; } -uint32 KyraEngine_v2::seq_activeTextsTimeLeft() { +uint32 KyraEngine_HoF::seq_activeTextsTimeLeft() { uint32 res = 0; for (int i = 0; i < 10; i++) { @@ -1804,7 +1805,7 @@ uint32 KyraEngine_v2::seq_activeTextsTimeLeft() { return res; } -void KyraEngine_v2::seq_processWSAs() { +void KyraEngine_HoF::seq_processWSAs() { for (int i = 0; i < 8; i++) { if (_activeWSA[i].flags != -1) { if (seq_processNextSubFrame(i)) @@ -1813,7 +1814,7 @@ void KyraEngine_v2::seq_processWSAs() { } } -void KyraEngine_v2::seq_processText() { +void KyraEngine_HoF::seq_processText() { Screen::FontId curFont = _screen->setFont(Screen::FID_GOLDFONT_FNT); int curPage = _screen->setCurPage(2); char outputStr[70]; @@ -1849,7 +1850,7 @@ void KyraEngine_v2::seq_processText() { _screen->setFont(curFont); } -char *KyraEngine_v2::seq_preprocessString(const char *srcStr, int width) { +char *KyraEngine_HoF::seq_preprocessString(const char *srcStr, int width) { char *dstStr = _seqProcessedString; int lineStart = 0; int linePos = 0; @@ -1875,7 +1876,7 @@ char *KyraEngine_v2::seq_preprocessString(const char *srcStr, int width) { return strlen(_seqProcessedString) ? dstStr : 0; } -void KyraEngine_v2::seq_sequenceCommand(int command) { +void KyraEngine_HoF::seq_sequenceCommand(int command) { uint8 pal[768]; for (int i = 0; i < 8; i++) @@ -1954,7 +1955,7 @@ void KyraEngine_v2::seq_sequenceCommand(int command) { } } -void KyraEngine_v2::seq_cmpFadeFrame(const char *cmpFile) { +void KyraEngine_HoF::seq_cmpFadeFrame(const char *cmpFile) { _screen->copyPage(10, 2); _screen->copyPage(4, 10); _screen->clearPage(6); @@ -1976,8 +1977,8 @@ void KyraEngine_v2::seq_cmpFadeFrame(const char *cmpFile) { _screen->copyPage(10, 4); } -void KyraEngine_v2::seq_playTalkText(uint8 chatNum) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_playTalkText(%i)", chatNum); +void KyraEngine_HoF::seq_playTalkText(uint8 chatNum) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_playTalkText(%i)", chatNum); assert(chatNum < _sequenceSoundListSize); @@ -1988,8 +1989,8 @@ void KyraEngine_v2::seq_playTalkText(uint8 chatNum) { _sound->voicePlay(_sequenceSoundList[chatNum]); } -void KyraEngine_v2::seq_waitForTextsTimeout() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_waitForTextsTimeout()"); +void KyraEngine_HoF::seq_waitForTextsTimeout() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_waitForTextsTimeout()"); uint32 longest = seq_activeTextsTimeLeft() + _system->getMillis(); uint32 now = _system->getMillis(); @@ -2005,14 +2006,14 @@ void KyraEngine_v2::seq_waitForTextsTimeout() { seq_resetAllTextEntries(); } -void KyraEngine_v2::seq_resetAllTextEntries() { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_resetAllTextEntries()"); +void KyraEngine_HoF::seq_resetAllTextEntries() { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_resetAllTextEntries()"); for (int i = 0; i < 10; i++) _activeText[i].duration = -1; } -int KyraEngine_v2::seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_setTextEntry(%i, %i, %i, %i, %i)", strIndex, posX, posY, duration, width); +int KyraEngine_HoF::seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, int duration, uint16 width) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_setTextEntry(%i, %i, %i, %i, %i)", strIndex, posX, posY, duration, width); for (int i = 0; i < 10; i++) { if (_activeText[i].duration != -1) { @@ -2035,8 +2036,8 @@ int KyraEngine_v2::seq_setTextEntry(uint16 strIndex, uint16 posX, uint16 posY, i return -1; } -void KyraEngine_v2::seq_loadNestedSequence(int wsaNum, int seqNum) { - debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_loadNestedSequence(%i, %i)", wsaNum, seqNum); +void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) { + debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_loadNestedSequence(%i, %i)", wsaNum, seqNum); if (_activeWSA[wsaNum].flags != -1) return; @@ -2082,7 +2083,7 @@ void KyraEngine_v2::seq_loadNestedSequence(int wsaNum, int seqNum) { _activeWSA[wsaNum].nextFrame = _system->getMillis(); } -void KyraEngine_v2::seq_nestedSequenceFrame(int command, int wsaNum) { +void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) { int xa = 0, ya = 0; command--; if (!_activeWSA[wsaNum].movie || skipFlag() || _quitFlag || _abortIntroFlag) @@ -2154,7 +2155,7 @@ void KyraEngine_v2::seq_nestedSequenceFrame(int command, int wsaNum) { } } -void KyraEngine_v2::seq_animatedSubFrame(int srcPage, int dstPage, int delaytime, int steps, +void KyraEngine_HoF::seq_animatedSubFrame(int srcPage, int dstPage, int delaytime, int steps, int x, int y, int w, int h, int openClose, int directionFlags) { if (openClose) { for (int i = 1; i < steps; i++) { @@ -2203,7 +2204,7 @@ void KyraEngine_v2::seq_animatedSubFrame(int srcPage, int dstPage, int delaytime } } -void KyraEngine_v2::seq_resetActiveWSA(int wsaNum) { +void KyraEngine_HoF::seq_resetActiveWSA(int wsaNum) { if (_activeWSA[wsaNum].flags == -1) return; @@ -2212,7 +2213,7 @@ void KyraEngine_v2::seq_resetActiveWSA(int wsaNum) { _activeWSA[wsaNum].movie->close(); } -void KyraEngine_v2::seq_unloadWSA(int wsaNum) { +void KyraEngine_HoF::seq_unloadWSA(int wsaNum) { if (_activeWSA[wsaNum].movie) { _activeWSA[wsaNum].movie->close(); delete _activeWSA[wsaNum].movie; @@ -2220,7 +2221,7 @@ void KyraEngine_v2::seq_unloadWSA(int wsaNum) { } } -bool KyraEngine_v2::seq_processNextSubFrame(int wsaNum) { +bool KyraEngine_HoF::seq_processNextSubFrame(int wsaNum) { uint32 currentFrame = _activeWSA[wsaNum].currentFrame; uint32 currentTime = _system->getMillis(); @@ -2283,7 +2284,7 @@ bool KyraEngine_v2::seq_processNextSubFrame(int wsaNum) { return res; } -void KyraEngine_v2::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) { +void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) { uint8 colormap[16]; if (skipFlag() || _quitFlag || _abortIntroFlag || _menuChoice) return; @@ -2324,7 +2325,7 @@ void KyraEngine_v2::seq_printCreditsString(uint16 strIndex, int x, int y, const _seqTextColor[0] = seqTextColor0; } -void KyraEngine_v2::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovieV2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) { +void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovieV2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) { int dur = int(strlen(_sequenceStrings[strIndex])) * (_flags.isTalkie ? 7 : 15); int entry = textEnabled() ? seq_setTextEntry(strIndex, x, y, dur, width) : strIndex; _activeText[entry].textcolor = textColor; @@ -2383,7 +2384,7 @@ void KyraEngine_v2::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, in _seqWsaCurrentFrame = curframe; } -void KyraEngine_v2::seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, +void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData, const char *const *specialData) { if (!data) @@ -2540,7 +2541,7 @@ void KyraEngine_v2::seq_displayScrollText(uint8 *data, const ScreenDim *d, int t delete [] tmpStringTable; } -void KyraEngine_v2::seq_scrollPage() { +void KyraEngine_HoF::seq_scrollPage() { int dstY, dstH, srcH; static const ScreenDim d = { 0x00, 0x00, 0x28, 0x320, 0xFF, 0xFE, 0x00, 0x00 }; @@ -2561,7 +2562,7 @@ void KyraEngine_v2::seq_scrollPage() { ActiveItemAnim *a = &_activeItemAnim[i]; _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4); - _screen->drawShape(4, _defaultShapeTable[def->itemIndex + def->frames[a->currentFrame]], 12, def->y - 8, 0, 0); + _screen->drawShape(4, getShapePtr(def->itemIndex + def->frames[a->currentFrame]), 12, def->y - 8, 0, 0); if(_seqFrameCounter % 2 == 0) a->currentFrame = ++a->currentFrame % 20; } @@ -2569,7 +2570,7 @@ void KyraEngine_v2::seq_scrollPage() { } } -void KyraEngine_v2::seq_showStarcraftLogo() { +void KyraEngine_HoF::seq_showStarcraftLogo() { WSAMovieV2 *ci = new WSAMovieV2(this, _screen); assert(ci); _screen->clearPage(2); @@ -2610,7 +2611,7 @@ void KyraEngine_v2::seq_showStarcraftLogo() { delete ci; } -void KyraEngine_v2::seq_init() { +void KyraEngine_HoF::seq_init() { _seqProcessedString = new char[200]; _seqWsa = new WSAMovieV2(this, _screen); _activeWSA = new ActiveWSA[8]; @@ -2631,8 +2632,8 @@ void KyraEngine_v2::seq_init() { do { numShp++; - _defaultShapeTable[numShp] = _screen->getPtrToShape(_newShapeFiledata, numShp); - } while (_defaultShapeTable[numShp]); + addShapeToPool(_screen->getPtrToShape(_newShapeFiledata, numShp), numShp); + } while (getShapePtr(numShp)); } else { MainMenu::StaticData data = { { _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98] }, @@ -2645,7 +2646,7 @@ void KyraEngine_v2::seq_init() { } } -void KyraEngine_v2::seq_uninit() { +void KyraEngine_HoF::seq_uninit() { delete [] _seqProcessedString; _seqProcessedString = NULL; @@ -2664,7 +2665,7 @@ void KyraEngine_v2::seq_uninit() { if (_flags.isDemo && !_flags.isTalkie) _staticres->unloadId(k2SeqplayShapeAnimData); - memset(&_defaultShapeTable, 0, sizeof(_defaultShapeTable)); + _gameShapes.clear(); delete _menu; _menu = 0; @@ -2674,7 +2675,7 @@ void KyraEngine_v2::seq_uninit() { #pragma mark - Ingame sequences #pragma mark - -void KyraEngine_v2::seq_makeBookOrCauldronAppear(int type) { +void KyraEngine_HoF::seq_makeBookOrCauldronAppear(int type) { _screen->hideMouse(); showMessage(0, 0xCF); @@ -2708,7 +2709,7 @@ void KyraEngine_v2::seq_makeBookOrCauldronAppear(int type) { _screen->showMouse(); } -void KyraEngine_v2::seq_makeBookAppear() { +void KyraEngine_HoF::seq_makeBookAppear() { _screen->hideMouse(); displayInvWsaLastFrame(); diff --git a/engines/kyra/sequences_v3.cpp b/engines/kyra/sequences_mr.cpp index 5a67c3bd68..a09e4f7232 100644 --- a/engines/kyra/sequences_v3.cpp +++ b/engines/kyra/sequences_mr.cpp @@ -23,13 +23,13 @@ * */ -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" #include "kyra/resource.h" namespace Kyra { -void KyraEngine_v3::showBadConscience() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::showBadConscience()"); +void KyraEngine_MR::showBadConscience() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::showBadConscience()"); if (_badConscienceShown) return; @@ -90,8 +90,8 @@ void KyraEngine_v3::showBadConscience() { refreshAnimObjectsIfNeed(); } -void KyraEngine_v3::hideBadConscience() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::hideBadConscience()"); +void KyraEngine_MR::hideBadConscience() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::hideBadConscience()"); if (!_badConscienceShown) return; @@ -109,8 +109,8 @@ void KyraEngine_v3::hideBadConscience() { setNextIdleAnimTimer(); } -void KyraEngine_v3::showGoodConscience() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::showGoodConscience()"); +void KyraEngine_MR::showGoodConscience() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::showGoodConscience()"); if (_goodConscienceShown) return; @@ -164,8 +164,8 @@ void KyraEngine_v3::showGoodConscience() { refreshAnimObjectsIfNeed(); } -void KyraEngine_v3::hideGoodConscience() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::hideGoodConscience()"); +void KyraEngine_MR::hideGoodConscience() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::hideGoodConscience()"); if (!_goodConscienceShown) return; @@ -183,8 +183,8 @@ void KyraEngine_v3::hideGoodConscience() { setNextIdleAnimTimer(); } -void KyraEngine_v3::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runTemporaryScript('%s', %d, %d, %d, %d)", filename, allowSkip, resetChar, newShapes, shapeUnload); +void KyraEngine_MR::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runTemporaryScript('%s', %d, %d, %d, %d)", filename, allowSkip, resetChar, newShapes, shapeUnload); memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData)); memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState)); @@ -231,8 +231,8 @@ void KyraEngine_v3::runTemporaryScript(const char *filename, int allowSkip, int _emc->unload(&_temporaryScriptData); } -void KyraEngine_v3::eelScript() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::eelScript()"); +void KyraEngine_MR::eelScript() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::eelScript()"); if (_chatText) return; _screen->hideMouse(); @@ -277,16 +277,16 @@ void KyraEngine_v3::eelScript() { _screen->showMouse(); } -int KyraEngine_v3::initNewShapes(uint8 *filedata) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::initNewShapes(%p)", (const void*)filedata); +int KyraEngine_MR::initNewShapes(uint8 *filedata) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::initNewShapes(%p)", (const void*)filedata); const int lastEntry = MIN(_newShapeLastEntry, 41); for (int i = 0; i < lastEntry; ++i) _gameShapes[9+i] = _screen->getPtrToShape(filedata, i); return lastEntry; } -void KyraEngine_v3::processNewShapes(int allowSkip, int resetChar) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::processNewShapes(%d, %d)", allowSkip, resetChar); +void KyraEngine_MR::processNewShapes(int allowSkip, int resetChar) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::processNewShapes(%d, %d)", allowSkip, resetChar); setCharacterAnimDim(_newShapeWidth, _newShapeHeight); _emc->init(&_temporaryScriptState, &_temporaryScriptData); @@ -342,8 +342,8 @@ void KyraEngine_v3::processNewShapes(int allowSkip, int resetChar) { resetCharacterAnimDim(); } -void KyraEngine_v3::resetNewShapes(int count, uint8 *filedata) { - debugC(9, kDebugLevelAnimator, "KyraEngine_v3::resetNewShapes(%d, %p)", count, (const void*)filedata); +void KyraEngine_MR::resetNewShapes(int count, uint8 *filedata) { + debugC(9, kDebugLevelAnimator, "KyraEngine_MR::resetNewShapes(%d, %p)", count, (const void*)filedata); for (int i = 0; i < count; ++i) _gameShapes[9+i] = 0; delete [] filedata; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index dca9342def..6f9d005288 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -28,12 +28,12 @@ #include "common/md5.h" #include "kyra/kyra.h" #include "kyra/kyra_v1.h" -#include "kyra/kyra_v2.h" -#include "kyra/kyra_v3.h" +#include "kyra/kyra_hof.h" +#include "kyra/kyra_mr.h" #include "kyra/screen.h" #include "kyra/screen_v1.h" -#include "kyra/screen_v2.h" -#include "kyra/screen_v3.h" +#include "kyra/screen_hof.h" +#include "kyra/screen_mr.h" #include "kyra/resource.h" #include "kyra/gui_v1.h" #include "kyra/gui_v2.h" @@ -1179,7 +1179,7 @@ void KyraEngine_v1::loadMainScreen(int page) { _screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0); } -void KyraEngine_v2::initStaticResource() { +void KyraEngine_HoF::initStaticResource() { int tmpSize = 0; _sequencePakList = _staticres->loadStrings(k2SeqplayPakFiles, _sequencePakListSize); @@ -1252,37 +1252,37 @@ void KyraEngine_v2::initStaticResource() { _sequences = _staticres->loadHofSequenceData(k2SeqplaySeqData, tmpSize); static const SeqProc hofSequenceCallbacks[] = { 0, - &KyraEngine_v2::seq_introWestwood, - &KyraEngine_v2::seq_introTitle, &KyraEngine_v2::seq_introOverview, - &KyraEngine_v2::seq_introLibrary, &KyraEngine_v2::seq_introHand, - &KyraEngine_v2::seq_introPoint, &KyraEngine_v2::seq_introZanfaun, - &KyraEngine_v2::seq_finaleFunters, &KyraEngine_v2::seq_finaleFerb, - &KyraEngine_v2::seq_finaleFish, &KyraEngine_v2::seq_finaleFheep, - &KyraEngine_v2::seq_finaleFarmer, &KyraEngine_v2::seq_finaleFuards, - &KyraEngine_v2::seq_finaleFirates, &KyraEngine_v2::seq_finaleFrash + &KyraEngine_HoF::seq_introWestwood, + &KyraEngine_HoF::seq_introTitle, &KyraEngine_HoF::seq_introOverview, + &KyraEngine_HoF::seq_introLibrary, &KyraEngine_HoF::seq_introHand, + &KyraEngine_HoF::seq_introPoint, &KyraEngine_HoF::seq_introZanfaun, + &KyraEngine_HoF::seq_finaleFunters, &KyraEngine_HoF::seq_finaleFerb, + &KyraEngine_HoF::seq_finaleFish, &KyraEngine_HoF::seq_finaleFheep, + &KyraEngine_HoF::seq_finaleFarmer, &KyraEngine_HoF::seq_finaleFuards, + &KyraEngine_HoF::seq_finaleFirates, &KyraEngine_HoF::seq_finaleFrash }; static const SeqProc hofNestedSequenceCallbacks[] = { - &KyraEngine_v2::seq_finaleFiggle, &KyraEngine_v2::seq_introOver1, - &KyraEngine_v2::seq_introOver2, &KyraEngine_v2::seq_introForest, - &KyraEngine_v2::seq_introDragon, &KyraEngine_v2::seq_introDarm, - &KyraEngine_v2::seq_introLibrary2, &KyraEngine_v2::seq_introLibrary2, - &KyraEngine_v2::seq_introMarco, &KyraEngine_v2::seq_introHand1a, - &KyraEngine_v2::seq_introHand1b, &KyraEngine_v2::seq_introHand1c, - &KyraEngine_v2::seq_introHand2, &KyraEngine_v2::seq_introHand3, 0 + &KyraEngine_HoF::seq_finaleFiggle, &KyraEngine_HoF::seq_introOver1, + &KyraEngine_HoF::seq_introOver2, &KyraEngine_HoF::seq_introForest, + &KyraEngine_HoF::seq_introDragon, &KyraEngine_HoF::seq_introDarm, + &KyraEngine_HoF::seq_introLibrary2, &KyraEngine_HoF::seq_introLibrary2, + &KyraEngine_HoF::seq_introMarco, &KyraEngine_HoF::seq_introHand1a, + &KyraEngine_HoF::seq_introHand1b, &KyraEngine_HoF::seq_introHand1c, + &KyraEngine_HoF::seq_introHand2, &KyraEngine_HoF::seq_introHand3, 0 }; static const SeqProc hofDemoSequenceCallbacks[] = { - &KyraEngine_v2::seq_demoVirgin, &KyraEngine_v2::seq_demoWestwood, - &KyraEngine_v2::seq_demoTitle, &KyraEngine_v2::seq_demoHill, - &KyraEngine_v2::seq_demoOuthome, &KyraEngine_v2::seq_demoWharf, - &KyraEngine_v2::seq_demoDinob, &KyraEngine_v2::seq_demoFisher, 0 + &KyraEngine_HoF::seq_demoVirgin, &KyraEngine_HoF::seq_demoWestwood, + &KyraEngine_HoF::seq_demoTitle, &KyraEngine_HoF::seq_demoHill, + &KyraEngine_HoF::seq_demoOuthome, &KyraEngine_HoF::seq_demoWharf, + &KyraEngine_HoF::seq_demoDinob, &KyraEngine_HoF::seq_demoFisher, 0 }; static const SeqProc hofDemoNestedSequenceCallbacks[] = { - &KyraEngine_v2::seq_demoWharf2, &KyraEngine_v2::seq_demoDinob2, - &KyraEngine_v2::seq_demoWater, &KyraEngine_v2::seq_demoBail, - &KyraEngine_v2::seq_demoDig, 0 + &KyraEngine_HoF::seq_demoWharf2, &KyraEngine_HoF::seq_demoDinob2, + &KyraEngine_HoF::seq_demoWater, &KyraEngine_HoF::seq_demoBail, + &KyraEngine_HoF::seq_demoDig, 0 }; _callbackS = (_flags.isDemo && !_flags.isTalkie) ? hofDemoSequenceCallbacks : hofSequenceCallbacks; @@ -1305,7 +1305,7 @@ const ScreenDim Screen_v1::_screenDimTable[] = { const int Screen_v1::_screenDimTableCount = ARRAYSIZE(Screen_v1::_screenDimTable); -const ScreenDim Screen_v2::_screenDimTable[] = { +const ScreenDim Screen_HoF::_screenDimTable[] = { { 0x00, 0x00, 0x28, 0xC8, 0xC7, 0xCF, 0x00, 0x00 }, { 0x08, 0x48, 0x18, 0x38, 0xC7, 0xCF, 0x00, 0x00 }, { 0x00, 0x00, 0x28, 0x90, 0xC7, 0xCF, 0x00, 0x00 }, @@ -1320,16 +1320,16 @@ const ScreenDim Screen_v2::_screenDimTable[] = { { 0x0A, 0x96, 0x14, 0x30, 0x19, 0xF0, 0x00, 0x00 } // menu, just present for current menu code }; -const int Screen_v2::_screenDimTableCount = ARRAYSIZE(Screen_v2::_screenDimTable); +const int Screen_HoF::_screenDimTableCount = ARRAYSIZE(Screen_HoF::_screenDimTable); -const ScreenDim Screen_v3::_screenDimTable[] = { +const ScreenDim Screen_MR::_screenDimTable[] = { { 0x00, 0x00, 0x28, 0xC8, 0xFF, 0xF0, 0x00, 0x00 }, { 0x08, 0x48, 0x18, 0x38, 0xFF, 0xF0, 0x00, 0x00 }, { 0x00, 0x00, 0x28, 0xBC, 0xFF, 0xF0, 0x00, 0x00 }, { 0x0A, 0x96, 0x14, 0x30, 0x19, 0xF0, 0x00, 0x00 } }; -const int Screen_v3::_screenDimTableCount = ARRAYSIZE(Screen_v3::_screenDimTable); +const int Screen_MR::_screenDimTableCount = ARRAYSIZE(Screen_MR::_screenDimTable); const int8 KyraEngine::_addXPosTable[] = { 4, 4, 0, -4, -4, -4, 0, 4 @@ -1510,7 +1510,7 @@ const int KyraEngine_v1::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v1::_dosTrackMa // Kyra 2 and 3 main menu -const char *KyraEngine_v3::_mainMenuStrings[] = { +const char *KyraEngine_MR::_mainMenuStrings[] = { "Start a new game", "Introduction", "Load a game", @@ -1528,9 +1528,9 @@ const char *KyraEngine_v3::_mainMenuStrings[] = { // kyra 2 static res -const uint8 KyraEngine_v2::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f }; +const uint8 KyraEngine_HoF::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f }; -const char *KyraEngine_v2::_languageExtension[] = { +const char *KyraEngine_HoF::_languageExtension[] = { "ENG", "FRE", "GER",/*, @@ -1539,7 +1539,7 @@ const char *KyraEngine_v2::_languageExtension[] = { "JPN" }; -const char *KyraEngine_v2::_scriptLangExt[] = { +const char *KyraEngine_HoF::_scriptLangExt[] = { "EMC", "FMC", "GMC",/*, @@ -1548,19 +1548,19 @@ const char *KyraEngine_v2::_scriptLangExt[] = { "JMC" }; -const int KyraEngine_v2::_characterFrameTable[] = { +const int KyraEngine_HoF::_characterFrameTable[] = { 0x19, 0x09, 0x09, 0x12, 0x12, 0x12, 0x09, 0x09 }; -const int KyraEngine_v2::_inventoryX[] = { +const int KyraEngine_HoF::_inventoryX[] = { 0x4F, 0x63, 0x77, 0x8B, 0x9F, 0x4F, 0x63, 0x77, 0x8B, 0x9F }; -const int KyraEngine_v2::_inventoryY[] = { +const int KyraEngine_HoF::_inventoryY[] = { 0x95, 0x95, 0x95, 0x95, 0x95, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA }; -const byte KyraEngine_v2::_itemStringMap[] = { +const byte KyraEngine_HoF::_itemStringMap[] = { 2, 2, 0, 0, 2, 2, 2, 0, 2, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, @@ -1585,9 +1585,9 @@ const byte KyraEngine_v2::_itemStringMap[] = { 0, 2, 0, 0, 0, 0, 0, 0 }; -const int KyraEngine_v2::_itemStringMapSize = ARRAYSIZE(KyraEngine_v2::_itemStringMap); +const int KyraEngine_HoF::_itemStringMapSize = ARRAYSIZE(KyraEngine_HoF::_itemStringMap); -const int8 KyraEngine_v2::_dosTrackMap[] = { +const int8 KyraEngine_HoF::_dosTrackMap[] = { -1, 0, -1, 1, 9, 6, 5, 4, 8, 3, -2, 0, -2, 0, 2, 3, -2, 0, -2, 0, -2, 0, -2, 0, @@ -1612,9 +1612,9 @@ const int8 KyraEngine_v2::_dosTrackMap[] = { 4, 3, 4, 4, 4, 5, 4, 6 }; -const int KyraEngine_v2::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v2::_dosTrackMap); +const int KyraEngine_HoF::_dosTrackMapSize = ARRAYSIZE(KyraEngine_HoF::_dosTrackMap); -void KyraEngine_v2::initInventoryButtonList() { +void KyraEngine_HoF::initInventoryButtonList() { delete [] _inventoryButtons; _inventoryButtons = new Button[15]; @@ -1624,18 +1624,18 @@ void KyraEngine_v2::initInventoryButtonList() { _inventoryButtons[0].buttonCallback = BUTTON_FUNCTOR(GUI_v2, _gui, &GUI_v2::optionsButton); GUI_V2_BUTTON(_inventoryButtons[1], 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::cauldronButton); + _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronButton); GUI_V2_BUTTON(_inventoryButtons[2], 0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::cauldronClearButton); + _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronClearButton); GUI_V2_BUTTON(_inventoryButtons[3], 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookButton); + _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookButton); GUI_V2_BUTTON(_inventoryButtons[4], 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); - _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::scrollInventory); + _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::scrollInventory); - Button::Callback inventoryCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::buttonInventory); + Button::Callback inventoryCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::buttonInventory); GUI_V2_BUTTON(_inventoryButtons[5], 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); GUI_V2_BUTTON(_inventoryButtons[6], 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); GUI_V2_BUTTON(_inventoryButtons[7], 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0); @@ -1831,7 +1831,7 @@ const int GUI_v2::_sliderBarsPosition[] = { 0x92, 0x1F, 0x92, 0x30, 0x92, 0x41, 0x92, 0x52 }; -const uint16 KyraEngine_v2::_itemMagicTable[] = { +const uint16 KyraEngine_HoF::_itemMagicTable[] = { 0x0D, 0x0A, 0x0B, 0, 0x0D, 0x0B, 0x0A, 0, 0x0D, 0x38, 0x37, 0, @@ -1863,17 +1863,17 @@ const uint16 KyraEngine_v2::_itemMagicTable[] = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF }; -const int KyraEngine_v2::_bookPageYOffset[] = { +const int KyraEngine_HoF::_bookPageYOffset[] = { 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2 }; -const byte KyraEngine_v2::_bookTextColorMap[] = { +const byte KyraEngine_HoF::_bookTextColorMap[] = { 0x00, 0xC7, 0xCF, 0x00 }; -const int16 KyraEngine_v2::_cauldronProtectedItems[] = { +const int16 KyraEngine_HoF::_cauldronProtectedItems[] = { 0x07, 0x0D, 0x47, 0x48, 0x29, 0x1A, 0x1C, 0x6D, 0x4D, 0x3A, 0x0E, 0x0F, @@ -1884,7 +1884,7 @@ const int16 KyraEngine_v2::_cauldronProtectedItems[] = { 0x8A, 0x79, 0x61, -1 }; -const int16 KyraEngine_v2::_cauldronBowlTable[] = { +const int16 KyraEngine_HoF::_cauldronBowlTable[] = { 0x0027, 0x0029, 0x0028, 0x0029, 0x0033, 0x0029, @@ -1897,7 +1897,7 @@ const int16 KyraEngine_v2::_cauldronBowlTable[] = { -1, -1 }; -const int16 KyraEngine_v2::_cauldronMagicTable[] = { +const int16 KyraEngine_HoF::_cauldronMagicTable[] = { 0x0, 0x16, 0x2, 0x1A, 0x7, 0xA4, 0x5, 0x4D, 0x1, 0xA5, 0x3, 0xA6, @@ -1906,7 +1906,7 @@ const int16 KyraEngine_v2::_cauldronMagicTable[] = { 0x9, 0xAC, -1, -1 }; -const int16 KyraEngine_v2::_cauldronMagicTableScene77[] = { +const int16 KyraEngine_HoF::_cauldronMagicTableScene77[] = { 0x0, 0x16, 0x2, 0x1A, 0x7, 0xAB, 0x5, 0x4D, 0x1, 0xAE, 0x3, 0xAF, @@ -1915,18 +1915,18 @@ const int16 KyraEngine_v2::_cauldronMagicTableScene77[] = { 0x9, 0xAC, -1, -1 }; -const uint8 KyraEngine_v2::_cauldronStateTable[] = { +const uint8 KyraEngine_HoF::_cauldronStateTable[] = { 3, 1, 3, 1, 1, 4, 4, 2, 3, 1, 1, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; -const int16 KyraEngine_v2::_flaskTable[] = { +const int16 KyraEngine_HoF::_flaskTable[] = { 0x19, 0x14, 0x15, 0x16, 0x17, 0x18, 0x34, 0x1B, 0x39, 0x1A, 0x3A, 0x4D, 0x72, -1 }; -const uint8 KyraEngine_v2::_rainbowRoomData[] = { +const uint8 KyraEngine_HoF::_rainbowRoomData[] = { 0x02, 0xA9, 0x9E, 0x75, 0x73, 0x17, 0x00, 0xA0, 0x08, 0x01, 0x19, 0x9F, 0x66, 0x05, 0x22, 0x7D, 0x20, 0x25, 0x1D, 0x64, 0xA0, 0x78, 0x85, 0x3B, @@ -1940,7 +1940,7 @@ const uint8 KyraEngine_v2::_rainbowRoomData[] = { // kyra 3 static res -const char *KyraEngine_v3::_soundList[] = { +const char *KyraEngine_MR::_soundList[] = { "ARREST1.AUD", "BATH1.AUD", "OCEAN1.AUD", @@ -1985,9 +1985,9 @@ const char *KyraEngine_v3::_soundList[] = { "SQUIRL1.AUD" }; -const int KyraEngine_v3::_soundListSize = ARRAYSIZE(KyraEngine_v3::_soundList); +const int KyraEngine_MR::_soundListSize = ARRAYSIZE(KyraEngine_MR::_soundList); -const char *KyraEngine_v3::_languageExtension[] = { +const char *KyraEngine_MR::_languageExtension[] = { "TRE", "TRF", "TRG"/*, @@ -1995,9 +1995,9 @@ const char *KyraEngine_v3::_languageExtension[] = { "TRS"*/ }; -const int KyraEngine_v3::_languageExtensionSize = ARRAYSIZE(KyraEngine_v3::_languageExtension); +const int KyraEngine_MR::_languageExtensionSize = ARRAYSIZE(KyraEngine_MR::_languageExtension); -const KyraEngine_v3::ShapeDesc KyraEngine_v3::_shapeDescs[] = { +const KyraEngine_MR::ShapeDesc KyraEngine_MR::_shapeDescs[] = { { 57, 91, -31, -82 }, { 57, 91, -31, -82 }, { 57, 91, -31, -82 }, @@ -2012,21 +2012,21 @@ const KyraEngine_v3::ShapeDesc KyraEngine_v3::_shapeDescs[] = { { 57, 91, -31, -82 } }; -const int KyraEngine_v3::_shapeDescsSize = ARRAYSIZE(KyraEngine_v3::_shapeDescs); +const int KyraEngine_MR::_shapeDescsSize = ARRAYSIZE(KyraEngine_MR::_shapeDescs); -const int8 KyraEngine_v3::_updateCharPosXTable[] = { +const int8 KyraEngine_MR::_updateCharPosXTable[] = { 0, 4, 4, 4, 0, -4, -4, -4 }; -const int8 KyraEngine_v3::_updateCharPosYTable[] = { +const int8 KyraEngine_MR::_updateCharPosYTable[] = { -2, -2, 0, 2, 2, 2, 0, -2 }; -const uint8 KyraEngine_v3::_characterFrameTable[] = { +const uint8 KyraEngine_MR::_characterFrameTable[] = { 0x36, 0x35, 0x35, 0x33, 0x32, 0x32, 0x34, 0x34 }; -const uint8 KyraEngine_v3::_sfxFileMap[] = { +const uint8 KyraEngine_MR::_sfxFileMap[] = { 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x99, 0x00, @@ -2105,9 +2105,9 @@ const uint8 KyraEngine_v3::_sfxFileMap[] = { 0x23, 0x00, 0x97, 0x00, 0x73, 0x00 }; -const int KyraEngine_v3::_sfxFileMapSize = ARRAYSIZE(KyraEngine_v3::_sfxFileMap); +const int KyraEngine_MR::_sfxFileMapSize = ARRAYSIZE(KyraEngine_MR::_sfxFileMap); -const char *KyraEngine_v3::_sfxFileList[] = { +const char *KyraEngine_MR::_sfxFileList[] = { "ALARM1", "ARMOIRE1", "ARROW1", @@ -2334,9 +2334,9 @@ const char *KyraEngine_v3::_sfxFileList[] = { "ZIPPER1" }; -const int KyraEngine_v3::_sfxFileListSize = ARRAYSIZE(KyraEngine_v3::_sfxFileList); +const int KyraEngine_MR::_sfxFileListSize = ARRAYSIZE(KyraEngine_MR::_sfxFileList); -const uint8 KyraEngine_v3::_badConscienceFrameTable[] = { +const uint8 KyraEngine_MR::_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, @@ -2344,7 +2344,7 @@ const uint8 KyraEngine_v3::_badConscienceFrameTable[] = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x1D, 0x1D, 0x1D }; -const uint8 KyraEngine_v3::_goodConscienceFrameTable[] = { +const uint8 KyraEngine_MR::_goodConscienceFrameTable[] = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, @@ -2352,31 +2352,31 @@ const uint8 KyraEngine_v3::_goodConscienceFrameTable[] = { 0x1E, 0x1E, 0x1E, 0x1E, 0x1E }; -const uint8 KyraEngine_v3::_chapterLowestScene[] = { +const uint8 KyraEngine_MR::_chapterLowestScene[] = { 0x00, 0x00, 0x19, 0x2B, 0x33, 0x3B }; -const uint8 KyraEngine_v3::_vocHighTable[] = { +const uint8 KyraEngine_MR::_vocHighTable[] = { 0x64, 0x76, 0x82, 0x83, 0x92 }; -const uint8 KyraEngine_v3::_inventoryX[] = { +const uint8 KyraEngine_MR::_inventoryX[] = { 0x45, 0x61, 0x7D, 0x99, 0xB5, 0x45, 0x61, 0x7D, 0x99, 0xB5 }; -const uint8 KyraEngine_v3::_inventoryY[] = { +const uint8 KyraEngine_MR::_inventoryY[] = { 0x9C, 0x9C, 0x9C, 0x9C, 0x9C, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }; -const uint8 KyraEngine_v3::_trashItemList[] = { +const uint8 KyraEngine_MR::_trashItemList[] = { 0x1E, 0x1D, 0x1C, 0x1F, 0x0F, 0x05, 0x04, 0x00, 0x03, 0x22, 0x0B, 0x20, 0x21, 0x10, 0x11, 0x3A, 0x39, 0x40, 0x3E, 0x3D, 0x3C, 0x3F, 0xFF }; -const uint8 KyraEngine_v3::_itemMagicTable[] = { +const uint8 KyraEngine_MR::_itemMagicTable[] = { 0x06, 0x05, 0x07, 0xFE, 0x05, 0x06, 0x07, 0xFE, 0x03, 0x00, 0x22, 0xFE, 0x00, 0x03, 0x22, 0xFE, 0x10, 0x00, 0x20, 0x0F, 0x00, 0x10, 0x0F, 0x20, @@ -2384,7 +2384,7 @@ const uint8 KyraEngine_v3::_itemMagicTable[] = { 0xFF, 0xFF, 0xFF, 0xFF }; -const uint8 KyraEngine_v3::_itemStringMap[] = { +const uint8 KyraEngine_MR::_itemStringMap[] = { 1, 0, 2, 0, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 3, 1, @@ -2396,21 +2396,21 @@ const uint8 KyraEngine_v3::_itemStringMap[] = { 0, 0, 0, 0, 2, 0, 0, 2 }; -const uint KyraEngine_v3::_itemStringMapSize = ARRAYSIZE(KyraEngine_v3::_itemStringMap); +const uint KyraEngine_MR::_itemStringMapSize = ARRAYSIZE(KyraEngine_MR::_itemStringMap); -const uint8 KyraEngine_v3::_itemStringPickUp[] = { +const uint8 KyraEngine_MR::_itemStringPickUp[] = { 0x4, 0x7, 0x0, 0xA }; -const uint8 KyraEngine_v3::_itemStringDrop[] = { +const uint8 KyraEngine_MR::_itemStringDrop[] = { 0x5, 0x8, 0x1, 0xB }; -const uint8 KyraEngine_v3::_itemStringInv[] = { +const uint8 KyraEngine_MR::_itemStringInv[] = { 0x6, 0x9, 0x2, 0xC }; -const int8 KyraEngine_v3::_scoreTable[] = { +const int8 KyraEngine_MR::_scoreTable[] = { 10, 8, 5, 9, 10, 10, 7, 8, 9, 9, 8, 8, 7, 8, 5, 9, 6, 10, 7, 8, 5, 9, 6, 6, @@ -2438,22 +2438,22 @@ const int8 KyraEngine_v3::_scoreTable[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -const int KyraEngine_v3::_scoreTableSize = ARRAYSIZE(KyraEngine_v3::_scoreTable); +const int KyraEngine_MR::_scoreTableSize = ARRAYSIZE(KyraEngine_MR::_scoreTable); -void KyraEngine_v3::initMainButtonList(bool disable) { +void KyraEngine_MR::initMainButtonList(bool disable) { if (!_mainButtonListInitialized) { _mainButtonData = new Button[14]; assert(_mainButtonData); GUI_V3_BUTTON(_mainButtonData[0], 1, 0, 0, 4, 4, 4, 0x4487, 0, 5, 162, 50, 25, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0); GUI_V3_BUTTON(_mainButtonData[1], 2, 0, 0, 1, 1, 1, 0x4487, 0, 245, 156, 69, 33, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0); - _mainButtonData[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v3, this, &KyraEngine_v3::buttonMoodChange); + _mainButtonData[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonMoodChange); GUI_V3_BUTTON(_mainButtonData[2], 3, 0, 0, 1, 1, 1, 0x4487, 0, 215, 191, 24, 9, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0); - _mainButtonData[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v3, this, &KyraEngine_v3::buttonShowScore); + _mainButtonData[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonShowScore); GUI_V3_BUTTON(_mainButtonData[3], 4, 0, 0, 1, 1, 1, 0x4487, 0, 215, 155, 25, 36, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0); - _mainButtonData[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v3, this, &KyraEngine_v3::buttonJesterStaff); + _mainButtonData[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonJesterStaff); - Button::Callback buttonInventoryFunctor = BUTTON_FUNCTOR(KyraEngine_v3, this, &KyraEngine_v3::buttonInventory); + Button::Callback buttonInventoryFunctor = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonInventory); for (int i = 0; i < 5; ++i) { GUI_V3_BUTTON(_mainButtonData[i+4], i+5, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 155, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0); _mainButtonData[i+4].buttonCallback = buttonInventoryFunctor; diff --git a/engines/kyra/text_v2.cpp b/engines/kyra/text_hof.cpp index 0fa1d3cd9f..43f28f9a00 100644 --- a/engines/kyra/text_v2.cpp +++ b/engines/kyra/text_hof.cpp @@ -23,8 +23,8 @@ * */ -#include "kyra/text_v2.h" -#include "kyra/kyra_v2.h" +#include "kyra/text_hof.h" +#include "kyra/kyra_hof.h" #include "kyra/script_tim.h" #include "kyra/resource.h" @@ -32,7 +32,7 @@ namespace Kyra { -TextDisplayer_v2::TextDisplayer_v2(KyraEngine_v2 *vm, Screen_v2 *screen) +TextDisplayer_v2::TextDisplayer_v2(KyraEngine_HoF *vm, Screen_v2 *screen) : TextDisplayer(vm, screen), _vm(vm) { } @@ -146,7 +146,7 @@ void TextDisplayer_v2::calcWidestLineBounds(int &x1, int &x2, int w, int x) { #pragma mark - -int KyraEngine_v2::chatGetType(const char *str) { +int KyraEngine_HoF::chatGetType(const char *str) { str += strlen(str); --str; switch (*str) { @@ -164,7 +164,7 @@ int KyraEngine_v2::chatGetType(const char *str) { } } -int KyraEngine_v2::chatCalcDuration(const char *str) { +int KyraEngine_HoF::chatCalcDuration(const char *str) { static const uint8 durationMultiplicator[] = { 16, 14, 12, 10, 8, 8, 7, 6, 5, 4 }; int duration = strlen(str); @@ -172,7 +172,7 @@ int KyraEngine_v2::chatCalcDuration(const char *str) { return MAX<int>(duration, 120); } -void KyraEngine_v2::objectChat(const char *str, int object, int vocHigh, int vocLow) { +void KyraEngine_HoF::objectChat(const char *str, int object, int vocHigh, int vocLow) { setNextIdleAnimTimer(); _chatVocHigh = _chatVocLow = -1; @@ -229,7 +229,7 @@ void KyraEngine_v2::objectChat(const char *str, int object, int vocHigh, int voc setNextIdleAnimTimer(); } -void KyraEngine_v2::objectChatInit(const char *str, int object, int vocHigh, int vocLow) { +void KyraEngine_HoF::objectChatInit(const char *str, int object, int vocHigh, int vocLow) { str = _text->preprocessString(str); int lineNum = _text->buildMessageSubstrings(str); @@ -276,7 +276,7 @@ void KyraEngine_v2::objectChatInit(const char *str, int object, int vocHigh, int _screen->showMouse(); } -void KyraEngine_v2::objectChatPrintText(const char *str, int object) { +void KyraEngine_HoF::objectChatPrintText(const char *str, int object) { int c1 = _talkObjectList[object].color; str = _text->preprocessString(str); int lineNum = _text->buildMessageSubstrings(str); @@ -295,7 +295,7 @@ void KyraEngine_v2::objectChatPrintText(const char *str, int object) { } } -void KyraEngine_v2::objectChatProcess(const char *script) { +void KyraEngine_HoF::objectChatProcess(const char *script) { memset(&_chatScriptData, 0, sizeof(_chatScriptData)); memset(&_chatScriptState, 0, sizeof(_chatScriptState)); @@ -325,7 +325,7 @@ void KyraEngine_v2::objectChatProcess(const char *script) { _emc->unload(&_chatScriptData); } -void KyraEngine_v2::objectChatWaitToFinish() { +void KyraEngine_HoF::objectChatWaitToFinish() { int charAnimFrame = _mainCharacter.animFrame; setCharacterAnimDim(_newShapeWidth, _newShapeHeight); @@ -373,7 +373,7 @@ void KyraEngine_v2::objectChatWaitToFinish() { resetCharacterAnimDim(); } -void KyraEngine_v2::startDialogue(int dlgIndex) { +void KyraEngine_HoF::startDialogue(int dlgIndex) { updateDlgBuffer(); int csEntry, vocH, unused1, unused2; loadDlgHeader(csEntry, vocH, unused1, unused2); @@ -395,7 +395,7 @@ void KyraEngine_v2::startDialogue(int dlgIndex) { processDialogue(offs, vocH, csEntry); } -void KyraEngine_v2::zanthSceneStartupChat() { +void KyraEngine_HoF::zanthSceneStartupChat() { int lowest = _flags.isTalkie ? 6 : 5; int tableIndex = _mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile]); if (queryGameFlag(0x159) || _newSceneDlgState[tableIndex]) @@ -412,7 +412,7 @@ void KyraEngine_v2::zanthSceneStartupChat() { _newSceneDlgState[tableIndex] = 1; } -void KyraEngine_v2::zanthRandomIdleChat() { +void KyraEngine_HoF::zanthRandomIdleChat() { int lowest = _flags.isTalkie ? 6 : 5; int tableIndex = (_mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile])) << 2; if (queryGameFlag(0x164)) @@ -434,7 +434,7 @@ void KyraEngine_v2::zanthRandomIdleChat() { processDialogue(offs, vocH, csEntry); } -void KyraEngine_v2::updateDlgBuffer() { +void KyraEngine_HoF::updateDlgBuffer() { static const char suffixTalkie[] = "EFG"; static const char suffixTowns[] = "G J"; @@ -457,14 +457,14 @@ void KyraEngine_v2::updateDlgBuffer() { _dlgBuffer = _res->fileData(filename, 0); } -void KyraEngine_v2::loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2) { +void KyraEngine_HoF::loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2) { csEntry = READ_LE_UINT16(_dlgBuffer); vocH = READ_LE_UINT16(_dlgBuffer + 2); scIndex1 = READ_LE_UINT16(_dlgBuffer + 4); scIndex2 = READ_LE_UINT16(_dlgBuffer + 6); } -void KyraEngine_v2::processDialogue(int dlgOffset, int vocH, int csEntry) { +void KyraEngine_HoF::processDialogue(int dlgOffset, int vocH, int csEntry) { int activeTimSequence = -1; int nextTimSequence = -1; int cmd = 0; @@ -569,7 +569,7 @@ void KyraEngine_v2::processDialogue(int dlgOffset, int vocH, int csEntry) { _screen->showMouse(); } -void KyraEngine_v2::initTalkObject(int index) { +void KyraEngine_HoF::initTalkObject(int index) { TalkObject &object = _talkObjectList[index]; char STAFilename[13]; @@ -605,7 +605,7 @@ void KyraEngine_v2::initTalkObject(int index) { } } -void KyraEngine_v2::deinitTalkObject(int index) { +void KyraEngine_HoF::deinitTalkObject(int index) { TalkObject &object = _talkObjectList[index]; if (_currentTalkSections.ENDTim) { @@ -628,7 +628,7 @@ void KyraEngine_v2::deinitTalkObject(int index) { _tim->unload(_currentTalkSections.ENDTim); } -void KyraEngine_v2::npcChatSequence(const char *str, int objectId, int vocHigh, int vocLow) { +void KyraEngine_HoF::npcChatSequence(const char *str, int objectId, int vocHigh, int vocLow) { _chatText = str; _chatObject = objectId; objectChatInit(str, objectId, vocHigh, vocLow); @@ -677,7 +677,7 @@ void KyraEngine_v2::npcChatSequence(const char *str, int objectId, int vocHigh, setNextIdleAnimTimer(); } -void KyraEngine_v2::setNewDlgIndex(int dlgIndex) { +void KyraEngine_HoF::setNewDlgIndex(int dlgIndex) { if (dlgIndex == _mainCharacter.dlgIndex) return; memset(_newSceneDlgState, 0, 32); diff --git a/engines/kyra/text_v2.h b/engines/kyra/text_hof.h index 6b8cf5d38e..0b26262f0e 100644 --- a/engines/kyra/text_v2.h +++ b/engines/kyra/text_hof.h @@ -31,12 +31,12 @@ namespace Kyra { class Screen_v2; -class KyraEngine_v2; +class KyraEngine_HoF; class TextDisplayer_v2 : public TextDisplayer { -friend class KyraEngine_v2; +friend class KyraEngine_HoF; public: - TextDisplayer_v2(KyraEngine_v2 *vm, Screen_v2 *screen); + TextDisplayer_v2(KyraEngine_HoF *vm, Screen_v2 *screen); void backupTalkTextMessageBkgd(int srcPage, int dstPage); void restoreTalkTextMessageBkgd(int srcPage, int dstPage); @@ -47,7 +47,7 @@ public: char *preprocessString(const char *str); void calcWidestLineBounds(int &x1, int &x2, int w, int x); private: - KyraEngine_v2 *_vm; + KyraEngine_HoF *_vm; }; } // end of namespace Kyra diff --git a/engines/kyra/text_v3.cpp b/engines/kyra/text_mr.cpp index 47301eacec..4f3c350099 100644 --- a/engines/kyra/text_v3.cpp +++ b/engines/kyra/text_mr.cpp @@ -23,18 +23,18 @@ * */ -#include "kyra/text_v3.h" -#include "kyra/screen_v3.h" +#include "kyra/text_mr.h" +#include "kyra/screen_mr.h" #include "kyra/resource.h" namespace Kyra { -TextDisplayer_v3::TextDisplayer_v3(KyraEngine_v3 *vm, Screen_v3 *screen) +TextDisplayer_MR::TextDisplayer_MR(KyraEngine_MR *vm, Screen_MR *screen) : TextDisplayer(vm, screen), _vm(vm), _screen(screen) { } -char *TextDisplayer_v3::preprocessString(const char *str) { - debugC(9, kDebugLevelMain, "TextDisplayer_v3::preprocessString('%s')", str); +char *TextDisplayer_MR::preprocessString(const char *str) { + debugC(9, kDebugLevelMain, "TextDisplayer_MR::preprocessString('%s')", str); if (_talkBuffer != str) strncpy(_talkBuffer, str, sizeof(_talkBuffer)); @@ -81,8 +81,8 @@ char *TextDisplayer_v3::preprocessString(const char *str) { return _talkBuffer; } -int TextDisplayer_v3::dropCRIntoString(char *str, int minOffs, int maxOffs) { - debugC(9, kDebugLevelMain, "TextDisplayer_v3::dropCRIntoString('%s', %d, %d)", str, maxOffs, minOffs); +int TextDisplayer_MR::dropCRIntoString(char *str, int minOffs, int maxOffs) { + debugC(9, kDebugLevelMain, "TextDisplayer_MR::dropCRIntoString('%s', %d, %d)", str, maxOffs, minOffs); int offset = 0; char *proc = str + minOffs; @@ -129,8 +129,8 @@ int TextDisplayer_v3::dropCRIntoString(char *str, int minOffs, int maxOffs) { return 0; } -void TextDisplayer_v3::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) { - debugC(9, kDebugLevelMain, "TextDisplayer_v3::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2); +void TextDisplayer_MR::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) { + debugC(9, kDebugLevelMain, "TextDisplayer_MR::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2); uint8 colorMap[] = { 0, 255, 240, 240 }; colorMap[3] = c1; _screen->setTextColor(colorMap, 0, 3); @@ -141,8 +141,8 @@ void TextDisplayer_v3::printText(const char *str, int x, int y, uint8 c0, uint8 _screen->setFont(curFont); } -void TextDisplayer_v3::restoreScreen() { - debugC(9, kDebugLevelMain, "TextDisplayer_v3::restoreScreen()"); +void TextDisplayer_MR::restoreScreen() { + debugC(9, kDebugLevelMain, "TextDisplayer_MR::restoreScreen()"); _vm->restorePage3(); _vm->drawAnimObjects(); _screen->hideMouse(); @@ -152,8 +152,8 @@ void TextDisplayer_v3::restoreScreen() { _vm->refreshAnimObjects(0); } -void TextDisplayer_v3::calcWidestLineBounds(int &x1, int &x2, int w, int x) { - debugC(9, kDebugLevelMain, "TextDisplayer_v3::calcWidestLineBounds(%d, %d)", w, x); +void TextDisplayer_MR::calcWidestLineBounds(int &x1, int &x2, int w, int x) { + debugC(9, kDebugLevelMain, "TextDisplayer_MR::calcWidestLineBounds(%d, %d)", w, x); x1 = x; x1 -= (w >> 1); x2 = x1 + w + 1; @@ -169,8 +169,8 @@ void TextDisplayer_v3::calcWidestLineBounds(int &x1, int &x2, int w, int x) { #pragma mark - -int KyraEngine_v3::chatGetType(const char *str) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::chatGetType('%s')", str); +int KyraEngine_MR::chatGetType(const char *str) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::chatGetType('%s')", str); while (*str) ++str; --str; @@ -190,13 +190,13 @@ int KyraEngine_v3::chatGetType(const char *str) { } } -int KyraEngine_v3::chatCalcDuration(const char *str) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::chatCalcDuration('%s')", str); +int KyraEngine_MR::chatCalcDuration(const char *str) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::chatCalcDuration('%s')", str); return MAX<int>(120, strlen(str)*6); } -void KyraEngine_v3::objectChat(const char *str, int object, int vocHigh, int vocLow) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChat('%s', %d, %d, %d)", str, object, vocHigh, vocLow); +void KyraEngine_MR::objectChat(const char *str, int object, int vocHigh, int vocLow) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChat('%s', %d, %d, %d)", str, object, vocHigh, vocLow); if (_mainCharacter.animFrame == 87 || _mainCharacter.animFrame == 0xFFFF || _mainCharacter.x1 <= 0 || _mainCharacter.y1 <= 0) return; @@ -239,8 +239,8 @@ void KyraEngine_v3::objectChat(const char *str, int object, int vocHigh, int voc setNextIdleAnimTimer(); } -void KyraEngine_v3::objectChatInit(const char *str, int object, int vocHigh, int vocLow) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatInit('%s', %d, %d, %d)", str, object, vocHigh, vocLow); +void KyraEngine_MR::objectChatInit(const char *str, int object, int vocHigh, int vocLow) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatInit('%s', %d, %d, %d)", str, object, vocHigh, vocLow); str = _text->preprocessString(str); int lineNum = _text->buildMessageSubstrings(str); @@ -286,8 +286,8 @@ void KyraEngine_v3::objectChatInit(const char *str, int object, int vocHigh, int _screen->showMouse(); } -void KyraEngine_v3::objectChatPrintText(const char *str, int object) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatPrintText('%s', %d)", str, object); +void KyraEngine_MR::objectChatPrintText(const char *str, int object) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatPrintText('%s', %d)", str, object); int c1 = _talkObjectList[object].color; str = _text->preprocessString(str); int lineNum = _text->buildMessageSubstrings(str); @@ -306,8 +306,8 @@ void KyraEngine_v3::objectChatPrintText(const char *str, int object) { } } -void KyraEngine_v3::objectChatProcess(const char *script) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatProcess('%s')", script); +void KyraEngine_MR::objectChatProcess(const char *script) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatProcess('%s')", script); memset(&_chatScriptData, 0, sizeof(_chatScriptData)); memset(&_chatScriptState, 0, sizeof(_chatScriptState)); @@ -330,8 +330,8 @@ void KyraEngine_v3::objectChatProcess(const char *script) { _emc->unload(&_chatScriptData); } -void KyraEngine_v3::objectChatWaitToFinish() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::objectChatWaitToFinish()"); +void KyraEngine_MR::objectChatWaitToFinish() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::objectChatWaitToFinish()"); int charAnimFrame = _mainCharacter.animFrame; setCharacterAnimDim(_newShapeWidth, _newShapeHeight); @@ -380,8 +380,8 @@ void KyraEngine_v3::objectChatWaitToFinish() { resetCharacterAnimDim(); } -void KyraEngine_v3::badConscienceChat(const char *str, int vocHigh, int vocLow) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::badConscienceChat('%s', %d, %d)", str, vocHigh, vocLow); +void KyraEngine_MR::badConscienceChat(const char *str, int vocHigh, int vocLow) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::badConscienceChat('%s', %d, %d)", str, vocHigh, vocLow); if (!_badConscienceShown) return; @@ -398,8 +398,8 @@ void KyraEngine_v3::badConscienceChat(const char *str, int vocHigh, int vocLow) _chatObject = -1; } -void KyraEngine_v3::badConscienceChatWaitToFinish() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::badConscienceChatWaitToFinish()"); +void KyraEngine_MR::badConscienceChatWaitToFinish() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::badConscienceChatWaitToFinish()"); if (_chatVocHigh) { playVoice(_chatVocHigh, _chatVocLow); _chatVocHigh = _chatVocLow = -1; @@ -438,8 +438,8 @@ void KyraEngine_v3::badConscienceChatWaitToFinish() { } } -void KyraEngine_v3::goodConscienceChat(const char *str, int vocHigh, int vocLow) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::goodConscienceChat('%s', %d, %d)", str, vocHigh, vocLow); +void KyraEngine_MR::goodConscienceChat(const char *str, int vocHigh, int vocLow) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::goodConscienceChat('%s', %d, %d)", str, vocHigh, vocLow); if (!_goodConscienceShown) return; @@ -456,8 +456,8 @@ void KyraEngine_v3::goodConscienceChat(const char *str, int vocHigh, int vocLow) _chatObject = -1; } -void KyraEngine_v3::goodConscienceChatWaitToFinish() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::goodConscienceChatWaitToFinish()"); +void KyraEngine_MR::goodConscienceChatWaitToFinish() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::goodConscienceChatWaitToFinish()"); if (_chatVocHigh) { playVoice(_chatVocHigh, _chatVocLow); _chatVocHigh = _chatVocLow = -1; @@ -496,8 +496,8 @@ void KyraEngine_v3::goodConscienceChatWaitToFinish() { } } -void KyraEngine_v3::malcolmSceneStartupChat() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::malcolmSceneStartupChat()"); +void KyraEngine_MR::malcolmSceneStartupChat() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::malcolmSceneStartupChat()"); if (_noStartupChat) return; @@ -521,8 +521,8 @@ void KyraEngine_v3::malcolmSceneStartupChat() { _newSceneDlgState[index] = true; } -void KyraEngine_v3::updateDlgBuffer() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateDlgBuffer()"); +void KyraEngine_MR::updateDlgBuffer() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateDlgBuffer()"); char dlgFile[16]; char cnvFile[16]; @@ -547,8 +547,8 @@ void KyraEngine_v3::updateDlgBuffer() { assert(_dlgBuffer); } -void KyraEngine_v3::loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &index1, int &index2) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::loadDlgHeader(-, -, -, -)"); +void KyraEngine_MR::loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &index1, int &index2) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::loadDlgHeader(-, -, -, -)"); assert(_cnvFile); vocHighIndex = _cnvFile->readSint16LE(); vocHighBase = _cnvFile->readSint16LE(); @@ -556,8 +556,8 @@ void KyraEngine_v3::loadDlgHeader(int &vocHighBase, int &vocHighIndex, int &inde index2 = _cnvFile->readSint16LE(); } -void KyraEngine_v3::setDlgIndex(uint16 index) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::setDlgIndex(%d)", index); +void KyraEngine_MR::setDlgIndex(uint16 index) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::setDlgIndex(%d)", index); if (_mainCharacter.dlgIndex != index) { Common::set_to(_newSceneDlgState, _newSceneDlgState+ARRAYSIZE(_newSceneDlgState), 0); memset(_conversationState, -1, sizeof(_conversationState)); @@ -566,8 +566,8 @@ void KyraEngine_v3::setDlgIndex(uint16 index) { } } -void KyraEngine_v3::updateDlgIndex() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateDlgIndex()"); +void KyraEngine_MR::updateDlgIndex() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::updateDlgIndex()"); uint16 dlgIndex = _mainCharacter.dlgIndex; if (_currentChapter == 1) { @@ -606,8 +606,8 @@ void KyraEngine_v3::updateDlgIndex() { _mainCharacter.dlgIndex = dlgIndex; } -void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::processDialog(%d, %d, %d)", vocHighIndex, vocHighBase, funcNum); +void KyraEngine_MR::processDialog(int vocHighIndex, int vocHighBase, int funcNum) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::processDialog(%d, %d, %d)", vocHighIndex, vocHighBase, funcNum); bool running = true; int script = -1; int vocHigh = -1, vocLow = -1; @@ -667,8 +667,8 @@ void KyraEngine_v3::processDialog(int vocHighIndex, int vocHighBase, int funcNum dialogEndScript(script); } -void KyraEngine_v3::dialogStartScript(int object, int funcNum) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::dialogStartScript(%d, %d)", object, funcNum); +void KyraEngine_MR::dialogStartScript(int object, int funcNum) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::dialogStartScript(%d, %d)", object, funcNum); _dialogSceneAnim = _talkObjectList[object].sceneAnim; _dialogSceneScript = _talkObjectList[object].sceneScript; if (_dialogSceneAnim >= 0 && _dialogSceneScript >= 0) { @@ -688,8 +688,8 @@ void KyraEngine_v3::dialogStartScript(int object, int funcNum) { _emc->run(&_dialogScriptState); } -void KyraEngine_v3::dialogEndScript(int object) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::dialogEndScript(%d)", object); +void KyraEngine_MR::dialogEndScript(int object) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::dialogEndScript(%d)", object); _emc->init(&_dialogScriptState, &_dialogScriptData); _emc->start(&_dialogScriptState, _dialogScriptFuncEnd); @@ -705,8 +705,8 @@ void KyraEngine_v3::dialogEndScript(int object) { _emc->unload(&_dialogScriptData); } -void KyraEngine_v3::npcChatSequence(const char *str, int object, int vocHigh, int vocLow) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::npcChatSequence('%s', %d, %d, %d)", str, object, vocHigh, vocLow); +void KyraEngine_MR::npcChatSequence(const char *str, int object, int vocHigh, int vocLow) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::npcChatSequence('%s', %d, %d, %d)", str, object, vocHigh, vocLow); _chatText = str; _chatObject = object; @@ -746,8 +746,8 @@ void KyraEngine_v3::npcChatSequence(const char *str, int object, int vocHigh, in _chatObject= - 1; } -void KyraEngine_v3::malcolmRandomChat() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::malcolmRandomChat()"); +void KyraEngine_MR::malcolmRandomChat() { + debugC(9, kDebugLevelMain, "KyraEngine_MR::malcolmRandomChat()"); updateDlgBuffer(); int index = (_mainCharacter.sceneId - _chapterLowestScene[_currentChapter]) * 2; @@ -766,8 +766,8 @@ void KyraEngine_v3::malcolmRandomChat() { processDialog(vocHighIndex, vocHighBase, 0); } -void KyraEngine_v3::runDialog(int dlgIndex, int funcNum) { - debugC(9, kDebugLevelMain, "KyraEngine_v3::runDialog(%d, %d)", dlgIndex, funcNum); +void KyraEngine_MR::runDialog(int dlgIndex, int funcNum) { + debugC(9, kDebugLevelMain, "KyraEngine_MR::runDialog(%d, %d)", dlgIndex, funcNum); switch (_currentChapter-2) { case 0: diff --git a/engines/kyra/text_v3.h b/engines/kyra/text_mr.h index 9271c6b520..d96b0964ba 100644 --- a/engines/kyra/text_v3.h +++ b/engines/kyra/text_mr.h @@ -23,19 +23,19 @@ * */ -#ifndef KYRA_TEXT_V3_H -#define KYRA_TEXT_V3_H +#ifndef KYRA_TEXT_MR_H +#define KYRA_TEXT_MR_H #include "kyra/text.h" -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" namespace Kyra { -class TextDisplayer_v3 : public TextDisplayer { -friend class KyraEngine_v3; +class TextDisplayer_MR : public TextDisplayer { +friend class KyraEngine_MR; public: - TextDisplayer_v3(KyraEngine_v3 *vm, Screen_v3 *screen); + TextDisplayer_MR(KyraEngine_MR *vm, Screen_MR *screen); char *preprocessString(const char *str); int dropCRIntoString(char *str, int minOffs, int maxOffs); @@ -46,8 +46,8 @@ public: void calcWidestLineBounds(int &x1, int &x2, int w, int x); protected: - KyraEngine_v3 *_vm; - Screen_v3 *_screen; + KyraEngine_MR *_vm; + Screen_MR *_screen; }; } // end of namespace Kyra diff --git a/engines/kyra/timer_v2.cpp b/engines/kyra/timer_hof.cpp index 4c97a6dd2d..a96717bdb3 100644 --- a/engines/kyra/timer_v2.cpp +++ b/engines/kyra/timer_hof.cpp @@ -23,15 +23,15 @@ * */ -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/timer.h" namespace Kyra { -#define TimerV2(x) new Common::Functor1Mem<int, void, KyraEngine_v2>(this, &KyraEngine_v2::x) +#define TimerV2(x) new Common::Functor1Mem<int, void, KyraEngine_HoF>(this, &KyraEngine_HoF::x) -void KyraEngine_v2::setupTimers() { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::setupTimers()"); +void KyraEngine_HoF::setupTimers() { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::setupTimers()"); _timer->addTimer(0, 0, 5, 1); _timer->addTimer(1, TimerV2(timerFadeOutMessage), -1, 1); @@ -41,14 +41,14 @@ void KyraEngine_v2::setupTimers() { _timer->addTimer(5, TimerV2(timerBurnZanthia), 1, 0); } -void KyraEngine_v2::timerFadeOutMessage(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFadeOutMessage(%d)", arg); +void KyraEngine_HoF::timerFadeOutMessage(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerFadeOutMessage(%d)", arg); if (_shownMessage) _fadeMessagePalette = 1; } -void KyraEngine_v2::timerCauldronAnimation(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerCauldronAnimation(%d)", arg); +void KyraEngine_HoF::timerCauldronAnimation(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerCauldronAnimation(%d)", arg); int animation = -1; // HACK: We don't allow inventory animations while the inventory is backed off, which means not shown usually. @@ -68,14 +68,14 @@ void KyraEngine_v2::timerCauldronAnimation(int arg) { } } -void KyraEngine_v2::timerFunc4(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFunc4(%d)", arg); +void KyraEngine_HoF::timerFunc4(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerFunc4(%d)", arg); _timer->disable(3); setGameFlag(0xD8); } -void KyraEngine_v2::timerFunc5(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFunc5(%d)", arg); +void KyraEngine_HoF::timerFunc5(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerFunc5(%d)", arg); _timer->disable(4); _screen->hideMouse(); _specialSceneScriptState[5] = 1; @@ -86,8 +86,8 @@ void KyraEngine_v2::timerFunc5(int arg) { _deathHandler = 4; } -void KyraEngine_v2::timerBurnZanthia(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerBurnZanthia(%d)", arg); +void KyraEngine_HoF::timerBurnZanthia(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::timerBurnZanthia(%d)", arg); _timer->disable(5); _screen->hideMouse(); snd_playSoundEffect(0x2D); @@ -96,8 +96,8 @@ void KyraEngine_v2::timerBurnZanthia(int arg) { snd_playWanderScoreViaMap(0x53, 1); } -void KyraEngine_v2::setTimer1DelaySecs(int secs) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::setTimer1DelaySecs(%d)", secs); +void KyraEngine_HoF::setTimer1DelaySecs(int secs) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::setTimer1DelaySecs(%d)", secs); if (secs == -1) secs = 32000; @@ -105,8 +105,8 @@ void KyraEngine_v2::setTimer1DelaySecs(int secs) { _timer->setCountdown(1, secs * 60); } -void KyraEngine_v2::setWalkspeed(uint8 newSpeed) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::setWalkspeed(%i)", newSpeed); +void KyraEngine_HoF::setWalkspeed(uint8 newSpeed) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_HoF::setWalkspeed(%i)", newSpeed); if (newSpeed < 5) newSpeed = 3; diff --git a/engines/kyra/timer_v3.cpp b/engines/kyra/timer_mr.cpp index 5688895758..53865ba0e3 100644 --- a/engines/kyra/timer_v3.cpp +++ b/engines/kyra/timer_mr.cpp @@ -23,15 +23,15 @@ * */ -#include "kyra/kyra_v3.h" +#include "kyra/kyra_mr.h" #include "kyra/timer.h" namespace Kyra { -#define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_v3>(this, &KyraEngine_v3::x) +#define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_MR>(this, &KyraEngine_MR::x) -void KyraEngine_v3::setupTimers() { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setupTimers()"); +void KyraEngine_MR::setupTimers() { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setupTimers()"); _timer->addTimer(0, TimerV3(timerRestoreCommandLine), -1, 1); for (int i = 1; i <= 3; ++i) @@ -43,14 +43,14 @@ void KyraEngine_v3::setupTimers() { _timer->addTimer(i, TimerV3(timerRunSceneScript7), 0, 0); } -void KyraEngine_v3::timerRestoreCommandLine(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerRestoreCommandLine(%d)", arg); +void KyraEngine_MR::timerRestoreCommandLine(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerRestoreCommandLine(%d)", arg); if (_shownMessage) _restoreCommandLine = true; } -void KyraEngine_v3::timerRunSceneScript7(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerRunSceneScript7(%d)", arg); +void KyraEngine_MR::timerRunSceneScript7(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerRunSceneScript7(%d)", arg); _emc->init(&_sceneScriptState, &_sceneScriptData); _sceneScriptState.regs[1] = _mouseX; _sceneScriptState.regs[2] = _mouseY; @@ -62,13 +62,13 @@ void KyraEngine_v3::timerRunSceneScript7(int arg) { _emc->run(&_sceneScriptState); } -void KyraEngine_v3::timerFleaDeath(int arg) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerFleaDeath(%d)", arg); +void KyraEngine_MR::timerFleaDeath(int arg) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerFleaDeath(%d)", arg); warning("STUB timerFleaDeath"); } -void KyraEngine_v3::setWalkspeed(uint8 speed) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setWalkspeed(%d)", speed); +void KyraEngine_MR::setWalkspeed(uint8 speed) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setWalkspeed(%d)", speed); if (speed < 5) speed = 3; @@ -78,15 +78,15 @@ void KyraEngine_v3::setWalkspeed(uint8 speed) { _mainCharacter.walkspeed = speed; } -void KyraEngine_v3::setCommandLineRestoreTimer(int secs) { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setCommandLineRestoreTimer(%d)", secs); +void KyraEngine_MR::setCommandLineRestoreTimer(int secs) { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setCommandLineRestoreTimer(%d)", secs); if (secs == -1) secs = 32000; _timer->setCountdown(0, secs*60); } -void KyraEngine_v3::setNextIdleAnimTimer() { - debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::setNextIdleAnimTimer()"); +void KyraEngine_MR::setNextIdleAnimTimer() { + debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::setNextIdleAnimTimer()"); _nextIdleAnim = _system->getMillis() + _rnd.getRandomNumberRng(10, 15) * 1000; } diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp index 9da75ed20c..764327d701 100644 --- a/engines/kyra/wsamovie.cpp +++ b/engines/kyra/wsamovie.cpp @@ -32,6 +32,7 @@ #include "kyra/screen.h" #include "kyra/screen_v2.h" #include "kyra/wsamovie.h" +#include "kyra/resource.h" namespace Kyra { WSAMovieV1::WSAMovieV1(KyraEngine *vm) : Movie(vm) {} @@ -341,7 +342,7 @@ void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) { #pragma mark - -WSAMovieV2::WSAMovieV2(KyraEngine *vm, ScreenEx *screen) : WSAMovieV1(vm), _screen(screen), _xAdd(0), _yAdd(0) {} +WSAMovieV2::WSAMovieV2(KyraEngine *vm, Screen_v2 *screen) : WSAMovieV1(vm), _screen(screen), _xAdd(0), _yAdd(0) {} int WSAMovieV2::open(const char *filename, int unk1, uint8 *palBuf) { debugC(9, kDebugLevelMovie, "WSAMovieV2::open('%s', %d, %p)", filename, unk1, (const void *)palBuf); diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h index ad577f7029..d1f3465c07 100644 --- a/engines/kyra/wsamovie.h +++ b/engines/kyra/wsamovie.h @@ -26,8 +26,6 @@ #ifndef KYRA_WSAMOVIE_H #define KYRA_WSAMOVIE_H -#include "kyra/resource.h" - namespace Audio { class AppendableAudioStream; class SoundHandle; @@ -35,7 +33,7 @@ class SoundHandle; namespace Kyra { class KyraEngine; -class ScreenEx; +class Screen_v2; class Movie { public: @@ -111,7 +109,7 @@ private: class WSAMovieV2 : public WSAMovieV1 { public: - WSAMovieV2(KyraEngine *vm, ScreenEx *scren); + WSAMovieV2(KyraEngine *vm, Screen_v2 *scren); int open(const char *filename, int unk1, uint8 *palette); @@ -129,7 +127,7 @@ public: void setWidth(int w) { _width = w; } void setHeight(int h) { _height = h; } protected: - ScreenEx *_screen; + Screen_v2 *_screen; int16 _xAdd; int16 _yAdd; |