[Scummvm-git-logs] scummvm master -> 51b2994659a7d14bc188fe379fafe8c164824e36
somaen
noreply at scummvm.org
Fri May 27 17:57:05 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
51b2994659 Revert TINSEL refactors that happened too close to code freeze.
Commit: 51b2994659a7d14bc188fe379fafe8c164824e36
https://github.com/scummvm/scummvm/commit/51b2994659a7d14bc188fe379fafe8c164824e36
Author: Einar Johan Trøan SømaÌen (somaen at scummvm.org)
Date: 2022-05-27T19:55:36+02:00
Commit Message:
Revert TINSEL refactors that happened too close to code freeze.
Revert "TINSEL: Fix int32 discrepancy"
- This reverts commit a640e6b48991c027c3974607d025b16c054354f1.
Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions"
- This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068.
Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove"
- This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504.
Revert "TINSEL: Rename the public methods in Dialogs to follow convention"
- This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69.
Revert "TINSEL: Rename the private methods in Dialogs to follow convention"
- This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31.
Revert "TINSEL: Add debug commands to add all clues, as well as listing them."
- This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65.
Revert "TINSEL: Implement pointer handling for Notebook"
- This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd.
Revert "TINSEL: Implement polygon-handling for Notebook"
- This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a.
Revert "TINSEL: Add initial event support to Notebook."
- This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778.
Revert "TINSEL: Close Inventories when switching between them."
- This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4.
Revert "TINSEL: Implement library function CROSSCLUE"
- This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f.
Revert "TINSEL: Implement Notebook logic for adding clues and showing pages."
- This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346.
Revert "TINSEL: Implement InventoryOrNotebookActive"
- This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af.
Revert "TINSEL: Minor style-fixes"
- This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26.
Revert "TINSEL: Refactor IsInPolygon to be partially a member-function"
- This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537.
Revert "TINSEL: Replace LockMem with GetFrame for FRAME"
- This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8.
Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT"
- This reverts commit fa8e3c506b93b272271d33663fee85bd86651526.
Revert "TINSEL: Further refactor InventoryObjects"
- This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
Changed paths:
R engines/tinsel/film.cpp
R engines/tinsel/noir/notebook_page.cpp
R engines/tinsel/noir/notebook_page.h
engines/tinsel/actors.cpp
engines/tinsel/bg.cpp
engines/tinsel/cursor.cpp
engines/tinsel/debugger.cpp
engines/tinsel/debugger.h
engines/tinsel/dialogs.cpp
engines/tinsel/dialogs.h
engines/tinsel/drives.cpp
engines/tinsel/events.cpp
engines/tinsel/film.h
engines/tinsel/inv_objects.cpp
engines/tinsel/inv_objects.h
engines/tinsel/module.mk
engines/tinsel/movers.cpp
engines/tinsel/multiobj.cpp
engines/tinsel/multiobj.h
engines/tinsel/noir/notebook.cpp
engines/tinsel/noir/notebook.h
engines/tinsel/noir/sysreel.cpp
engines/tinsel/noir/sysreel.h
engines/tinsel/play.cpp
engines/tinsel/polygons.cpp
engines/tinsel/polygons.h
engines/tinsel/saveload.cpp
engines/tinsel/savescn.cpp
engines/tinsel/scene.cpp
engines/tinsel/tinlib.cpp
engines/tinsel/tinsel.cpp
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index 1fc2bb6e025..04d9728b5a9 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -1492,7 +1492,7 @@ static void ActorTinselProcess(CORO_PARAM, const void *param) {
// Take control for CONVERSE events
if (atp->event == CONVERSE) {
_ctx->bTookControl = GetControl();
- _vm->_dialogs->hideConversation(true);
+ _vm->_dialogs->HideConversation(true);
} else
_ctx->bTookControl = false;
@@ -1505,7 +1505,7 @@ static void ActorTinselProcess(CORO_PARAM, const void *param) {
if (_ctx->bTookControl)
ControlOn();
- _vm->_dialogs->hideConversation(false);
+ _vm->_dialogs->HideConversation(false);
}
} else {
CORO_INVOKE_1(AllowDclick, atp->bev); // May kill us if single click
diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp
index f59b8287dc9..d3af752cf70 100644
--- a/engines/tinsel/bg.cpp
+++ b/engines/tinsel/bg.cpp
@@ -64,7 +64,7 @@ void BGmainProcess(CORO_PARAM, const void *param) {
pReel = (const FREEL *)param;
// Get the MULTI_INIT structure
- pmi = pReel->GetMultiInit();
+ pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pReel->mobj));
// Initialize and insert the object, and initialize its script.
_vm->_bg->_pBG[0] = MultiInitObject(pmi);
@@ -79,7 +79,7 @@ void BGmainProcess(CORO_PARAM, const void *param) {
int i;
for (i = 0; i < _vm->_bg->_bgReels; i++) {
// Get the MULTI_INIT structure
- pmi = pFilm->reels[i].GetMultiInit();
+ pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pFilm->reels[i].mobj));
// Initialize and insert the object, and initialize its script.
_vm->_bg->_pBG[i] = MultiInitObject(pmi);
@@ -138,7 +138,7 @@ void BGotherProcess(CORO_PARAM, const void *param) {
CORO_END_CONTEXT(_ctx);
const FREEL *pReel = (const FREEL *)param;
- const MULTI_INIT *pmi = pReel->GetMultiInit();
+ const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pReel->mobj));
CORO_BEGIN_CODE(_ctx);
@@ -168,8 +168,8 @@ void Background::StartupBackground(CORO_PARAM, SCNHANDLE hFilm) {
const FREEL *pfr = &pfilm->reels[0];
if (TinselVersion != 3) {
- const MULTI_INIT *pmi = pfr->GetMultiInit();
- const FRAME *pFrame = pmi->GetFrame();
+ const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfr->mobj));
+ const FRAME *pFrame = (const FRAME *)_vm->_handle->LockMem(FROM_32(pmi->hMulFrame));
const IMAGE *pim = _vm->_handle->GetImage(READ_32(pFrame));
SetBackPal(pim->hImgPal);
delete pim;
diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp
index 92b1fdac9dd..9cbc534c366 100644
--- a/engines/tinsel/cursor.cpp
+++ b/engines/tinsel/cursor.cpp
@@ -89,7 +89,7 @@ void Cursor::InitCurTrailObj(int i, int x, int y) {
const FILM *pFilm = (const FILM *)_vm->_handle->LockMem(_cursorFilm);
const FREEL *pfr = (const FREEL *)&pFilm->reels[i + 1];
- const MULTI_INIT *pmi = pfr->GetMultiInit();
+ const MULTI_INIT *pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfr->mobj));
PokeInPalette(pmi);
@@ -303,8 +303,8 @@ void Cursor::DelAuxCursor() {
void Cursor::SetAuxCursor(SCNHANDLE hFilm) {
const FILM *pfilm = (const FILM *)_vm->_handle->LockMem(hFilm);
const FREEL *pfr = &pfilm->reels[0];
- const MULTI_INIT *pmi = pfr->GetMultiInit();
- const FRAME *pFrame = pmi->GetFrame();
+ const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfr->mobj));
+ const FRAME *pFrame = (const FRAME *)_vm->_handle->LockMem(FROM_32(pmi->hMulFrame));
const IMAGE *pim;
int x, y; // Cursor position
@@ -402,10 +402,10 @@ void Cursor::DoCursorMove() {
if (_auxCursor != NULL)
MultiSetAniXY(_auxCursor, ptMouse.x - _auxCursorOffsetX, ptMouse.y - _auxCursorOffsetY);
- if (_vm->_dialogs->inventoryActive() && _mainCursor) {
+ if (_vm->_dialogs->InventoryActive() && _mainCursor) {
// Notify the inventory
- _vm->_dialogs->xMovement(ptMouse.x - startX);
- _vm->_dialogs->yMovement(ptMouse.y - startY);
+ _vm->_dialogs->Xmovement(ptMouse.x - startX);
+ _vm->_dialogs->Ymovement(ptMouse.y - startY);
}
_lastCursorX = ptMouse.x;
@@ -418,7 +418,7 @@ void Cursor::DoCursorMove() {
void Cursor::InitCurObj() {
const FILM *pFilm = (const FILM *)_vm->_handle->LockMem(_cursorFilm);
const FREEL *pfr = (const FREEL *)&pFilm->reels[0];
- const MULTI_INIT *pmi = pfr->GetMultiInit();
+ const MULTI_INIT *pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfr->mobj));
if (TinselVersion != 3) {
PokeInPalette(pmi);
@@ -519,7 +519,7 @@ void Cursor::StartCursorFollowed() {
}
void Cursor::EndCursorFollowed() {
- _vm->_dialogs->inventoryIconCursor(false); // May be holding something
+ _vm->_dialogs->InventoryIconCursor(false); // May be holding something
_tempHiddenCursor = false;
}
@@ -564,7 +564,7 @@ void CursorStoppedCheck(CORO_PARAM) {
// Re-initialize
_vm->_cursor->InitCurObj();
_vm->_cursor->InitCurPos();
- _vm->_dialogs->inventoryIconCursor(false); // May be holding something
+ _vm->_dialogs->InventoryIconCursor(false); // May be holding something
// Re-start the cursor trails
_vm->_cursor->_cursorProcessesRestarted = true;
@@ -597,7 +597,7 @@ void CursorProcess(CORO_PARAM, const void *) {
_vm->_cursor->InitCurObj();
_vm->_cursor->InitCurPos();
- _vm->_dialogs->inventoryIconCursor(false); // May be holding something
+ _vm->_dialogs->InventoryIconCursor(false); // May be holding something
_vm->_cursor->_cursorProcessesStopped = false;
_vm->_cursor->_cursorProcessesRestarted = false;
diff --git a/engines/tinsel/debugger.cpp b/engines/tinsel/debugger.cpp
index ba1606b4b9c..de46b7ded06 100644
--- a/engines/tinsel/debugger.cpp
+++ b/engines/tinsel/debugger.cpp
@@ -28,7 +28,6 @@
#include "tinsel/music.h"
#include "tinsel/font.h"
#include "tinsel/strres.h"
-#include "tinsel/noir/notebook.h"
namespace Tinsel {
@@ -62,12 +61,6 @@ int strToInt(const char *s) {
//----------------- CONSOLE CLASS ---------------------
Console::Console() : GUI::Debugger() {
- if (TinselVersion == 3) {
- registerCmd("add_clue", WRAP_METHOD(Console, cmd_add_clue));
- registerCmd("add_all_clues", WRAP_METHOD(Console, cmd_add_all_clues));
- registerCmd("cross_clue", WRAP_METHOD(Console, cmd_cross_clue));
- registerCmd("list_clues", WRAP_METHOD(Console, cmd_list_clues));
- }
registerCmd("item", WRAP_METHOD(Console, cmd_item));
registerCmd("scene", WRAP_METHOD(Console, cmd_scene));
registerCmd("music", WRAP_METHOD(Console, cmd_music));
@@ -85,8 +78,8 @@ bool Console::cmd_item(int argc, const char **argv) {
return true;
}
- _vm->_dialogs->holdItem(INV_NOICON);
- _vm->_dialogs->holdItem(strToInt(argv[1]));
+ _vm->_dialogs->HoldItem(INV_NOICON);
+ _vm->_dialogs->HoldItem(strToInt(argv[1]));
return false;
}
@@ -167,43 +160,4 @@ bool Console::cmd_string(int argc, const char **argv) {
return true;
}
-// Noir:
-bool Console::cmd_add_clue(int argc, const char **argv) {
- if (argc < 2) {
- debugPrintf("%s clue_id\n", argv[0]);
- debugPrintf("Adds a clue to the notebook\n");
- return true;
- }
-
- _vm->_notebook->addClue(strToInt(argv[1]));
- return false;
-}
-
-bool Console::cmd_add_all_clues(int argc, const char **argv) {
- auto clues = _vm->_dialogs->getAllNotebookClues();
- for (auto clue : clues) {
- _vm->_notebook->addClue(clue);
- }
- return false;
-}
-
-bool Console::cmd_cross_clue(int argc, const char **argv) {
- if (argc < 2) {
- debugPrintf("%s clue_id\n", argv[0]);
- debugPrintf("Crosses out a clue in the notebook\n");
- return true;
- }
-
- _vm->_notebook->crossClue(strToInt(argv[1]));
- return false;
-}
-
-bool Console::cmd_list_clues(int argc, const char **argv) {
- auto clues = _vm->_dialogs->getAllNotebookClues();
- for (auto clue : clues) {
- debugPrintf("%d\n", clue);
- }
- return true;
-}
-
} // End of namespace Tinsel
diff --git a/engines/tinsel/debugger.h b/engines/tinsel/debugger.h
index 2e5b52645ac..4813acc432c 100644
--- a/engines/tinsel/debugger.h
+++ b/engines/tinsel/debugger.h
@@ -34,10 +34,6 @@ public:
~Console() override;
private:
- bool cmd_add_clue(int argc, const char **argv);
- bool cmd_add_all_clues(int argc, const char **argv);
- bool cmd_cross_clue(int argc, const char **argv);
- bool cmd_list_clues(int argc, const char **argv);
bool cmd_item(int argc, const char **argv);
bool cmd_scene(int argc, const char **argv);
bool cmd_music(int argc, const char **argv);
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 3e07d742ba1..42eea9948db 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -809,7 +809,7 @@ static struct {
enum {
IB_NONE = -1, //
IB_UP = -2, // negative numbers returned
- IB_DOWN = -3, // by whichMenuBox()
+ IB_DOWN = -3, // by WhichMenuBox()
IB_SLIDE = -4, //
IB_SLIDE_UP = -5, //
IB_SLIDE_DOWN = -6 //
@@ -954,13 +954,13 @@ Dialogs::Dialogs() {
Dialogs::~Dialogs() {
delete _invObjects;
if (_objArray[0] != NULL) {
- dumpObjArray();
- dumpDobjArray();
- dumpIconArray();
+ DumpObjArray();
+ DumpDobjArray();
+ DumpIconArray();
}
}
-bool Dialogs::languageChange() {
+bool Dialogs::LanguageChange() {
LANGUAGE nLang = _vm->_config->_language;
if ((_vm->getFeatures() & GF_USE_3FLAGS) || (_vm->getFeatures() & GF_USE_4FLAGS) || (_vm->getFeatures() & GF_USE_5FLAGS)) {
@@ -980,7 +980,7 @@ bool Dialogs::languageChange() {
}
if (nLang != _vm->_config->_language) {
- killInventory();
+ KillInventory();
ChangeLanguage(nLang);
_vm->_config->_language = nLang;
return true;
@@ -996,7 +996,7 @@ bool Dialogs::languageChange() {
* Read in the scene hopper data file and set the
* pointers to the data and scene count.
*/
-void Dialogs::primeSceneHopper() {
+void Dialogs::PrimeSceneHopper() {
Common::File f;
uint32 vSize;
@@ -1049,7 +1049,7 @@ void Dialogs::primeSceneHopper() {
/**
* Free the scene hopper data
*/
-void Dialogs::freeSceneHopper() {
+void Dialogs::FreeSceneHopper() {
delete[] _pEntries;
_pEntries = nullptr;
@@ -1059,7 +1059,7 @@ void Dialogs::freeSceneHopper() {
_pHopper = nullptr;
}
-void Dialogs::firstScene(int first) {
+void Dialogs::FirstScene(int first) {
int i;
assert(_numScenes && _pHopper);
@@ -1090,16 +1090,16 @@ void Dialogs::firstScene(int first) {
cd.extraBase = first;
}
-void Dialogs::rememberChosenScene() {
+void Dialogs::RememberChosenScene() {
_bRemember = true;
}
-void Dialogs::setChosenScene() {
+void Dialogs::SetChosenScene() {
_lastChosenScene = cd.selBox + cd.extraBase;
_pChosenScene = &_pHopper[cd.selBox + cd.extraBase];
}
-void Dialogs::firstEntry(int first) {
+void Dialogs::FirstEntry(int first) {
int i;
_invD[INV_MENU].hInvTitle = _pChosenScene->hSceneDesc;
@@ -1126,7 +1126,7 @@ void Dialogs::firstEntry(int first) {
cd.extraBase = first;
}
-void Dialogs::hopAction() {
+void Dialogs::HopAction() {
HOPENTRY *pEntry = _pEntries + _pChosenScene->entryIndex + cd.selBox + cd.extraBase;
uint32 hScene = _pChosenScene->hScene;
@@ -1149,7 +1149,7 @@ void Dialogs::hopAction() {
/**
* Delete all the objects in iconArray[]
*/
-void Dialogs::dumpIconArray() {
+void Dialogs::DumpIconArray() {
for (int i = 0; i < MAX_ICONS; i++) {
MultiDeleteObjectIfExists(FIELD_STATUS, &_iconArray[i]);
}
@@ -1158,7 +1158,7 @@ void Dialogs::dumpIconArray() {
/**
* Delete all the objects in DobjArray[]
*/
-void Dialogs::dumpDobjArray() {
+void Dialogs::DumpDobjArray() {
for (int i = 0; i < MAX_WCOMP; i++) {
MultiDeleteObjectIfExists(FIELD_STATUS, &_dispObjArray[i]);
}
@@ -1167,7 +1167,7 @@ void Dialogs::dumpDobjArray() {
/**
* Delete all the objects in objArray[]
*/
-void Dialogs::dumpObjArray() {
+void Dialogs::DumpObjArray() {
for (int i = 0; i < MAX_WCOMP; i++) {
MultiDeleteObjectIfExists(FIELD_STATUS, &_objArray[i]);
}
@@ -1177,22 +1177,10 @@ void Dialogs::dumpObjArray() {
* Convert item ID number to pointer to item's compiled data
* i.e. Image data and Glitter code.
*/
-const InventoryObject *Dialogs::getInvObject(int id) {
+const InventoryObject *Dialogs::GetInvObject(int id) {
auto object = _invObjects->GetInvObject(id);
if (!object) {
- error("getInvObject(%d): Trying to manipulate undefined inventory icon", id);
- }
- return object;
-}
-
-/**
- * Convert item ID number to pointer to item's compiled data
- * i.e. Image data and Glitter code.
- */
-const InventoryObjectT3 *Dialogs::getInvObjectT3(int id) {
- auto object = _invObjects->GetInvObjectT3(id);
- if (!object) {
- error("getInvObjectT3(%d): Trying to manipulate undefined inventory icon", id);
+ error("GetInvObject(%d): Trying to manipulate undefined inventory icon", id);
}
return object;
}
@@ -1200,7 +1188,7 @@ const InventoryObjectT3 *Dialogs::getInvObjectT3(int id) {
/**
* Returns true if the given id represents a valid inventory object
*/
-bool Dialogs::getIsInvObject(int id) {
+bool Dialogs::GetIsInvObject(int id) {
int index = _invObjects->GetObjectIndexIfExists(id);
return index != -1;
}
@@ -1208,10 +1196,10 @@ bool Dialogs::getIsInvObject(int id) {
/**
* Convert item ID number to index.
*/
-int Dialogs::getObjectIndex(int id) const {
+int Dialogs::GetObjectIndex(int id) {
int index = _invObjects->GetObjectIndexIfExists(id);
if (index == -1) {
- error("getObjectIndex(%d): Trying to manipulate undefined inventory icon", id);
+ error("GetObjectIndex(%d): Trying to manipulate undefined inventory icon", id);
}
return index;
}
@@ -1220,7 +1208,7 @@ int Dialogs::getObjectIndex(int id) const {
* Returns position of an item in one of the inventories.
* The actual position is not important for the uses that this is put to.
*/
-int Dialogs::inventoryPos(int num) {
+int Dialogs::InventoryPos(int num) {
int i;
for (i = 0; i < _invD[INV_1].NoofItems; i++) // First inventory
@@ -1237,7 +1225,7 @@ int Dialogs::inventoryPos(int num) {
return INV_NOICON; // Not held, not in either inventory
}
-bool Dialogs::isInInventory(int object, int invnum) {
+bool Dialogs::IsInInventory(int object, int invnum) {
assert(invnum == INV_1 || invnum == INV_2);
for (int i = 0; i < _invD[invnum].NoofItems; i++) // First inventory
@@ -1250,7 +1238,7 @@ bool Dialogs::isInInventory(int object, int invnum) {
/**
* Returns which item is held (INV_NOICON (-1) if none)
*/
-int Dialogs::whichItemHeld() {
+int Dialogs::WhichItemHeld() {
return _heldItem;
}
@@ -1258,18 +1246,18 @@ int Dialogs::whichItemHeld() {
* Called from the cursor module when it re-initializes (at the start of
* a new scene). For if we are holding something at scene-change time.
*/
-void Dialogs::inventoryIconCursor(bool bNewItem) {
+void Dialogs::InventoryIconCursor(bool bNewItem) {
if (_heldItem != INV_NOICON) {
if (TinselVersion >= 2) {
if (bNewItem) {
- int objIndex = getObjectIndex(_heldItem);
+ int objIndex = GetObjectIndex(_heldItem);
if (TinselVersion == 3) {
- auto invObj = getInvObject(_heldItem);
+ auto invObj = GetInvObject(_heldItem);
- if (invObj->hasAttribute(InvObjAttr::NOTEBOOK_CLUE)) {
- _heldFilm = _vm->_systemReel->get((SysReel)objIndex);
+ if (invObj->hasAttribute(InvObjAttr::V3ATTR_X200)) {
+ _heldFilm = _vm->_systemReel->Get((SysReel)objIndex);
} else {
_heldFilm = _invFilms[objIndex];
}
@@ -1279,7 +1267,7 @@ void Dialogs::inventoryIconCursor(bool bNewItem) {
}
_vm->_cursor->SetAuxCursor(_heldFilm);
} else {
- auto invObj = getInvObject(_heldItem);
+ auto invObj = GetInvObject(_heldItem);
_vm->_cursor->SetAuxCursor(invObj->getIconFilm());
}
}
@@ -1288,16 +1276,12 @@ void Dialogs::inventoryIconCursor(bool bNewItem) {
/**
* Returns true if the inventory is active.
*/
-bool Dialogs::inventoryActive() {
- return _inventoryState == ACTIVE_INV;
+bool Dialogs::InventoryActive() {
+ return (_inventoryState == ACTIVE_INV);
}
-bool Dialogs::inventoryOrNotebookActive() {
- return inventoryActive() || ((TinselVersion == 3) && _vm->_notebook->isOpen());
-}
-
-int Dialogs::whichInventoryOpen() {
- if (TinselVersion == 3 && _vm->_notebook->isOpen()) {
+int Dialogs::WhichInventoryOpen() {
+ if (TinselVersion == 3 && _vm->_notebook->IsOpen()) {
return INV_NOTEBOOK;
}
if (_inventoryState != ACTIVE_INV)
@@ -1315,7 +1299,7 @@ int Dialogs::whichInventoryOpen() {
* Set first load/save file entry displayed.
* Point Box[] text pointers to appropriate file descriptions.
*/
-void Dialogs::firstFile(int first) {
+void Dialogs::FirstFile(int first) {
int i, j;
i = getList();
@@ -1346,7 +1330,7 @@ void Dialogs::firstFile(int first) {
* Save the game using filename from selected slot & current description.
*/
-void Dialogs::invSaveGame() {
+void Dialogs::InvSaveGame() {
if (cd.selBox != NOBOX) {
#ifndef JAPAN
_saveGameDesc[strlen(_saveGameDesc) - 1] = 0; // Don't include the cursor!
@@ -1358,7 +1342,7 @@ void Dialogs::invSaveGame() {
/**
* Load the selected saved game.
*/
-void Dialogs::invLoadGame() {
+void Dialogs::InvLoadGame() {
int rGame;
if (cd.selBox != NOBOX && (cd.selBox + cd.extraBase < cd.numSaved)) {
@@ -1376,7 +1360,7 @@ void Dialogs::invLoadGame() {
* Returns true if the string was altered.
*/
#ifndef JAPAN
-bool Dialogs::updateString(const Common::KeyState &kbd) {
+bool Dialogs::UpdateString(const Common::KeyState &kbd) {
int cpos;
if (!cd.editableRgroup)
@@ -1426,7 +1410,7 @@ static bool InvKeyIn(const Common::KeyState &kbd) {
return true; // Key needs processing
} else {
#ifndef JAPAN
- if (_vm->_dialogs->updateString(kbd)) {
+ if (_vm->_dialogs->UpdateString(kbd)) {
/*
* Delete display of text currently being edited,
* and replace it with freshly edited text.
@@ -1434,16 +1418,16 @@ static bool InvKeyIn(const Common::KeyState &kbd) {
MultiDeleteObjectIfExists(FIELD_STATUS, &_vm->_dialogs->_iconArray[HL3]);
_vm->_dialogs->_iconArray[HL3] = ObjectTextOut(
_vm->_bg->GetPlayfieldList(FIELD_STATUS), _vm->_dialogs->_saveGameDesc, 0,
- _vm->_dialogs->currentInventoryX() + cd.box[cd.selBox].xpos + 2,
- _vm->_dialogs->currentInventoryY() + cd.box[cd.selBox].ypos + TYOFF,
+ _vm->_dialogs->CurrentInventoryX() + cd.box[cd.selBox].xpos + 2,
+ _vm->_dialogs->CurrentInventoryY() + cd.box[cd.selBox].ypos + TYOFF,
_vm->_font->GetTagFontHandle(), 0);
if (MultiRightmost(_vm->_dialogs->_iconArray[HL3]) > MAX_NAME_RIGHT) {
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _vm->_dialogs->_iconArray[HL3]);
- _vm->_dialogs->updateString(Common::KeyState(Common::KEYCODE_BACKSPACE));
+ _vm->_dialogs->UpdateString(Common::KeyState(Common::KEYCODE_BACKSPACE));
_vm->_dialogs->_iconArray[HL3] = ObjectTextOut(
_vm->_bg->GetPlayfieldList(FIELD_STATUS), _vm->_dialogs->_saveGameDesc, 0,
- _vm->_dialogs->currentInventoryX() + cd.box[cd.selBox].xpos + 2,
- _vm->_dialogs->currentInventoryY() + cd.box[cd.selBox].ypos + TYOFF,
+ _vm->_dialogs->CurrentInventoryX() + cd.box[cd.selBox].xpos + 2,
+ _vm->_dialogs->CurrentInventoryY() + cd.box[cd.selBox].ypos + TYOFF,
_vm->_font->GetTagFontHandle(), 0);
}
MultiSetZPosition(_vm->_dialogs->_iconArray[HL3], Z_INV_ITEXT + 2);
@@ -1457,7 +1441,7 @@ static bool InvKeyIn(const Common::KeyState &kbd) {
* Highlights selected box.
* If it's editable (save game), copy existing description and add a cursor.
*/
-void Dialogs::select(int i, bool force) {
+void Dialogs::Select(int i, bool force) {
#ifdef JAPAN
time_t secs_now;
struct tm *time_now;
@@ -1548,7 +1532,7 @@ void Dialogs::select(int i, bool force) {
/**
* Stop holding an item.
*/
-void Dialogs::dropItem(int item) {
+void Dialogs::DropItem(int item) {
if (_heldItem == item) {
_heldItem = INV_NOICON; // Item not held
_vm->_cursor->DelAuxCursor(); // no longer aux cursor
@@ -1561,7 +1545,7 @@ void Dialogs::dropItem(int item) {
/**
* Clears the specified inventory
*/
-void Dialogs::clearInventory(int invno) {
+void Dialogs::ClearInventory(int invno) {
assert(invno == INV_1 || invno == INV_2);
_invD[invno].NoofItems = 0;
@@ -1572,7 +1556,7 @@ void Dialogs::clearInventory(int invno) {
* Stick the item into an inventory list (contents[]), and hold the
* item if requested.
*/
-void Dialogs::addToInventory(int invno, int icon, bool hold) {
+void Dialogs::AddToInventory(int invno, int icon, bool hold) {
int i;
bool bOpen;
@@ -1585,12 +1569,12 @@ void Dialogs::addToInventory(int invno, int icon, bool hold) {
bOpen = true;
// Make sure it doesn't get in both!
- remFromInventory(_activeInv == INV_1 ? INV_2 : INV_1, icon);
+ RemFromInventory(_activeInv == INV_1 ? INV_2 : INV_1, icon);
} else {
bOpen = false;
if ((TinselVersion >= 2) && invno == INV_DEFAULT) {
- auto invObj = getInvObject(icon);
+ auto invObj = GetInvObject(icon);
if (invObj->hasAttribute(InvObjAttr::DEFINV2))
invno = INV_2;
else if (invObj->hasAttribute(InvObjAttr::DEFINV1))
@@ -1601,9 +1585,9 @@ void Dialogs::addToInventory(int invno, int icon, bool hold) {
}
if (invno == INV_1)
- remFromInventory(INV_2, icon);
+ RemFromInventory(INV_2, icon);
else if (invno == INV_2)
- remFromInventory(INV_1, icon);
+ RemFromInventory(INV_1, icon);
// See if it's already there
for (i = 0; i < _invD[invno].NoofItems; i++) {
@@ -1620,7 +1604,7 @@ void Dialogs::addToInventory(int invno, int icon, bool hold) {
// Count how many current contents have end attribute
for (i = 0, nei = 0; i < _invD[INV_CONV].NoofItems; i++) {
- auto invObj = getInvObject(_invD[INV_CONV].contents[i]);
+ auto invObj = GetInvObject(_invD[INV_CONV].contents[i]);
if (invObj->hasAttribute(InvObjAttr::CONVENDITEM))
nei++;
}
@@ -1665,14 +1649,14 @@ void Dialogs::addToInventory(int invno, int icon, bool hold) {
// Hold it if requested
if (hold)
- holdItem(icon);
+ HoldItem(icon);
}
/**
* Take the item from the inventory list (contents[]).
* Return FALSE if item wasn't present, true if it was.
*/
-bool Dialogs::remFromInventory(int invno, int icon) {
+bool Dialogs::RemFromInventory(int invno, int icon) {
int i;
assert(invno == INV_1 || invno == INV_2 || invno == INV_CONV); // Trying to delete from illegal inventory
@@ -1704,7 +1688,7 @@ bool Dialogs::remFromInventory(int invno, int icon) {
/**
* If the item is not already held, hold it.
*/
-void Dialogs::holdItem(int item, bool bKeepFilm) {
+void Dialogs::HoldItem(int item, bool bKeepFilm) {
if (_heldItem != item) {
if ((TinselVersion >= 2) && (_heldItem != INV_NOICON)) {
// No longer holding previous item
@@ -1712,17 +1696,17 @@ void Dialogs::holdItem(int item, bool bKeepFilm) {
// If old held object is not in an inventory, and
// has a default, stick it in its default inventory.
- if (!isInInventory(_heldItem, INV_1) && !isInInventory(_heldItem, INV_2)) {
- auto invObj = getInvObject(_heldItem);
+ if (!IsInInventory(_heldItem, INV_1) && !IsInInventory(_heldItem, INV_2)) {
+ auto invObj = GetInvObject(_heldItem);
if (invObj->hasAttribute(InvObjAttr::DEFINV1))
- addToInventory(INV_1, _heldItem);
+ AddToInventory(INV_1, _heldItem);
else if (invObj->hasAttribute(InvObjAttr::DEFINV2))
- addToInventory(INV_2, _heldItem);
+ AddToInventory(INV_2, _heldItem);
else {
- if ((TinselVersion < 3) || (!(invObj->hasAttribute(InvObjAttr::NOTEBOOK_CLUE)) && !(invObj->hasAttribute(InvObjAttr::V3ATTR_X400)))) {
+ if ((TinselVersion < 3) || (!(invObj->hasAttribute(InvObjAttr::V3ATTR_X200)) && !(invObj->hasAttribute(InvObjAttr::V3ATTR_X400)))) {
// Hook for definable default inventory
- addToInventory(INV_1, _heldItem);
+ AddToInventory(INV_1, _heldItem);
}
}
}
@@ -1732,20 +1716,20 @@ void Dialogs::holdItem(int item, bool bKeepFilm) {
_vm->_cursor->DelAuxCursor(); // no longer aux cursor
if (item != INV_NOICON) {
- auto invObj = getInvObject(item);
+ auto invObj = GetInvObject(item);
_vm->_cursor->SetAuxCursor(invObj->getIconFilm()); // and is aux. cursor
}
// WORKAROUND: If a held item is being removed that's not in either inventory (i.e. it was picked up
// but never put in them), then when removing it from being held, drop it in the luggage
- if (_heldItem != INV_NOICON && inventoryPos(_heldItem) == INV_HELDNOTIN)
- addToInventory(INV_1, _heldItem);
+ if (_heldItem != INV_NOICON && InventoryPos(_heldItem) == INV_HELDNOTIN)
+ AddToInventory(INV_1, _heldItem);
}
_heldItem = item; // Item held
if (TinselVersion >= 2) {
- inventoryIconCursor(!bKeepFilm);
+ InventoryIconCursor(!bKeepFilm);
// Redraw contents - held item not displayed as a content.
_ItemsChanged = true;
@@ -1796,15 +1780,7 @@ enum { I_NOTIN,
* changed and I got fed up of faffing about. It's probably easier just
* to rework all this.
*/
-int Dialogs::invArea(int x, int y) {
- if (TinselVersion == 3) {
- if (_vm->_notebook->isOpen()) {
- if (_vm->_notebook->handlePointer(Common::Point(x, y)) != 0) {
- return I_ENDCHANGE;
- }
- return I_NOTIN;
- }
- }
+int Dialogs::InvArea(int x, int y) {
if (TinselVersion >= 2) {
int RightX = MultiRightmost(_rectObject) - NM_BG_SIZ_X - NM_BG_POS_X - NM_RS_R_INSET;
int BottomY = MultiLowest(_rectObject) - NM_BG_SIZ_Y - NM_BG_POS_Y - NM_RS_B_INSET;
@@ -1936,7 +1912,7 @@ int Dialogs::invArea(int x, int y) {
* Returns the id of the icon displayed under the given position.
* Also return co-ordinates of items tag display position, if requested.
*/
-int Dialogs::invItem(int *x, int *y, bool update) {
+int Dialogs::InvItem(int *x, int *y, bool update) {
int itop, ileft;
int row, col;
int item;
@@ -1966,10 +1942,10 @@ int Dialogs::invItem(int *x, int *y, bool update) {
return INV_NOICON;
}
-int Dialogs::invItem(Common::Point &coOrds, bool update) {
+int Dialogs::InvItem(Common::Point &coOrds, bool update) {
int x = coOrds.x;
int y = coOrds.y;
- return invItem(&x, &y, update);
+ return InvItem(&x, &y, update);
//coOrds.x = x;
//coOrds.y = y;
}
@@ -1977,7 +1953,7 @@ int Dialogs::invItem(Common::Point &coOrds, bool update) {
/**
* Returns the id of the icon displayed under the given position.
*/
-int Dialogs::invItemId(int x, int y) {
+int Dialogs::InvItemId(int x, int y) {
int itop, ileft;
int row, col;
int item;
@@ -2008,7 +1984,7 @@ int Dialogs::invItemId(int x, int y) {
/**
* Finds which box the cursor is in.
*/
-int Dialogs::whichMenuBox(int curX, int curY, bool bSlides) {
+int Dialogs::WhichMenuBox(int curX, int curY, bool bSlides) {
if (bSlides) {
for (int i = 0; i < _numMdSlides; i++) {
Common::Rect bounds = MultiBounds(_mdSlides[i].obj);
@@ -2098,9 +2074,9 @@ int Dialogs::whichMenuBox(int curX, int curY, bool bSlides) {
#define ROTX1 60 // Rotate button's offsets from the center
/**
- * invBoxes
+ * InvBoxes
*/
-void Dialogs::invBoxes(bool InBody, int curX, int curY) {
+void Dialogs::InvBoxes(bool InBody, int curX, int curY) {
int rotateIndex = -1;
int index; // Box pointed to on this call
const FILM *pfilm;
@@ -2109,7 +2085,7 @@ void Dialogs::invBoxes(bool InBody, int curX, int curY) {
if (!InBody)
index = -1;
else {
- index = whichMenuBox(curX, curY, false);
+ index = WhichMenuBox(curX, curY, false);
}
// If no icon pointed to, or points to (logical position of)
@@ -2141,7 +2117,7 @@ void Dialogs::invBoxes(bool InBody, int curX, int curY) {
cd.box[cd.pointBox].boxType == TOGGLE2) {
pfilm = (const FILM *)_vm->_handle->LockMem(_hWinParts);
- _iconArray[HL1] = addObject(&pfilm->reels[cd.box[cd.pointBox].bi + HIGRAPH], -1);
+ _iconArray[HL1] = AddObject(&pfilm->reels[cd.box[cd.pointBox].bi + HIGRAPH], -1);
MultiSetAniXYZ(_iconArray[HL1],
_invD[_activeInv].inventoryX + cd.box[cd.pointBox].xpos,
_invD[_activeInv].inventoryY + cd.box[cd.pointBox].ypos,
@@ -2154,13 +2130,13 @@ void Dialogs::invBoxes(bool InBody, int curX, int curY) {
rotateIndex = cd.box[cd.pointBox].bi;
if (rotateIndex == IX2_LEFT1) {
- _iconArray[HL1] = addObject(&pfilm->reels[IX2_LEFT2], -1);
+ _iconArray[HL1] = AddObject(&pfilm->reels[IX2_LEFT2], -1);
MultiSetAniXYZ(_iconArray[HL1],
_invD[_activeInv].inventoryX + cd.box[cd.pointBox].xpos - ROTX1,
_invD[_activeInv].inventoryY + cd.box[cd.pointBox].ypos,
Z_INV_ICONS + 1);
} else if (rotateIndex == IX2_RIGHT1) {
- _iconArray[HL1] = addObject(&pfilm->reels[IX2_RIGHT2], -1);
+ _iconArray[HL1] = AddObject(&pfilm->reels[IX2_RIGHT2], -1);
MultiSetAniXYZ(_iconArray[HL1],
_invD[_activeInv].inventoryX + cd.box[cd.pointBox].xpos + ROTX1,
_invD[_activeInv].inventoryY + cd.box[cd.pointBox].ypos,
@@ -2173,14 +2149,14 @@ void Dialogs::invBoxes(bool InBody, int curX, int curY) {
/**
* Monitors for POINTED event for inventory icons.
*/
-void Dialogs::invLabels(bool InBody, int aniX, int aniY) {
+void Dialogs::InvLabels(bool InBody, int aniX, int aniY) {
int index; // Icon pointed to on this call
// Find out which icon is currently pointed to
if (!InBody)
index = INV_NOICON;
else {
- index = invItem(&aniX, &aniY, false);
+ index = InvItem(&aniX, &aniY, false);
if (index != INV_NOICON) {
if (index >= _invD[_activeInv].NoofItems)
index = INV_NOICON;
@@ -2195,17 +2171,13 @@ void Dialogs::invLabels(bool InBody, int aniX, int aniY) {
_pointedIcon = INV_NOICON;
} else if (index != _pointedIcon) {
// A new icon is pointed to - run its script with POINTED event
- auto invObj = getInvObject(index);
+ auto invObj = GetInvObject(index);
if (invObj->getScript())
InvTinselEvent(invObj, POINTED, PLR_NOEVENT, index);
_pointedIcon = index;
}
}
-void Dialogs::invPointEvent(const InventoryObject *invObj, int index) {
- InvTinselEvent(invObj, POINTED, PLR_NOEVENT, index);
-}
-
/**************************************************************************/
/***/
/**************************************************************************/
@@ -2216,7 +2188,7 @@ void Dialogs::invPointEvent(const InventoryObject *invObj, int index) {
* It seems to set up slideStuff[], an array of possible first-displayed
* icons set against the matching y-positions of the slider.
*/
-void Dialogs::adjustTop() {
+void Dialogs::AdjustTop() {
int tMissing, bMissing, nMissing;
int nsliderYpos;
int rowsWanted;
@@ -2278,11 +2250,11 @@ void Dialogs::adjustTop() {
/**
* Insert an inventory icon object onto the display list.
*/
-OBJECT *Dialogs::addInvObject(int num, const FREEL **pfreel, const FILM **pfilm) {
- auto invObj = getInvObject(num);
+OBJECT *Dialogs::AddInvObject(int num, const FREEL **pfreel, const FILM **pfilm) {
+ auto invObj = GetInvObject(num);
const FILM *pFilm = (const FILM *)_vm->_handle->LockMem(invObj->getIconFilm());
const FREEL *pfr = (const FREEL *)&pFilm->reels[0];
- const MULTI_INIT *pmi = pfr->GetMultiInit();
+ const MULTI_INIT *pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfr->mobj));
OBJECT *pPlayObj; // The object we insert
*pfreel = pfr;
@@ -2298,7 +2270,7 @@ OBJECT *Dialogs::addInvObject(int num, const FREEL **pfreel, const FILM **pfilm)
/**
* Create display objects for the displayed icons in an inventory window.
*/
-void Dialogs::fillInInventory() {
+void Dialogs::FillInInventory() {
int Index; // Index into contents[]
int n = 0; // index into iconArray[]
int xpos, ypos;
@@ -2306,10 +2278,10 @@ void Dialogs::fillInInventory() {
const FREEL *pfr;
const FILM *pfilm;
- dumpIconArray();
+ DumpIconArray();
if (_invDragging != ID_SLIDE)
- adjustTop(); // Set up slideStuff[]
+ AdjustTop(); // Set up slideStuff[]
Index = _invD[_activeInv].FirstDisp; // Start from first displayed object
n = 0;
@@ -2323,7 +2295,7 @@ void Dialogs::fillInInventory() {
break;
else if (_invD[_activeInv].contents[Index] != _heldItem) {
// Create a display object and position it
- _iconArray[n] = addInvObject(_invD[_activeInv].contents[Index], &pfr, &pfilm);
+ _iconArray[n] = AddInvObject(_invD[_activeInv].contents[Index], &pfr, &pfilm);
MultiSetAniXYZ(_iconArray[n],
_invD[_activeInv].inventoryX + xpos,
_invD[_activeInv].inventoryY + ypos,
@@ -2346,7 +2318,7 @@ enum { FROM_HANDLE,
* Set up a rectangle as the background to the inventory window.
* Additionally, sticks the window title up.
*/
-void Dialogs::addBackground(OBJECT **rect, const Common::Rect &bounds, OBJECT **title, int textFrom) {
+void Dialogs::AddBackground(OBJECT **rect, const Common::Rect &bounds, OBJECT **title, int textFrom) {
// Why not 2 ????
int width = bounds.width();
int height = bounds.height();
@@ -2356,10 +2328,10 @@ void Dialogs::addBackground(OBJECT **rect, const Common::Rect &bounds, OBJECT **
// add it to display list and position it
MultiInsertObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), *rect);
- positionInventory(*rect,
- (TinselVersion < 3 ? NM_BG_POS_X : 0),
- (TinselVersion < 3 ? NM_BG_POS_Y : 0),
- Z_INV_BRECT);
+ PositionInventory(*rect,
+ (TinselVersion < 3 ? NM_BG_POS_X : 0),
+ (TinselVersion < 3 ? NM_BG_POS_Y : 0),
+ Z_INV_BRECT);
if (title == NULL)
return;
@@ -2396,13 +2368,13 @@ Common::Rect MultiBounds(OBJECT *obj) {
/**
* Adds a title for a dialog
*/
-void Dialogs::addTitle(OBJECT **title, const Common::Rect &rect) {
+void Dialogs::AddTitle(OBJECT **title, const Common::Rect &bounds) {
if (_invD[_activeInv].hInvTitle != (SCNHANDLE)NO_HEADING) {
LoadStringRes(_invD[_activeInv].hInvTitle, _vm->_font->TextBufferAddr(), TBUFSZ);
int xOffset = (TinselVersion == 3) ? 0 : NM_BG_POS_X;
*title = ObjectTextOut(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _vm->_font->TextBufferAddr(), 0,
- _invD[_activeInv].inventoryX + (rect.width() / 2) + xOffset, _invD[_activeInv].inventoryY + NM_TOFF,
+ _invD[_activeInv].inventoryX + (bounds.width() / 2) + xOffset, _invD[_activeInv].inventoryY + NM_TOFF,
_vm->_font->GetTagFontHandle(), TXT_CENTER, 0);
assert(*title);
MultiSetZPosition(*title, Z_INV_HTEXT);
@@ -2412,9 +2384,9 @@ void Dialogs::addTitle(OBJECT **title, const Common::Rect &rect) {
/**
* Insert a part of the inventory window frame onto the display list.
*/
-OBJECT *Dialogs::addObject(const FREEL *pfreel, int num) {
- const MULTI_INIT *pmi = pfreel->GetMultiInit();
- const FRAME *pFrame = pmi->GetFrame();
+OBJECT *Dialogs::AddObject(const FREEL *pfreel, int num) {
+ const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfreel->mobj));
+ const FRAME *pFrame = (const FRAME *)_vm->_handle->LockMem(FROM_32(pmi->hMulFrame));
const IMAGE *pim;
OBJECT *pPlayObj;
@@ -2446,8 +2418,8 @@ OBJECT *Dialogs::addObject(const FREEL *pfreel, int num) {
* Display the scroll bar slider.
*/
-void Dialogs::addSlider(OBJECT **slide, const FILM *pfilm) {
- _slideObject = *slide = addObject(&pfilm->reels[IX_SLIDE], -1);
+void Dialogs::AddSlider(OBJECT **slide, const FILM *pfilm) {
+ _slideObject = *slide = AddObject(&pfilm->reels[IX_SLIDE], -1);
MultiSetAniXYZ(*slide, MultiRightmost(_rectObject) + ((TinselVersion >= 2) ? NM_SLX : -M_SXOFF + 2),
_invD[_activeInv].inventoryY + _sliderYpos,
Z_INV_MFRAME);
@@ -2456,7 +2428,7 @@ void Dialogs::addSlider(OBJECT **slide, const FILM *pfilm) {
/**
* Display a box with some text in it.
*/
-void Dialogs::addBox(int *pi, const int i) {
+void Dialogs::AddBox(int *pi, const int i) {
int x = _invD[_activeInv].inventoryX + cd.box[i].xpos;
int y = _invD[_activeInv].inventoryY + cd.box[i].ypos;
int *pival = cd.box[i].ival;
@@ -2533,7 +2505,7 @@ void Dialogs::addBox(int *pi, const int i) {
case ARSGBUT:
pFilm = (const FILM *)_vm->_handle->LockMem(_hWinParts);
- _iconArray[*pi] = addObject(&pFilm->reels[cd.box[i].bi + NORMGRAPH], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[cd.box[i].bi + NORMGRAPH], -1);
MultiSetAniXYZ(_iconArray[*pi], x, y, Z_INV_BRECT + 1);
*pi += 1;
@@ -2547,7 +2519,7 @@ void Dialogs::addBox(int *pi, const int i) {
if (_vm->_config->_isAmericanEnglishVersion && cd.box[i].bi == FIX_UK)
cd.box[i].bi = FIX_USA;
- _iconArray[*pi] = addObject(&pFilm->reels[cd.box[i].bi], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[cd.box[i].bi], -1);
MultiSetAniXYZ(_iconArray[*pi], x, y, Z_INV_BRECT + 2);
*pi += 1;
@@ -2557,9 +2529,9 @@ void Dialogs::addBox(int *pi, const int i) {
pFilm = (const FILM *)_vm->_handle->LockMem(_hWinParts);
if (*pival)
- _iconArray[*pi] = addObject(&pFilm->reels[cd.box[i].bi], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[cd.box[i].bi], -1);
else
- _iconArray[*pi] = addObject(&pFilm->reels[cd.box[i].bi + 1], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[cd.box[i].bi + 1], -1);
MultiSetAniXYZ(_iconArray[*pi], x, y, Z_INV_BRECT + 1);
*pi += 1;
@@ -2583,7 +2555,7 @@ void Dialogs::addBox(int *pi, const int i) {
pFilm = (const FILM *)_vm->_handle->LockMem(_hWinParts);
cd.box[i].bi = *pival ? IX_TICK1 : IX_CROSS1;
- _iconArray[*pi] = addObject(&pFilm->reels[cd.box[i].bi + NORMGRAPH], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[cd.box[i].bi + NORMGRAPH], -1);
MultiSetAniXYZ(_iconArray[*pi], x, y, Z_INV_BRECT + 1);
*pi += 1;
@@ -2614,10 +2586,10 @@ void Dialogs::addBox(int *pi, const int i) {
pFilm = (const FILM *)_vm->_handle->LockMem(_hWinParts);
xdisp = SLIDE_RANGE * (*pival) / cd.box[i].w;
- _iconArray[*pi] = addObject(&pFilm->reels[IX_MDGROOVE], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[IX_MDGROOVE], -1);
MultiSetAniXYZ(_iconArray[*pi], x, y, Z_MDGROOVE);
*pi += 1;
- _iconArray[*pi] = addObject(&pFilm->reels[IX_MDSLIDER], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[IX_MDSLIDER], -1);
MultiSetAniXYZ(_iconArray[*pi], x + SLIDE_MINX + xdisp, y, Z_MDSLIDER);
assert(_numMdSlides < MAXSLIDES);
_mdSlides[_numMdSlides].num = i;
@@ -2645,12 +2617,12 @@ void Dialogs::addBox(int *pi, const int i) {
// Left one
if (!_noLanguage) {
- _iconArray[*pi] = addObject(&pFilm->reels[IX2_LEFT1], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[IX2_LEFT1], -1);
MultiSetAniXYZ(_iconArray[*pi], x - ROTX1, y, Z_INV_BRECT + 1);
*pi += 1;
// Right one
- _iconArray[*pi] = addObject(&pFilm->reels[IX2_RIGHT1], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[IX2_RIGHT1], -1);
MultiSetAniXYZ(_iconArray[*pi], x + ROTX1, y, Z_INV_BRECT + 1);
*pi += 1;
@@ -2676,7 +2648,7 @@ void Dialogs::addBox(int *pi, const int i) {
// Current language's flag
pFilm = (const FILM *)_vm->_handle->LockMem(LanguageFlag(_displayedLanguage));
- _iconArray[*pi] = addObject(&pFilm->reels[0], -1);
+ _iconArray[*pi] = AddObject(&pFilm->reels[0], -1);
MultiSetAniXYZ(_iconArray[*pi], x + FLAGX, y + FLAGY, Z_INV_BRECT + 1);
*pi += 1;
break;
@@ -2686,14 +2658,14 @@ void Dialogs::addBox(int *pi, const int i) {
/**
* Display some boxes.
*/
-void Dialogs::addBoxes(bool bPosnSlide) {
+void Dialogs::AddBoxes(bool bPosnSlide) {
int objCount = NUMHL; // Object count - allow for HL1, HL2 etc.
- dumpIconArray();
+ DumpIconArray();
_numMdSlides = 0;
for (int i = 0; i < cd.NumBoxes; i++) {
- addBox(&objCount, i);
+ AddBox(&objCount, i);
}
if (cd.bExtraWin) {
@@ -2732,15 +2704,15 @@ void Dialogs::addBoxes(bool bPosnSlide) {
/**
* Display the scroll bar slider.
*/
-void Dialogs::addEWSlider(OBJECT **slide, const FILM *pfilm) {
- _slideObject = *slide = addObject(&pfilm->reels[IX_SLIDE], -1);
+void Dialogs::AddEWSlider(OBJECT **slide, const FILM *pfilm) {
+ _slideObject = *slide = AddObject(&pfilm->reels[IX_SLIDE], -1);
MultiSetAniXYZ(*slide, _invD[_activeInv].inventoryX + 24 + 127, _sliderYpos, Z_INV_MFRAME);
}
/**
- * addExtraWindow
+ * AddExtraWindow
*/
-int Dialogs::addExtraWindow(int x, int y, OBJECT **retObj) {
+int Dialogs::AddExtraWindow(int x, int y, OBJECT **retObj) {
int n = 0;
const FILM *pfilm;
@@ -2751,31 +2723,31 @@ int Dialogs::addExtraWindow(int x, int y, OBJECT **retObj) {
y += (TinselVersion >= 2) ? 38 : 24;
// Draw the four corners
- retObj[n] = addObject(&pfilm->reels[IX_RTL], -1); // Top left
+ retObj[n] = AddObject(&pfilm->reels[IX_RTL], -1); // Top left
MultiSetAniXYZ(retObj[n++], x, y, Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_NTR], -1); // Top right
+ retObj[n] = AddObject(&pfilm->reels[IX_NTR], -1); // Top right
MultiSetAniXYZ(retObj[n++], x + ((TinselVersion >= 2) ? _TLwidth + 312 : 152), y, Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_BL], -1); // Bottom left
+ retObj[n] = AddObject(&pfilm->reels[IX_BL], -1); // Bottom left
MultiSetAniXYZ(retObj[n++], x, y + ((TinselVersion >= 2) ? _TLheight + 208 : 124), Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_BR], -1); // Bottom right
+ retObj[n] = AddObject(&pfilm->reels[IX_BR], -1); // Bottom right
MultiSetAniXYZ(retObj[n++], x + ((TinselVersion >= 2) ? _TLwidth + 312 : 152),
y + ((TinselVersion >= 2) ? _TLheight + 208 : 124),
Z_INV_MFRAME);
// Draw the edges
- retObj[n] = addObject(&pfilm->reels[IX_H156], -1); // Top
+ retObj[n] = AddObject(&pfilm->reels[IX_H156], -1); // Top
MultiSetAniXYZ(retObj[n++], x + ((TinselVersion >= 2) ? _TLwidth : 6), y + NM_TBT, Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_H156], -1); // Bottom
+ retObj[n] = AddObject(&pfilm->reels[IX_H156], -1); // Bottom
MultiSetAniXYZ(retObj[n++], x + ((TinselVersion >= 2) ? _TLwidth : 6),
y + ((TinselVersion >= 2) ? _TLheight + 208 + _BLheight + NM_BSY : 143),
Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_V104], -1); // Left
+ retObj[n] = AddObject(&pfilm->reels[IX_V104], -1); // Left
MultiSetAniXYZ(retObj[n++], x + NM_LSX, y + ((TinselVersion >= 2) ? _TLheight : 20), Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_V104], -1); // Right 1
+ retObj[n] = AddObject(&pfilm->reels[IX_V104], -1); // Right 1
MultiSetAniXYZ(retObj[n++], x + ((TinselVersion >= 2) ? _TLwidth + 312 + _TRwidth + NM_RSX : 179),
y + ((TinselVersion >= 2) ? _TLheight : 20),
Z_INV_MFRAME);
- retObj[n] = addObject(&pfilm->reels[IX_V104], -1); // Right 2
+ retObj[n] = AddObject(&pfilm->reels[IX_V104], -1); // Right 2
MultiSetAniXYZ(retObj[n++], x + ((TinselVersion >= 2) ? _TLwidth + 312 + _TRwidth + NM_SBL : 188),
y + ((TinselVersion >= 2) ? _TLheight : 20),
Z_INV_MFRAME);
@@ -2784,7 +2756,7 @@ int Dialogs::addExtraWindow(int x, int y, OBJECT **retObj) {
_sliderYpos = _sliderYmin = y + 27;
_sliderYmax = y + 273;
- retObj[n++] = _slideObject = addObject(&pfilm->reels[IX_SLIDE], -1);
+ retObj[n++] = _slideObject = AddObject(&pfilm->reels[IX_SLIDE], -1);
MultiSetAniXYZ(_slideObject,
x + _TLwidth + 320 + _TRwidth - NM_BG_POS_X + NM_BG_SIZ_X - 2,
_sliderYpos,
@@ -2792,14 +2764,14 @@ int Dialogs::addExtraWindow(int x, int y, OBJECT **retObj) {
} else {
_sliderYpos = _sliderYmin = y + 9;
_sliderYmax = y + 134;
- addEWSlider(&retObj[n++], pfilm);
+ AddEWSlider(&retObj[n++], pfilm);
}
return n;
}
-void Dialogs::constructInventoryCommon(SysReel reel, bool hasTitle) {
- dumpObjArray();
+void Dialogs::ConstructInventoryCommon(SysReel reel, bool hasTitle) {
+ DumpObjArray();
// Get the frame's data
_objArray[0] = InsertSystemReelObj(reel);
@@ -2808,30 +2780,30 @@ void Dialogs::constructInventoryCommon(SysReel reel, bool hasTitle) {
auto bounds = MultiBounds(_objArray[0]);
_invD[_activeInv].inventoryX = (SCREEN_WIDTH - bounds.width()) / 2;
_invD[_activeInv].inventoryY = (SCREEN_HEIGHT - bounds.height()) / 2;
- positionInventory(_objArray[0], 0, 0, Z_INV_MFRAME);
+ PositionInventory(_objArray[0], 0, 0, Z_INV_MFRAME);
MultiSetZPosition(_objArray[0], 16);
- addBackground(&_objArray[1], bounds);
+ AddBackground(&_objArray[1], bounds);
if (hasTitle) {
- addTitle(&_objArray[2], bounds);
+ AddTitle(&_objArray[2], bounds);
if (_objArray[2]) {
- // We currently skip this, as addTitle still needs ObjTextOut updates.
+ // We currently skip this, as AddTitle still needs ObjTextOut updates.
warning("TODO: Align title");
}
}
}
-void Dialogs::constructMainInventory() {
- warning("TODO: Complete implementation of constructMainInventory");
- constructInventoryCommon(SysReel::INVMAIN, false);
+void Dialogs::ConstructMainInventory() {
+ warning("TODO: Complete implementation of ConstructMainInventory");
+ ConstructInventoryCommon(SysReel::INVMAIN, false);
_invD[_activeInv].FirstDisp = 0;
// TODO: Slider, Scrolling
- fillInInventory();
+ FillInInventory();
}
-void Dialogs::positionInventory(OBJECT *pMultiObj, int xOffset, int yOffset, int zPosition) {
+void Dialogs::PositionInventory(OBJECT *pMultiObj, int xOffset, int yOffset, int zPosition) {
MultiSetAniXYZ(pMultiObj, _invD[_activeInv].inventoryX + xOffset, _invD[_activeInv].inventoryY + yOffset, zPosition);
}
@@ -2855,19 +2827,19 @@ SysReel GetSysReelForMenu(int menuId) {
}
}
-void Dialogs::constructConversationInventory() {
- warning("TODO: Complete implementation of constructConversationInventory");
- constructInventoryCommon(SysReel::CONVERSATION_FRAME, true);
+void Dialogs::ConstructConversationInventory() {
+ warning("TODO: Complete implementation of ConstructConversationInventory");
+ ConstructInventoryCommon(SysReel::CONVERSATION_FRAME, true);
}
-void Dialogs::constructOtherInventory(int menuId) {
- warning("TODO: Complete implementation of constructOtherInventory");
+void Dialogs::ConstructOtherInventory(int menuId) {
+ warning("TODO: Complete implementation of ConstructOtherInventory");
SysReel reel = GetSysReelForMenu(menuId);
- constructInventoryCommon(reel, true);
+ ConstructInventoryCommon(reel, true);
if (cd.bExtraWin) {
warning("TODO: Complete scrollbar implementation");
- SCNHANDLE sliderReel = _vm->_systemReel->get(SysReel::SLIDER);
+ SCNHANDLE sliderReel = _vm->_systemReel->Get(SysReel::SLIDER);
const FILM *pfilm = (const FILM *)_vm->_handle->LockMem(sliderReel);
_objArray[3] = _slideObject = InsertReelObj(pfilm->reels);
MultiSetAniXYZ(_slideObject,
@@ -2875,7 +2847,7 @@ void Dialogs::constructOtherInventory(int menuId) {
_sliderYpos,
Z_INV_MFRAME - 1);
}
- addBoxes(true);
+ AddBoxes(true);
}
@@ -2883,7 +2855,7 @@ void Dialogs::constructOtherInventory(int menuId) {
* Construct an inventory window - either a standard one, with
* background, slider and icons, or a re-sizing window.
*/
-void Dialogs::constructInventory(InventoryType filling) {
+void Dialogs::ConstructInventory(InventoryType filling) {
int eH, eV; // Extra width and height
int n = 0; // Index into object array
int zpos; // Z-position of frame
@@ -2942,44 +2914,44 @@ void Dialogs::constructInventory(InventoryType filling) {
}
// Draw the four corners
- retObj[n] = addObject(&pfilm->reels[_TL], _TL);
+ retObj[n] = AddObject(&pfilm->reels[_TL], _TL);
MultiSetAniXYZ(retObj[n], invX, invY, zpos);
n++;
- retObj[n] = addObject(&pfilm->reels[_TR], _TR);
+ retObj[n] = AddObject(&pfilm->reels[_TR], _TR);
MultiSetAniXYZ(retObj[n], invX + _TLwidth + eH, invY, zpos);
n++;
- retObj[n] = addObject(&pfilm->reels[_BL], _BL);
+ retObj[n] = AddObject(&pfilm->reels[_BL], _BL);
MultiSetAniXYZ(retObj[n], invX, invY + _TLheight + eV, zpos);
n++;
- retObj[n] = addObject(&pfilm->reels[_BR], _BR);
+ retObj[n] = AddObject(&pfilm->reels[_BR], _BR);
MultiSetAniXYZ(retObj[n], invX + _TLwidth + eH, invY + _TLheight + eV, zpos);
n++;
// Draw extra Top and bottom parts
if (_invD[_activeInv].NoofHicons > 1) {
// Top side
- retObj[n] = addObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth, invY + NM_TBT, zpos);
n++;
// Bottom of header box
if (filling == FULL) {
if (TinselVersion >= 2) {
- retObj[n] = addObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth, invY + NM_TBB, zpos);
n++;
} else {
- retObj[n] = addObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth, invY + M_TBB + 1, zpos);
n++;
// Extra bits for conversation - hopefully temporary
if (_activeInv == INV_CONV) {
- retObj[n] = addObject(&pfilm->reels[IX_H26], -1);
+ retObj[n] = AddObject(&pfilm->reels[IX_H26], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth - 2, invY + M_TBB + 1, zpos);
n++;
- retObj[n] = addObject(&pfilm->reels[IX_H52], -1);
+ retObj[n] = AddObject(&pfilm->reels[IX_H52], -1);
MultiSetAniXYZ(retObj[n], invX + eH - 10, invY + M_TBB + 1, zpos);
n++;
}
@@ -2987,7 +2959,7 @@ void Dialogs::constructInventory(InventoryType filling) {
}
// Bottom side
- retObj[n] = addObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[hFillers[_invD[_activeInv].NoofHicons - 2]], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth, invY + _TLheight + eV + _BLheight + NM_BSY, zpos);
n++;
}
@@ -2997,12 +2969,12 @@ void Dialogs::constructInventory(InventoryType filling) {
offx = _TLwidth;
// Top side extra
- retObj[n] = addObject(&pfilm->reels[IX_H26], -1);
+ retObj[n] = AddObject(&pfilm->reels[IX_H26], -1);
MultiSetAniXYZ(retObj[n], invX + offx, invY + NM_TBT, zpos);
n++;
// Bottom side extra
- retObj[n] = addObject(&pfilm->reels[IX_H26], -1);
+ retObj[n] = AddObject(&pfilm->reels[IX_H26], -1);
MultiSetAniXYZ(retObj[n], invX + offx, invY + _TLheight + eV + _BLheight + NM_BSY, zpos);
n++;
}
@@ -3010,13 +2982,13 @@ void Dialogs::constructInventory(InventoryType filling) {
// Draw extra side parts
if (_invD[_activeInv].NoofVicons > 1) {
// Left side
- retObj[n] = addObject(&pfilm->reels[vFillers[_invD[_activeInv].NoofVicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[vFillers[_invD[_activeInv].NoofVicons - 2]], -1);
MultiSetAniXYZ(retObj[n], invX + NM_LSX, invY + _TLheight, zpos);
n++;
// Left side of scroll bar
if (filling == FULL && _activeInv != INV_CONV) {
- retObj[n] = addObject(&pfilm->reels[vFillers[_invD[_activeInv].NoofVicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[vFillers[_invD[_activeInv].NoofVicons - 2]], -1);
if (TinselVersion >= 2)
MultiSetAniXY(retObj[n], invX + _TLwidth + eH + _TRwidth + NM_SBL, invY + _TLheight);
else
@@ -3026,7 +2998,7 @@ void Dialogs::constructInventory(InventoryType filling) {
}
// Right side
- retObj[n] = addObject(&pfilm->reels[vFillers[_invD[_activeInv].NoofVicons - 2]], -1);
+ retObj[n] = AddObject(&pfilm->reels[vFillers[_invD[_activeInv].NoofVicons - 2]], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth + eH + _TRwidth + NM_RSX, invY + _TLheight, zpos);
n++;
}
@@ -3037,12 +3009,12 @@ void Dialogs::constructInventory(InventoryType filling) {
offy = minAmount;
// Left side extra
- retObj[n] = addObject(&pfilm->reels[IX_V26], -1);
+ retObj[n] = AddObject(&pfilm->reels[IX_V26], -1);
MultiSetAniXYZ(retObj[n], invX + NM_LSX, invY + offy, zpos);
n++;
// Right side extra
- retObj[n] = addObject(&pfilm->reels[IX_V26], -1);
+ retObj[n] = AddObject(&pfilm->reels[IX_V26], -1);
MultiSetAniXYZ(retObj[n], invX + _TLwidth + eH + _TRwidth + NM_RSX, invY + offy, zpos);
n++;
}
@@ -3054,8 +3026,8 @@ void Dialogs::constructInventory(InventoryType filling) {
bounds.bottom = _TLheight + eV + _BLheight + NM_BG_SIZ_Y;
// Draw background, slider and icons
if ((TinselVersion >= 2) && (filling != EMPTY)) {
- addBackground(&retObj[n++], bounds);
- addTitle(&retObj[n++], bounds);
+ AddBackground(&retObj[n++], bounds);
+ AddTitle(&retObj[n++], bounds);
}
if (filling == FULL) {
@@ -3063,7 +3035,7 @@ void Dialogs::constructInventory(InventoryType filling) {
rect = &retObj[n++];
title = &retObj[n++];
- addBackground(rect, bounds, title, FROM_HANDLE);
+ AddBackground(rect, bounds, title, FROM_HANDLE);
}
if (_activeInv == INV_CONV) {
@@ -3074,37 +3046,37 @@ void Dialogs::constructInventory(InventoryType filling) {
// Make sure it's big enough for the heading
if (MultiLeftmost(retObj[n - 1]) < _invD[INV_CONV].inventoryX + 10) {
_invD[INV_CONV].NoofHicons++;
- constructInventory(FULL);
+ ConstructInventory(FULL);
}
}
} else if (_invD[_activeInv].NoofItems > _invD[_activeInv].NoofHicons * _invD[_activeInv].NoofVicons) {
_sliderYmin = _TLheight - ((TinselVersion >= 2) ? 1 : 2);
_sliderYmax = _TLheight + eV + ((TinselVersion >= 2) ? 12 : 10);
- addSlider(&retObj[n++], pfilm);
+ AddSlider(&retObj[n++], pfilm);
}
- fillInInventory();
+ FillInInventory();
} else if (filling == CONF) {
if (TinselVersion <= 1) {
rect = &retObj[n++];
title = &retObj[n++];
- addBackground(rect, bounds, title, FROM_STRING);
+ AddBackground(rect, bounds, title, FROM_STRING);
if (cd.bExtraWin)
- n += addExtraWindow(invX, invY, &retObj[n]);
+ n += AddExtraWindow(invX, invY, &retObj[n]);
} else {
if (cd.bExtraWin)
- addExtraWindow(invX, invY, &retObj[n]);
+ AddExtraWindow(invX, invY, &retObj[n]);
}
- addBoxes(true);
+ AddBoxes(true);
}
assert(n < MAX_WCOMP); // added more parts than we can handle!
// Reposition returns true if needs to move
- if (_invD[_activeInv].bMoveable && filling == FULL && rePosition()) {
- constructInventory(FULL);
+ if (_invD[_activeInv].bMoveable && filling == FULL && RePosition()) {
+ ConstructInventory(FULL);
}
}
@@ -3113,7 +3085,7 @@ void Dialogs::constructInventory(InventoryType filling) {
* position of the Translucent object is within limits. If it isn't,
* adjusts the x/y position of the current inventory and returns true.
*/
-bool Dialogs::rePosition() {
+bool Dialogs::RePosition() {
int p;
bool bMoveitMoveit = false;
@@ -3157,10 +3129,10 @@ bool Dialogs::rePosition() {
* Get the cursor's reel, poke in the background palette,
* and customise the cursor.
*/
-void Dialogs::alterCursor(int num) {
+void Dialogs::AlterCursor(int num) {
const FILM *pFilm = (const FILM *)_vm->_handle->LockMem(_hWinParts);
const FREEL *pfr = (const FREEL *)&pFilm->reels[num];
- const MULTI_INIT *pmi = pfr->GetMultiInit();
+ const MULTI_INIT *pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfr->mobj));
PokeInPalette(pmi);
@@ -3168,9 +3140,9 @@ void Dialogs::alterCursor(int num) {
}
/**
- * invCursor
+ * InvCursor
*/
-void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
+void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
int area; // The part of the window the cursor is over
bool restoreMain = false;
@@ -3181,17 +3153,17 @@ void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
switch (fn) {
case IC_DROP:
_invCursor = IC_NORMAL;
- invCursor(IC_AREA, CurX, CurY);
+ InvCursor(IC_AREA, CurX, CurY);
break;
case IC_AREA:
- area = invArea(CurX, CurY);
+ area = InvArea(CurX, CurY);
// Check for POINTED events
if (_activeInv == INV_CONF)
- invBoxes(area == I_BODY, CurX, CurY);
+ InvBoxes(area == I_BODY, CurX, CurY);
else
- invLabels(area == I_BODY, CurX, CurY);
+ InvLabels(area == I_BODY, CurX, CurY);
// No cursor trails while within inventory window
if (area == I_NOTIN)
@@ -3209,7 +3181,7 @@ void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
if (!_invD[_activeInv].resizable)
restoreMain = true;
else if (_invCursor != IC_DR) {
- alterCursor(IX_CURDD);
+ AlterCursor(IX_CURDD);
_invCursor = IC_DR;
}
break;
@@ -3219,7 +3191,7 @@ void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
if (!_invD[_activeInv].resizable)
restoreMain = true;
else if (_invCursor != IC_UR) {
- alterCursor(IX_CURDU);
+ AlterCursor(IX_CURDU);
_invCursor = IC_UR;
}
break;
@@ -3231,7 +3203,7 @@ void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
break;
}
if (_invCursor != IC_TB) {
- alterCursor(IX_CURUD);
+ AlterCursor(IX_CURUD);
_invCursor = IC_TB;
}
break;
@@ -3241,7 +3213,7 @@ void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
if (!_invD[_activeInv].resizable)
restoreMain = true;
else if (_invCursor != IC_LR) {
- alterCursor(IX_CURLR);
+ AlterCursor(IX_CURLR);
_invCursor = IC_LR;
}
break;
@@ -3277,7 +3249,7 @@ void Dialogs::invCursor(InvCursorFN fn, int CurX, int CurY) {
/******************** Conversation specific functions *********************/
/**************************************************************************/
-void Dialogs::convAction(int index) {
+void Dialogs::ConvAction(int index) {
assert(_activeInv == INV_CONV); // not conv. window!
MOVER *pMover = (TinselVersion >= 2) ? GetMover(_vm->_actor->GetLeadId()) : NULL;
@@ -3326,7 +3298,7 @@ void Dialogs::convAction(int index) {
*
* Note: ano may (will probably) be set when it's a polygon.
*/
-void Dialogs::setConvDetails(CONV_PARAM fn, HPOLYGON hPoly, int ano) {
+void Dialogs::SetConvDetails(CONV_PARAM fn, HPOLYGON hPoly, int ano) {
_thisConvFn = fn;
_thisConvPoly = hPoly;
_thisConvActor = ano;
@@ -3347,7 +3319,7 @@ void Dialogs::setConvDetails(CONV_PARAM fn, HPOLYGON hPoly, int ano) {
/**
* Add an icon to the permanent conversation list.
*/
-void Dialogs::permaConvIcon(int icon, bool bEnd) {
+void Dialogs::PermaConvIcon(int icon, bool bEnd) {
int i;
// See if it's already there
@@ -3385,21 +3357,21 @@ void Dialogs::convPos(int fn) {
_invD[INV_CONV].inventoryY = 150;
}
-void Dialogs::convPoly(HPOLYGON hPoly) {
+void Dialogs::ConvPoly(HPOLYGON hPoly) {
_thisConvPoly = hPoly;
}
-int Dialogs::getIcon() {
+int Dialogs::GetIcon() {
return _thisIcon;
}
-void Dialogs::closeDownConv() {
+void Dialogs::CloseDownConv() {
if (_inventoryState == ACTIVE_INV && _activeInv == INV_CONV) {
- killInventory();
+ KillInventory();
}
}
-void Dialogs::hideConversation(bool bHide) {
+void Dialogs::HideConversation(bool bHide) {
int aniX, aniY;
int i;
@@ -3417,14 +3389,14 @@ void Dialogs::hideConversation(bool bHide) {
_InventoryHidden = true;
// Remove any labels
- invLabels(false, 0, 0);
+ InvLabels(false, 0, 0);
} else {
// Window is not hidden
_InventoryHidden = false;
if ((TinselVersion >= 2) && _ItemsChanged)
// Just rebuild the whole thing
- constructInventory(FULL);
+ ConstructInventory(FULL);
else {
// Move it all back on-screen
for (i = 0; i < MAX_WCOMP && _objArray[i]; i++) {
@@ -3546,12 +3518,12 @@ void Dialogs::hideConversation(bool bHide) {
}
_vm->_cursor->GetCursorXY(&aniX, &aniY, false);
- invLabels(true, aniX, aniY);
+ InvLabels(true, aniX, aniY);
}
}
}
-bool Dialogs::convIsHidden() {
+bool Dialogs::ConvIsHidden() {
return _InventoryHidden;
}
@@ -3562,7 +3534,7 @@ bool Dialogs::convIsHidden() {
/**
* Start up an inventory window.
*/
-void Dialogs::popUpInventory(int invno, int menuId) {
+void Dialogs::PopUpInventory(int invno, int menuId) {
assert(invno == INV_1 || invno == INV_2 || invno == INV_CONV || invno == INV_CONF || invno == INV_MENU); // Trying to open illegal inventory
if (_inventoryState == IDLE_INV) {
@@ -3600,29 +3572,29 @@ void Dialogs::popUpInventory(int invno, int menuId) {
if (TinselVersion == 3) {
switch (invno) {
case INV_CONV:
- constructConversationInventory();
+ ConstructConversationInventory();
break;
case INV_1:
case INV_2:
case INV_3:
case INV_4:
- constructMainInventory();
+ ConstructMainInventory();
break;
default: // Should be menu.
- constructOtherInventory(menuId);
+ ConstructOtherInventory(menuId);
break;
}
} else {
if (invno != INV_CONF) // Configuration window?
- constructInventory(FULL); // Draw it up
+ ConstructInventory(FULL); // Draw it up
else {
- constructInventory(CONF); // Draw it up
+ ConstructInventory(CONF); // Draw it up
}
}
}
}
-void Dialogs::setMenuGlobals(CONFINIT *ci) {
+void Dialogs::SetMenuGlobals(CONFINIT *ci) {
if (TinselVersion < 3) {
_invD[INV_CONF].MinHicons = _invD[INV_CONF].MaxHicons = _invD[INV_CONF].NoofHicons = ci->h;
_invD[INV_CONF].MaxVicons = _invD[INV_CONF].MinVicons = _invD[INV_CONF].NoofVicons = ci->v;
@@ -3645,7 +3617,7 @@ void Dialogs::setMenuGlobals(CONFINIT *ci) {
/**
* PopupConf
*/
-void Dialogs::openMenu(CONFTYPE menuType) {
+void Dialogs::OpenMenu(CONFTYPE menuType) {
int curX, curY;
// In the DW 1 demo, don't allow any menu to be opened
@@ -3660,22 +3632,22 @@ void Dialogs::openMenu(CONFTYPE menuType) {
switch (menuType) {
case MAIN_MENU:
- setMenuGlobals(&ciOption);
+ SetMenuGlobals(&ciOption);
break;
case SAVE_MENU:
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true); // Show VK when saving a game
if (TinselVersion <= 1)
_vm->_cursor->SetCursorScreenXY(262, 91);
- setMenuGlobals(&ciSave);
+ SetMenuGlobals(&ciSave);
cd.editableRgroup = true;
- firstFile(0);
+ FirstFile(0);
break;
case LOAD_MENU:
- setMenuGlobals(&ciLoad);
+ SetMenuGlobals(&ciLoad);
cd.editableRgroup = false;
- firstFile(0);
+ FirstFile(0);
break;
case RESTART_MENU:
@@ -3686,7 +3658,7 @@ void Dialogs::openMenu(CONFTYPE menuType) {
else
_vm->_cursor->SetCursorScreenXY(180, 90);
- setMenuGlobals(&ciRestart);
+ SetMenuGlobals(&ciRestart);
break;
case SOUND_MENU:
@@ -3712,7 +3684,7 @@ void Dialogs::openMenu(CONFTYPE menuType) {
t1SoundBox[2].ival = &_vm->_config->_voiceVolume;
}
#endif
- setMenuGlobals(&ciSound);
+ SetMenuGlobals(&ciSound);
break;
case CONTROLS_MENU:
@@ -3721,7 +3693,7 @@ void Dialogs::openMenu(CONFTYPE menuType) {
controlBox[0].ival = &_vm->_config->_dclickSpeed;
controlBox[2].ival = &_vm->_config->_swapButtons;
#endif
- setMenuGlobals(&ciControl);
+ SetMenuGlobals(&ciControl);
break;
case QUIT_MENU:
@@ -3732,22 +3704,22 @@ void Dialogs::openMenu(CONFTYPE menuType) {
else
_vm->_cursor->SetCursorScreenXY(180, 90);
- setMenuGlobals(&ciQuit);
+ SetMenuGlobals(&ciQuit);
break;
case HOPPER_MENU1:
- primeSceneHopper();
- setMenuGlobals(&ciHopper1);
+ PrimeSceneHopper();
+ SetMenuGlobals(&ciHopper1);
cd.editableRgroup = false;
- rememberChosenScene();
- firstScene(0);
+ RememberChosenScene();
+ FirstScene(0);
break;
case HOPPER_MENU2:
- setMenuGlobals(&ciHopper2);
+ SetMenuGlobals(&ciHopper2);
cd.editableRgroup = false;
- setChosenScene();
- firstEntry(0);
+ SetChosenScene();
+ FirstEntry(0);
break;
case SUBTITLES_MENU: {
@@ -3779,13 +3751,13 @@ void Dialogs::openMenu(CONFTYPE menuType) {
ciSubtitles.Box[hackOffset + 1].ival = &_vm->_config->_useSubtitles;
#endif
- setMenuGlobals(&ciSubtitles);
+ SetMenuGlobals(&ciSubtitles);
} break;
case TOP_WINDOW:
- setMenuGlobals(&ciTopWin);
+ SetMenuGlobals(&ciTopWin);
_activeInv = INV_CONF;
- constructInventory(CONF); // Draw it up
+ ConstructInventory(CONF); // Draw it up
_inventoryState = BOGUS_INV;
return;
@@ -3796,39 +3768,39 @@ void Dialogs::openMenu(CONFTYPE menuType) {
if (_heldItem != INV_NOICON)
_vm->_cursor->DelAuxCursor(); // no longer aux cursor
- popUpInventory(INV_CONF, menuType);
+ PopUpInventory(INV_CONF, menuType);
// Make initial box selections if appropriate
if (menuType == SAVE_MENU || menuType == LOAD_MENU || menuType == HOPPER_MENU1 || menuType == HOPPER_MENU2)
- select(0, false);
+ Select(0, false);
else if (menuType == SUBTITLES_MENU) {
if (_vm->getFeatures() & GF_USE_3FLAGS) {
// VERY quick dirty bodges
if (_vm->_config->_language == TXT_FRENCH)
- select(0, false);
+ Select(0, false);
else if (_vm->_config->_language == TXT_GERMAN)
- select(1, false);
+ Select(1, false);
else
- select(2, false);
+ Select(2, false);
} else if (_vm->getFeatures() & GF_USE_4FLAGS) {
- select(_vm->_config->_language - 1, false);
+ Select(_vm->_config->_language - 1, false);
} else if (_vm->getFeatures() & GF_USE_5FLAGS) {
- select(_vm->_config->_language, false);
+ Select(_vm->_config->_language, false);
}
}
_vm->_cursor->GetCursorXY(&curX, &curY, false);
- invCursor(IC_AREA, curX, curY);
+ InvCursor(IC_AREA, curX, curY);
}
/**
* Close down an inventory window.
*/
-void Dialogs::killInventory() {
+void Dialogs::KillInventory() {
if (_objArray[0] != NULL) {
- dumpObjArray();
- dumpDobjArray();
- dumpIconArray();
+ DumpObjArray();
+ DumpDobjArray();
+ DumpIconArray();
}
if (_inventoryState == ACTIVE_INV) {
@@ -3846,13 +3818,13 @@ void Dialogs::killInventory() {
if (_reOpenMenu) {
_reOpenMenu = false;
- openMenu(MAIN_MENU);
+ OpenMenu(MAIN_MENU);
// Write config changes
_vm->_config->writeToDisk();
} else if (_activeInv == INV_CONF)
- inventoryIconCursor(false);
+ InventoryIconCursor(false);
if (TinselVersion >= 2)
// Pump up the volume
@@ -3862,7 +3834,7 @@ void Dialogs::killInventory() {
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false); // Hide VK after save dialog closes
}
-void Dialogs::closeInventory() {
+void Dialogs::CloseInventory() {
// If not active, ignore this
if (_inventoryState != ACTIVE_INV)
return;
@@ -3873,9 +3845,9 @@ void Dialogs::closeInventory() {
// If conversation, this is a closeing event
if (_activeInv == INV_CONV)
- convAction(INV_CLOSEICON);
+ ConvAction(INV_CLOSEICON);
- killInventory();
+ KillInventory();
_vm->_cursor->RestoreMainCursor();
}
@@ -3888,7 +3860,7 @@ void Dialogs::closeInventory() {
* Appears to find the nearest entry in slideStuff[] to the supplied
* y-coordinate.
*/
-int Dialogs::nearestSlideY(int fity) {
+int Dialogs::NearestSlideY(int fity) {
int nearDist = 1000;
int thisDist;
int nearI = 0; // Index of nearest fit
@@ -3908,7 +3880,7 @@ int Dialogs::nearestSlideY(int fity) {
* Gets called at the start and end of a drag on the slider, and upon
* y-movement during such a drag.
*/
-void Dialogs::slideSlider(int y, SSFN fn) {
+void Dialogs::SlideSlider(int y, SSFN fn) {
static int newY = 0, lasti = 0; // FIXME: Avoid non-const global vars
int gotoY, ati;
@@ -3919,7 +3891,7 @@ void Dialogs::slideSlider(int y, SSFN fn) {
switch (fn) {
case S_START: // Start of a drag on the slider
newY = _sliderYpos;
- lasti = nearestSlideY(_sliderYpos);
+ lasti = NearestSlideY(_sliderYpos);
break;
case S_SLIDE: // Y-movement during drag
@@ -3937,7 +3909,7 @@ void Dialogs::slideSlider(int y, SSFN fn) {
_sliderYpos = gotoY;
// Re-draw icons if necessary
- ati = nearestSlideY(_sliderYpos);
+ ati = NearestSlideY(_sliderYpos);
if (ati != lasti) {
_invD[_activeInv].FirstDisp = _slideStuff[ati].n;
assert(_invD[_activeInv].FirstDisp >= 0); // negative first displayed
@@ -3948,7 +3920,7 @@ void Dialogs::slideSlider(int y, SSFN fn) {
case S_END: // End of a drag on the slider
// Draw icons from new start icon
- ati = nearestSlideY(_sliderYpos);
+ ati = NearestSlideY(_sliderYpos);
_invD[_activeInv].FirstDisp = _slideStuff[ati].n;
_ItemsChanged = true;
break;
@@ -3962,7 +3934,7 @@ void Dialogs::slideSlider(int y, SSFN fn) {
* Gets called at the start and end of a drag on the slider, and upon
* y-movement during such a drag.
*/
-void Dialogs::slideCSlider(int y, SSFN fn) {
+void Dialogs::SlideCSlider(int y, SSFN fn) {
static int newY = 0; // FIXME: Avoid non-const global vars
int gotoY;
int fc;
@@ -3994,16 +3966,16 @@ void Dialogs::slideCSlider(int y, SSFN fn) {
fc = cd.extraBase;
if ((cd.box == saveBox || cd.box == loadBox))
- firstFile((_sliderYpos - _sliderYmin) * (MAX_SAVED_FILES - NUM_RGROUP_BOXES) /
- (_sliderYmax - _sliderYmin));
+ FirstFile((_sliderYpos - _sliderYmin) * (MAX_SAVED_FILES - NUM_RGROUP_BOXES) /
+ (_sliderYmax - _sliderYmin));
else if (cd.box == hopperBox1)
- firstScene((_sliderYpos - _sliderYmin) * (_numScenes - NUM_RGROUP_BOXES) / sliderRange);
+ FirstScene((_sliderYpos - _sliderYmin) * (_numScenes - NUM_RGROUP_BOXES) / sliderRange);
else if (cd.box == hopperBox2)
- firstEntry((_sliderYpos - _sliderYmin) * (_numEntries - NUM_RGROUP_BOXES) / sliderRange);
+ FirstEntry((_sliderYpos - _sliderYmin) * (_numEntries - NUM_RGROUP_BOXES) / sliderRange);
// If extraBase has changed...
if (fc != cd.extraBase) {
- addBoxes(false);
+ AddBoxes(false);
fc -= cd.extraBase;
cd.selBox += fc;
@@ -4013,7 +3985,7 @@ void Dialogs::slideCSlider(int y, SSFN fn) {
else if (cd.selBox >= NUM_RGROUP_BOXES)
cd.selBox = NUM_RGROUP_BOXES - 1;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
break;
@@ -4029,7 +4001,7 @@ void Dialogs::slideCSlider(int y, SSFN fn) {
* Gets called at the start and end of a drag on a mixing desk slider,
* and upon x-movement during such a drag.
*/
-void Dialogs::slideMSlider(int x, SSFN fn) {
+void Dialogs::SlideMSlider(int x, SSFN fn) {
static int newX = 0; // FIXME: Avoid non-const global vars
int gotoX;
int index, i;
@@ -4102,9 +4074,9 @@ void Dialogs::slideMSlider(int x, SSFN fn) {
break;
case S_END: // End of a drag on the slider
- addBoxes(false); // Might change position slightly
+ AddBoxes(false); // Might change position slightly
if (_activeInv == INV_CONF && cd.box == subtitlesBox)
- select(_vm->_config->_language, false);
+ Select(_vm->_config->_language, false);
break;
default:
@@ -4113,9 +4085,9 @@ void Dialogs::slideMSlider(int x, SSFN fn) {
}
/**
- * Called from changeingSize() during re-sizing.
+ * Called from ChangeingSize() during re-sizing.
*/
-void Dialogs::gettingTaller() {
+void Dialogs::GettingTaller() {
if (_SuppV) {
_yChange += _SuppV;
if (_yCompensate == 'T')
@@ -4137,9 +4109,9 @@ void Dialogs::gettingTaller() {
}
/**
- * Called from changeingSize() during re-sizing.
+ * Called from ChangeingSize() during re-sizing.
*/
-void Dialogs::gettingShorter() {
+void Dialogs::GettingShorter() {
int StartNvi = _invD[_activeInv].NoofVicons;
int StartUv = _SuppV;
@@ -4162,9 +4134,9 @@ void Dialogs::gettingShorter() {
}
/**
- * Called from changeingSize() during re-sizing.
+ * Called from ChangeingSize() during re-sizing.
*/
-void Dialogs::gettingWider() {
+void Dialogs::GettingWider() {
int StartNhi = _invD[_activeInv].NoofHicons;
int StartUh = _SuppH;
@@ -4185,9 +4157,9 @@ void Dialogs::gettingWider() {
}
/**
- * Called from changeingSize() during re-sizing.
+ * Called from ChangeingSize() during re-sizing.
*/
-void Dialogs::gettingNarrower() {
+void Dialogs::GettingNarrower() {
int StartNhi = _invD[_activeInv].NoofHicons;
int StartUh = _SuppH;
@@ -4210,28 +4182,28 @@ void Dialogs::gettingNarrower() {
}
/**
- * Called from xMovement()/yMovement() during re-sizing.
+ * Called from Xmovement()/Ymovement() during re-sizing.
*/
-void Dialogs::changeingSize() {
+void Dialogs::ChangeingSize() {
/* Make it taller or shorter if necessary. */
if (_yChange > 0)
- gettingTaller();
+ GettingTaller();
else if (_yChange < 0)
- gettingShorter();
+ GettingShorter();
/* Make it wider or narrower if necessary. */
if (_xChange > 0)
- gettingWider();
+ GettingWider();
else if (_xChange < 0)
- gettingNarrower();
+ GettingNarrower();
- constructInventory(EMPTY);
+ ConstructInventory(EMPTY);
}
/**
* Called from cursor module when cursor moves while inventory is up.
*/
-void Dialogs::xMovement(int x) {
+void Dialogs::Xmovement(int x) {
int aniX, aniY;
int i;
@@ -4251,23 +4223,23 @@ void Dialogs::xMovement(int x) {
case ID_TLEFT:
case ID_BLEFT:
_xChange -= x;
- changeingSize();
+ ChangeingSize();
break;
case ID_RIGHT:
case ID_TRIGHT:
case ID_BRIGHT:
_xChange += x;
- changeingSize();
+ ChangeingSize();
break;
case ID_NONE:
_vm->_cursor->GetCursorXY(&aniX, &aniY, false);
- invCursor(IC_AREA, aniX, aniY);
+ InvCursor(IC_AREA, aniX, aniY);
break;
case ID_MDCONT:
- slideMSlider(x, S_SLIDE);
+ SlideMSlider(x, S_SLIDE);
break;
default:
@@ -4279,7 +4251,7 @@ void Dialogs::xMovement(int x) {
/**
* Called from cursor module when cursor moves while inventory is up.
*/
-void Dialogs::yMovement(int y) {
+void Dialogs::Ymovement(int y) {
int aniX, aniY;
int i;
@@ -4296,30 +4268,30 @@ void Dialogs::yMovement(int y) {
break;
case ID_SLIDE:
- slideSlider(y, S_SLIDE);
+ SlideSlider(y, S_SLIDE);
break;
case ID_CSLIDE:
- slideCSlider(y, S_SLIDE);
+ SlideCSlider(y, S_SLIDE);
break;
case ID_BOTTOM:
case ID_BLEFT:
case ID_BRIGHT:
_yChange += y;
- changeingSize();
+ ChangeingSize();
break;
case ID_TOP:
case ID_TLEFT:
case ID_TRIGHT:
_yChange -= y;
- changeingSize();
+ ChangeingSize();
break;
case ID_NONE:
_vm->_cursor->GetCursorXY(&aniX, &aniY, false);
- invCursor(IC_AREA, aniX, aniY);
+ InvCursor(IC_AREA, aniX, aniY);
break;
default:
@@ -4331,7 +4303,7 @@ void Dialogs::yMovement(int y) {
/**
* Called when a drag is commencing.
*/
-void Dialogs::invDragStart() {
+void Dialogs::InvDragStart() {
int curX, curY; // cursor's animation position
_vm->_cursor->GetCursorXY(&curX, &curY, false);
@@ -4342,15 +4314,15 @@ void Dialogs::invDragStart() {
if (_activeInv == INV_CONF) {
int whichbox;
- whichbox = whichMenuBox(curX, curY, true);
+ whichbox = WhichMenuBox(curX, curY, true);
if (whichbox == IB_SLIDE) {
_invDragging = ID_CSLIDE;
- slideCSlider(0, S_START);
+ SlideCSlider(0, S_START);
} else if (whichbox > 0 && (whichbox & IS_MASK)) {
_invDragging = ID_MDCONT; // Mixing desk control
cd.selBox = whichbox;
- slideMSlider(0, S_START);
+ SlideMSlider(0, S_START);
}
return;
}
@@ -4358,7 +4330,7 @@ void Dialogs::invDragStart() {
/*
* Normal operation
*/
- switch (invArea(curX, curY)) {
+ switch (InvArea(curX, curY)) {
case I_HEADER:
if (_invD[_activeInv].bMoveable) {
_invDragging = ID_MOVE;
@@ -4367,7 +4339,7 @@ void Dialogs::invDragStart() {
case I_SLIDE:
_invDragging = ID_SLIDE;
- slideSlider(0, S_START);
+ SlideSlider(0, S_START);
break;
case I_BOTTOM:
@@ -4450,25 +4422,25 @@ void Dialogs::invDragStart() {
/**
* Called when a drag is over.
*/
-void Dialogs::invDragEnd() {
+void Dialogs::InvDragEnd() {
int curX, curY; // cursor's animation position
_vm->_cursor->GetCursorXY(&curX, &curY, false);
if (_invDragging != ID_NONE) {
if (_invDragging == ID_SLIDE) {
- slideSlider(0, S_END);
+ SlideSlider(0, S_END);
} else if (_invDragging == ID_CSLIDE) {
; // No action
} else if (_invDragging == ID_MDCONT) {
- slideMSlider(0, S_END);
+ SlideMSlider(0, S_END);
} else if (_invDragging == ID_MOVE) {
; // No action
} else {
// Were re-sizing. Redraw the whole thing.
- dumpDobjArray();
- dumpObjArray();
- constructInventory(FULL);
+ DumpDobjArray();
+ DumpObjArray();
+ ConstructInventory(FULL);
// If this was the maximised, it no longer is!
if (_InventoryMaximised) {
@@ -4483,83 +4455,83 @@ void Dialogs::invDragEnd() {
}
// Cursor could well now be inappropriate
- invCursor(IC_AREA, curX, curY);
+ InvCursor(IC_AREA, curX, curY);
_xChange = _yChange = 0; // Probably no need, but does no harm!
}
-bool Dialogs::menuDown(int lines) {
+bool Dialogs::MenuDown(int lines) {
if (cd.box == loadBox || cd.box == saveBox) {
if (cd.extraBase < MAX_SAVED_FILES - NUM_RGROUP_BOXES) {
- firstFile(cd.extraBase + lines);
- addBoxes(true);
+ FirstFile(cd.extraBase + lines);
+ AddBoxes(true);
return true;
}
} else if (cd.box == hopperBox1) {
if (cd.extraBase < _numScenes - NUM_RGROUP_BOXES) {
- firstScene(cd.extraBase + lines);
- addBoxes(true);
+ FirstScene(cd.extraBase + lines);
+ AddBoxes(true);
return true;
}
} else if (cd.box == hopperBox2) {
if (cd.extraBase < _numEntries - NUM_RGROUP_BOXES) {
- firstEntry(cd.extraBase + lines);
- addBoxes(true);
+ FirstEntry(cd.extraBase + lines);
+ AddBoxes(true);
return true;
}
}
return false;
}
-bool Dialogs::menuUp(int lines) {
+bool Dialogs::MenuUp(int lines) {
if (cd.extraBase > 0) {
if (cd.box == loadBox || cd.box == saveBox)
- firstFile(cd.extraBase - lines);
+ FirstFile(cd.extraBase - lines);
else if (cd.box == hopperBox1)
- firstScene(cd.extraBase - lines);
+ FirstScene(cd.extraBase - lines);
else if (cd.box == hopperBox2)
- firstEntry(cd.extraBase - lines);
+ FirstEntry(cd.extraBase - lines);
else
return false;
- addBoxes(true);
+ AddBoxes(true);
return true;
}
return false;
}
-void Dialogs::menuRollDown() {
- if (menuDown(1)) {
+void Dialogs::MenuRollDown() {
+ if (MenuDown(1)) {
if (cd.selBox > 0)
cd.selBox--;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
}
-void Dialogs::menuRollUp() {
- if (menuUp(1)) {
+void Dialogs::MenuRollUp() {
+ if (MenuUp(1)) {
if (cd.selBox < NUM_RGROUP_BOXES - 1)
cd.selBox++;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
}
-void Dialogs::menuPageDown() {
- if (menuDown(NUM_RGROUP_BOXES - 1)) {
+void Dialogs::MenuPageDown() {
+ if (MenuDown(NUM_RGROUP_BOXES - 1)) {
cd.selBox = NUM_RGROUP_BOXES - 1;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
}
-void Dialogs::menuPageUp() {
- if (menuUp(NUM_RGROUP_BOXES - 1)) {
+void Dialogs::MenuPageUp() {
+ if (MenuUp(NUM_RGROUP_BOXES - 1)) {
cd.selBox = 0;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
}
-void Dialogs::inventoryDown() {
- // This code is a copy of the IB_SLIDE_DOWN case in invWalkTo
+void Dialogs::InventoryDown() {
+ // This code is a copy of the IB_SLIDE_DOWN case in InvWalkTo
// TODO: So share this duplicate code
if (_invD[_activeInv].NoofVicons == 1)
if (_invD[_activeInv].FirstDisp + _invD[_activeInv].NoofHicons * _invD[_activeInv].NoofVicons < _invD[_activeInv].NoofItems)
@@ -4571,8 +4543,8 @@ void Dialogs::inventoryDown() {
_ItemsChanged = true;
}
-void Dialogs::inventoryUp() {
- // This code is a copy of the I_SLIDE_UP case in invWalkTo
+void Dialogs::InventoryUp() {
+ // This code is a copy of the I_SLIDE_UP case in InvWalkTo
// TODO: So share this duplicate code
if (_invD[_activeInv].NoofVicons == 1)
_invD[_activeInv].FirstDisp -= _invD[_activeInv].NoofHicons;
@@ -4588,16 +4560,16 @@ void Dialogs::inventoryUp() {
/**************************************************************************/
/**
- * menuAction
+ * MenuAction
*/
-void Dialogs::menuAction(int i, bool dbl) {
+void Dialogs::MenuAction(int i, bool dbl) {
if (i >= 0) {
switch (cd.box[i].boxType) {
case FLIP:
if (dbl) {
*(cd.box[i].ival) ^= 1; // XOR with true
- addBoxes(false);
+ AddBoxes(false);
}
break;
@@ -4616,36 +4588,36 @@ void Dialogs::menuAction(int i, bool dbl) {
// Already highlighted
switch (cd.box[i].boxFunc) {
case SAVEGAME:
- killInventory();
- invSaveGame();
+ KillInventory();
+ InvSaveGame();
break;
case LOADGAME:
- killInventory();
- invLoadGame();
+ KillInventory();
+ InvLoadGame();
break;
case HOPPER2:
- killInventory();
- openMenu(HOPPER_MENU2);
+ KillInventory();
+ OpenMenu(HOPPER_MENU2);
break;
case BF_CHANGESCENE:
- killInventory();
- hopAction();
- freeSceneHopper();
+ KillInventory();
+ HopAction();
+ FreeSceneHopper();
break;
default:
break;
}
} else {
- select(i, false);
+ Select(i, false);
}
break;
case FRGROUP:
if (dbl) {
- select(i, false);
- languageChange();
+ Select(i, false);
+ LanguageChange();
} else {
- select(i, false);
+ Select(i, false);
}
break;
@@ -4665,11 +4637,11 @@ void Dialogs::menuAction(int i, bool dbl) {
break;
}
} else {
- confActionSpecial(i);
+ ConfActionSpecial(i);
}
}
-void Dialogs::confActionSpecial(int i) {
+void Dialogs::ConfActionSpecial(int i) {
switch (i) {
case IB_NONE:
default:
@@ -4677,58 +4649,58 @@ void Dialogs::confActionSpecial(int i) {
case IB_UP: // Scroll up
if (cd.extraBase > 0) {
if ((cd.box == loadBox) || (cd.box == saveBox))
- firstFile(cd.extraBase - 1);
+ FirstFile(cd.extraBase - 1);
else if (cd.box == hopperBox1)
- firstScene(cd.extraBase - 1);
+ FirstScene(cd.extraBase - 1);
else if (cd.box == hopperBox2)
- firstEntry(cd.extraBase - 1);
+ FirstEntry(cd.extraBase - 1);
- addBoxes(true);
+ AddBoxes(true);
if (cd.selBox < NUM_RGROUP_BOXES - 1)
cd.selBox += 1;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
break;
case IB_DOWN: // Scroll down
if ((cd.box == loadBox) || (cd.box == saveBox)) {
if (cd.extraBase < MAX_SAVED_FILES - NUM_RGROUP_BOXES) {
- firstFile(cd.extraBase + 1);
- addBoxes(true);
+ FirstFile(cd.extraBase + 1);
+ AddBoxes(true);
if (cd.selBox)
cd.selBox -= 1;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
} else if (cd.box == hopperBox1) {
if (cd.extraBase < _numScenes - NUM_RGROUP_BOXES) {
- firstScene(cd.extraBase + 1);
- addBoxes(true);
+ FirstScene(cd.extraBase + 1);
+ AddBoxes(true);
if (cd.selBox)
cd.selBox -= 1;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
} else if (cd.box == hopperBox2) {
if (cd.extraBase < _numEntries - NUM_RGROUP_BOXES) {
- firstEntry(cd.extraBase + 1);
- addBoxes(true);
+ FirstEntry(cd.extraBase + 1);
+ AddBoxes(true);
if (cd.selBox)
cd.selBox -= 1;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
}
}
break;
case IB_SLIDE_UP:
- menuPageUp();
+ MenuPageUp();
break;
case IB_SLIDE_DOWN:
- menuPageDown();
+ MenuPageDown();
break;
}
}
// SLIDE_UP and SLIDE_DOWN on d click??????
-void Dialogs::invPutDown(int index) {
+void Dialogs::InvPutDown(int index) {
int aniX, aniY;
// index is the drop position
int hiIndex; // Current position of held item (if in)
@@ -4751,8 +4723,8 @@ void Dialogs::invPutDown(int index) {
_invD[_activeInv].NoofItems++;
// Don't leave it in the other inventory!
- if (inventoryPos(_heldItem) != INV_HELDNOTIN)
- remFromInventory(_activeInv == INV_1 ? INV_2 : INV_1, _heldItem);
+ if (InventoryPos(_heldItem) != INV_HELDNOTIN)
+ RemFromInventory(_activeInv == INV_1 ? INV_2 : INV_1, _heldItem);
} else {
// No room at the inn!
return;
@@ -4775,10 +4747,10 @@ void Dialogs::invPutDown(int index) {
_vm->_cursor->DelAuxCursor();
_vm->_cursor->RestoreMainCursor();
_vm->_cursor->GetCursorXY(&aniX, &aniY, false);
- invCursor(IC_DROP, aniX, aniY);
+ InvCursor(IC_DROP, aniX, aniY);
}
-void Dialogs::invPickup(int index) {
+void Dialogs::InvPickup(int index) {
// Do nothing if not clicked on anything
if (index == NOOBJECT)
return;
@@ -4787,7 +4759,7 @@ void Dialogs::invPickup(int index) {
if (_heldItem == INV_NOICON && _invD[_activeInv].contents[index] &&
((TinselVersion <= 1) || _invD[_activeInv].contents[index] != _heldItem)) {
// Pick-up
- auto invObj = getInvObject(_invD[_activeInv].contents[index]);
+ auto invObj = GetInvObject(_invD[_activeInv].contents[index]);
_thisIcon = _invD[_activeInv].contents[index];
if (TinselVersion >= 2)
InvTinselEvent(invObj, PICKUP, INV_PICKUP, index);
@@ -4796,7 +4768,7 @@ void Dialogs::invPickup(int index) {
} else if (_heldItem != INV_NOICON) {
// Put-down
- auto invObj = getInvObject(_heldItem);
+ auto invObj = GetInvObject(_heldItem);
// If DROPCODE set, send event, otherwise it's a putdown
if (invObj->hasAttribute(InvObjAttr::IO_DROPCODE) && invObj->getScript())
@@ -4804,7 +4776,7 @@ void Dialogs::invPickup(int index) {
else if (!(invObj->hasAttribute(InvObjAttr::IO_ONLYINV1) && _activeInv != INV_1) && !(invObj->hasAttribute(InvObjAttr::IO_ONLYINV2) && _activeInv != INV_2)) {
if (TinselVersion >= 2)
- invPutDown(index);
+ InvPutDown(index);
else
CoroScheduler.createProcess(PID_TCODE, InvPdProcess, &index, sizeof(index));
}
@@ -4814,16 +4786,16 @@ void Dialogs::invPickup(int index) {
/**
* Handle WALKTO event (Pick up/put down event)
*/
-void Dialogs::invWalkTo(const Common::Point &coOrds) {
+void Dialogs::InvWalkTo(const Common::Point &coOrds) {
int i;
- switch (invArea(coOrds.x, coOrds.y)) {
+ switch (InvArea(coOrds.x, coOrds.y)) {
case I_NOTIN:
if (_activeInv == INV_CONV)
- convAction(INV_CLOSEICON);
+ ConvAction(INV_CLOSEICON);
if ((cd.box == hopperBox1) || (cd.box == hopperBox2))
- freeSceneHopper();
- killInventory();
+ FreeSceneHopper();
+ KillInventory();
break;
case I_SLIDE_UP:
@@ -4864,32 +4836,32 @@ void Dialogs::invWalkTo(const Common::Point &coOrds) {
case I_BODY:
if (_activeInv == INV_CONF) {
if (!_InventoryHidden)
- menuAction(whichMenuBox(coOrds.x, coOrds.y, false), false);
+ MenuAction(WhichMenuBox(coOrds.x, coOrds.y, false), false);
} else {
Common::Point pt = coOrds;
- i = invItem(pt, false);
+ i = InvItem(pt, false);
// To cater for drop in dead space between icons,
// look 1 pixel right, then 1 down, then 1 right and down.
if (i == INV_NOICON && _heldItem != INV_NOICON &&
(_activeInv == INV_1 || _activeInv == INV_2)) {
pt.x += 1; // 1 to the right
- i = invItem(pt, false);
+ i = InvItem(pt, false);
if (i == INV_NOICON) {
pt.x -= 1; // 1 down
pt.y += 1;
- i = invItem(pt, false);
+ i = InvItem(pt, false);
if (i == INV_NOICON) {
pt.x += 1; // 1 down-right
- i = invItem(pt, false);
+ i = InvItem(pt, false);
}
}
}
if (_activeInv == INV_CONV) {
- convAction(i);
+ ConvAction(i);
} else
- invPickup(i);
+ InvPickup(i);
}
break;
@@ -4898,7 +4870,7 @@ void Dialogs::invWalkTo(const Common::Point &coOrds) {
}
}
-void Dialogs::invAction() {
+void Dialogs::InvAction() {
int index;
const InventoryObject *invObj;
int aniX, aniY;
@@ -4906,19 +4878,19 @@ void Dialogs::invAction() {
_vm->_cursor->GetCursorXY(&aniX, &aniY, false);
- switch (invArea(aniX, aniY)) {
+ switch (InvArea(aniX, aniY)) {
case I_BODY:
if (_activeInv == INV_CONF) {
if (!_InventoryHidden)
- menuAction(whichMenuBox(aniX, aniY, false), true);
+ MenuAction(WhichMenuBox(aniX, aniY, false), true);
} else if (_activeInv == INV_CONV) {
- index = invItem(&aniX, &aniY, false);
- convAction(index);
+ index = InvItem(&aniX, &aniY, false);
+ ConvAction(index);
} else {
- index = invItem(&aniX, &aniY, false);
+ index = InvItem(&aniX, &aniY, false);
if (index != INV_NOICON) {
if (_invD[_activeInv].contents[index] && _invD[_activeInv].contents[index] != _heldItem) {
- invObj = getInvObject(_invD[_activeInv].contents[index]);
+ invObj = GetInvObject(_invD[_activeInv].contents[index]);
if (TinselVersion >= 2)
_thisIcon = _invD[_activeInv].contents[index];
if ((TinselVersion >= 2) || (invObj->getScript()))
@@ -4959,9 +4931,9 @@ void Dialogs::invAction() {
}
// Delete current, and re-draw
- dumpDobjArray();
- dumpObjArray();
- constructInventory(FULL);
+ DumpDobjArray();
+ DumpObjArray();
+ ConstructInventory(FULL);
break;
case I_UP:
@@ -4982,16 +4954,16 @@ void Dialogs::invAction() {
}
}
-void Dialogs::invLook(const Common::Point &coOrds) {
+void Dialogs::InvLook(const Common::Point &coOrds) {
int index;
Common::Point pt = coOrds;
- switch (invArea(pt.x, pt.y)) {
+ switch (InvArea(pt.x, pt.y)) {
case I_BODY:
- index = invItem(pt, false);
+ index = InvItem(pt, false);
if (index != INV_NOICON) {
if (_invD[_activeInv].contents[index] && _invD[_activeInv].contents[index] != _heldItem) {
- auto invObj = getInvObject(_invD[_activeInv].contents[index]);
+ auto invObj = GetInvObject(_invD[_activeInv].contents[index]);
if (invObj->getScript())
InvTinselEvent(invObj, LOOK, INV_LOOK, index);
}
@@ -5000,8 +4972,8 @@ void Dialogs::invLook(const Common::Point &coOrds) {
case I_NOTIN:
if (_activeInv == INV_CONV)
- convAction(INV_CLOSEICON);
- killInventory();
+ ConvAction(INV_CLOSEICON);
+ KillInventory();
break;
default:
@@ -5013,98 +4985,90 @@ void Dialogs::invLook(const Common::Point &coOrds) {
/********************* Incoming events ************************************/
/**************************************************************************/
-void Dialogs::eventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds) {
+void Dialogs::EventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds) {
if (_InventoryHidden)
return;
- if (TinselVersion == 3) {
- // If the Notebook handles the event, it has been consumed.
- if (_vm->_notebook->handleEvent(pEvent, coOrds)) {
- return;
- }
- }
-
switch (pEvent) {
case PLR_PROV_WALKTO:
- if (menuActive()) {
+ if (MenuActive()) {
ProcessedProvisional();
- invWalkTo(coOrds);
+ InvWalkTo(coOrds);
}
break;
case PLR_WALKTO: // PLR_SLEFT
- invWalkTo(coOrds);
+ InvWalkTo(coOrds);
break;
case INV_LOOK: // PLR_SRIGHT
- if (menuActive())
- invWalkTo(coOrds);
+ if (MenuActive())
+ InvWalkTo(coOrds);
else
- invLook(coOrds);
+ InvLook(coOrds);
break;
case PLR_ACTION: // PLR_DLEFT
if (_invDragging != ID_MDCONT)
- invDragEnd();
- invAction();
+ InvDragEnd();
+ InvAction();
break;
case PLR_DRAG1_START: // Left drag start
- if (TinselVersion < 3 || _inventoryState == ACTIVE_INV) // inventoryActive, but not Notebook
- invDragStart();
+ InvDragStart();
break;
case PLR_DRAG1_END: // Left drag end
- invDragEnd();
+ InvDragEnd();
break;
case PLR_ESCAPE:
- if (menuActive()) {
+ if (MenuActive()) {
if (cd.box != optionBox && cd.box != hopperBox1 && cd.box != hopperBox2)
_reOpenMenu = true;
if ((cd.box == hopperBox1) || (cd.box == hopperBox2))
- freeSceneHopper();
+ FreeSceneHopper();
}
- closeInventory();
+ CloseInventory();
break;
case PLR_PGDN:
if (_activeInv == INV_MENU) {
// Load or Save screen
- menuPageDown();
+ MenuPageDown();
} else {
// Inventory window
- inventoryDown();
+ InventoryDown();
}
break;
case PLR_PGUP:
if (_activeInv == INV_MENU) {
// Load or Save screen
- menuPageUp();
+ MenuPageUp();
} else {
// Inventory window
- inventoryUp();
+ InventoryUp();
}
break;
case PLR_WHEEL_DOWN:
if (_activeInv == INV_MENU) {
// Load or Save screen
- menuRollDown();
+ MenuRollDown();
} else {
// Inventory window
- inventoryDown();
+ InventoryDown();
}
break;
case PLR_WHEEL_UP:
if (_activeInv == INV_MENU) {
// Load or Save screen
- menuRollUp();
+ MenuRollUp();
} else {
// Inventory window
- inventoryUp();
+ InventoryUp();
}
break;
@@ -5112,17 +5076,17 @@ void Dialogs::eventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds) {
if (_activeInv == INV_MENU) {
// Load or Save screen
if (cd.box == loadBox || cd.box == saveBox)
- firstFile(0);
+ FirstFile(0);
else if (cd.box == hopperBox1)
- firstScene(0);
+ FirstScene(0);
else if (cd.box == hopperBox2)
- firstEntry(0);
+ FirstEntry(0);
else
break;
- addBoxes(true);
+ AddBoxes(true);
cd.selBox = 0;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
} else {
// Inventory window
_invD[_activeInv].FirstDisp = 0;
@@ -5134,17 +5098,17 @@ void Dialogs::eventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds) {
if (_activeInv == INV_MENU) {
// Load or Save screen
if (cd.box == loadBox || cd.box == saveBox)
- firstFile(MAX_SAVED_FILES); // Will get reduced to appropriate value
+ FirstFile(MAX_SAVED_FILES); // Will get reduced to appropriate value
else if (cd.box == hopperBox1)
- firstScene(_numScenes); // Will get reduced to appropriate value
+ FirstScene(_numScenes); // Will get reduced to appropriate value
else if (cd.box == hopperBox2)
- firstEntry(_numEntries); // Will get reduced to appropriate value
+ FirstEntry(_numEntries); // Will get reduced to appropriate value
else
break;
- addBoxes(true);
+ AddBoxes(true);
cd.selBox = 0;
- select(cd.selBox, true);
+ Select(cd.selBox, true);
} else {
// Inventory window
_invD[_activeInv].FirstDisp = _invD[_activeInv].NoofItems - _invD[_activeInv].NoofHicons * _invD[_activeInv].NoofVicons;
@@ -5162,21 +5126,13 @@ void Dialogs::eventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds) {
/************************* Odds and Ends **********************************/
/**************************************************************************/
-const FILM *Dialogs::getObjectFilm(int object) const {
- return (const FILM*)_vm->_handle->LockMem(_invFilms[getObjectIndex(object)]);
-}
-
/**
* Called from Glitter function invdepict()
* Changes (permanently) the animation film for that object.
*/
-void Dialogs::setObjectFilm(int object, SCNHANDLE hFilm) {
+void Dialogs::SetObjectFilm(int object, SCNHANDLE hFilm) {
_invObjects->SetObjectFilm(object, hFilm);
- if (TinselVersion == 3) {
- _invFilms[getObjectIndex(object)] = hFilm;
- }
-
if (_heldItem != object)
_ItemsChanged = true;
}
@@ -5217,18 +5173,6 @@ void Dialogs::syncInvInfo(Common::Serializer &s) {
}
}
-// Let the debugger know all the available clues.
-Common::Array<int> Dialogs::getAllNotebookClues() const {
- Common::Array<int> clues;
- for (int i = 0; i < _invObjects->numObjects(); i++) {
- auto obj = _invObjects->GetObjectByIndex(i);
- if (obj->hasAttribute(InvObjAttr::NOTEBOOK_CLUE)) {
- clues.push_back(obj->getId());
- }
- }
- return clues;
-}
-
/**************************************************************************/
/************************ Initialisation stuff ****************************/
/**************************************************************************/
@@ -5238,7 +5182,7 @@ Common::Array<int> Dialogs::getAllNotebookClues() const {
* its id, animation film and Glitter script.
*/
// Note: the SCHANDLE type here has been changed to a void*
-void Dialogs::registerIcons(void *cptr, int num) {
+void Dialogs::RegisterIcons(void *cptr, int num) {
int numObjects = num;
_invObjects = InstantiateInventoryObjects((const byte*)cptr, numObjects);
if (TinselVersion >= 2) {
@@ -5257,7 +5201,7 @@ void Dialogs::registerIcons(void *cptr, int num) {
for (int i = 0; i < numObjects; i++) {
auto pio = _invObjects->GetObjectByIndex(i);
if (pio->hasAttribute(InvObjAttr::PERMACONV))
- permaConvIcon(pio->getId(), pio->hasAttribute(InvObjAttr::CONVENDITEM));
+ PermaConvIcon(pio->getId(), pio->hasAttribute(InvObjAttr::CONVENDITEM));
_invFilms[i] = pio->getIconFilm();
}
@@ -5431,7 +5375,7 @@ void Dialogs::idec_invMain(SCNHANDLE text, int MaxContents) {
/**
* Called from Glitter function 'GetInvLimit()'
*/
-int Dialogs::invGetLimit(int invno) {
+int Dialogs::InvGetLimit(int invno) {
assert(invno == INV_1 || invno == INV_2); // only INV_1 and INV_2 supported
return _invD[invno].MaxInvObj;
@@ -5440,7 +5384,7 @@ int Dialogs::invGetLimit(int invno) {
/**
* Called from Glitter function 'SetInvLimit()'
*/
-void Dialogs::invSetLimit(int invno, int MaxContents) {
+void Dialogs::InvSetLimit(int invno, int MaxContents) {
assert(invno == INV_1 || invno == INV_2); // only INV_1 and INV_2 supported
assert(MaxContents >= _invD[invno].NoofItems); // can't reduce maximum contents below current contents
@@ -5453,7 +5397,7 @@ void Dialogs::invSetLimit(int invno, int MaxContents) {
/**
* Called from Glitter function 'SetInvSize()'
*/
-void Dialogs::invSetSize(int invno, int MinWidth, int MinHeight,
+void Dialogs::InvSetSize(int invno, int MinWidth, int MinHeight,
int StartWidth, int StartHeight, int MaxWidth, int MaxHeight) {
assert(invno == INV_1 || invno == INV_2); // only INV_1 and INV_2 supported
@@ -5480,114 +5424,114 @@ void Dialogs::invSetSize(int invno, int MinWidth, int MinHeight,
/**************************************************************************/
-bool Dialogs::isTopWindow() {
+bool Dialogs::IsTopWindow() {
return (_inventoryState == BOGUS_INV);
}
-bool Dialogs::menuActive() {
+bool Dialogs::MenuActive() {
return (_inventoryState == ACTIVE_INV && _activeInv == INV_CONF);
}
-bool Dialogs::isConvWindow() {
+bool Dialogs::IsConvWindow() {
return (_inventoryState == ACTIVE_INV && _activeInv == INV_CONV);
}
-void Dialogs::callFunction(BFUNC boxFunc) {
+void Dialogs::CallFunction(BFUNC boxFunc) {
switch (boxFunc) {
case SAVEGAME:
- killInventory();
- invSaveGame();
+ KillInventory();
+ InvSaveGame();
break;
case LOADGAME:
- killInventory();
- invLoadGame();
+ KillInventory();
+ InvLoadGame();
break;
case IQUITGAME:
_vm->quitGame();
break;
case CLOSEWIN:
- killInventory();
+ KillInventory();
if ((cd.box == hopperBox1) || (cd.box == hopperBox2))
- freeSceneHopper();
+ FreeSceneHopper();
break;
case OPENLOAD:
- killInventory();
- openMenu(LOAD_MENU);
+ KillInventory();
+ OpenMenu(LOAD_MENU);
break;
case OPENSAVE:
- killInventory();
- openMenu(SAVE_MENU);
+ KillInventory();
+ OpenMenu(SAVE_MENU);
break;
case OPENREST:
- killInventory();
- openMenu(RESTART_MENU);
+ KillInventory();
+ OpenMenu(RESTART_MENU);
break;
case OPENSOUND:
- killInventory();
- openMenu(SOUND_MENU);
+ KillInventory();
+ OpenMenu(SOUND_MENU);
break;
case OPENCONT:
- killInventory();
- openMenu(CONTROLS_MENU);
+ KillInventory();
+ OpenMenu(CONTROLS_MENU);
break;
#ifndef JAPAN
case OPENSUBT:
- killInventory();
- openMenu(SUBTITLES_MENU);
+ KillInventory();
+ OpenMenu(SUBTITLES_MENU);
break;
#endif
case OPENQUIT:
- killInventory();
- openMenu(QUIT_MENU);
+ KillInventory();
+ OpenMenu(QUIT_MENU);
break;
case INITGAME:
- killInventory();
+ KillInventory();
FnRestartGame();
break;
case CLANG:
- if (!languageChange())
- killInventory();
+ if (!LanguageChange())
+ KillInventory();
break;
case RLANG:
- killInventory();
+ KillInventory();
break;
case HOPPER2:
- _vm->_dialogs->killInventory();
- _vm->_dialogs->openMenu(HOPPER_MENU2);
+ _vm->_dialogs->KillInventory();
+ _vm->_dialogs->OpenMenu(HOPPER_MENU2);
break;
case BF_CHANGESCENE:
- _vm->_dialogs->killInventory();
- _vm->_dialogs->hopAction();
- _vm->_dialogs->freeSceneHopper();
+ _vm->_dialogs->KillInventory();
+ _vm->_dialogs->HopAction();
+ _vm->_dialogs->FreeSceneHopper();
break;
default:
break;
}
}
-const FILM *Dialogs::getWindowData() {
+const FILM *Dialogs::GetWindowData() {
return (const FILM *)_vm->_handle->LockMem(_hWinParts);
}
-void Dialogs::redraw() {
- if (displayObjectsActive()) {
- if (_ItemsChanged && !configurationIsActive() && !inventoryIsHidden()) {
- fillInInventory();
+void Dialogs::Redraw() {
+ if (DisplayObjectsActive()) {
+ if (_ItemsChanged && !ConfigurationIsActive() && !InventoryIsHidden()) {
+ FillInInventory();
// Needed when clicking on scroll bar.
int curX, curY;
_vm->_cursor->GetCursorXY(&curX, &curY, false);
- invCursor(IC_AREA, curX, curY);
+ InvCursor(IC_AREA, curX, curY);
_ItemsChanged = false;
}
- if (!configurationIsActive()) {
+ if (!ConfigurationIsActive()) {
for (int i = 0; i < MAX_ICONS; i++) {
if (_iconArray[i] != NULL)
StepAnimScript(&_iconAnims[i]);
}
}
- if (isMixingDeskControl()) {
+ if (IsMixingDeskControl()) {
// Mixing desk control
int sval, index, *pival;
@@ -5606,20 +5550,17 @@ void Dialogs::redraw() {
}
if (sval != *pival) {
- slideMSlider(0, (cd.selBox & IS_RIGHT) ? S_TIMEUP : S_TIMEDN);
+ SlideMSlider(0, (cd.selBox & IS_RIGHT) ? S_TIMEUP : S_TIMEDN);
}
}
}
- if (TinselVersion == 3) {
- _vm->_notebook->stepAnimScripts();
- }
}
// Noir
-bool Dialogs::isConvAndNotMove() {
+bool Dialogs::IsConvAndNotMove() {
// TODO: Ensure that the used global is correct
// If this is the right mapping, the variable is reversed in Noir
- return isConvWindow() && !_bMoveOnUnHide;
+ return IsConvWindow() && !_bMoveOnUnHide;
}
/**************************************************************************/
@@ -5640,7 +5581,7 @@ static void InvPdProcess(CORO_PARAM, const void *param) {
// get the stuff copied to process when it was created
const int *pindex = (const int *)param;
- _vm->_dialogs->invPutDown(*pindex);
+ _vm->_dialogs->InvPutDown(*pindex);
CORO_END_CODE;
}
@@ -5656,12 +5597,12 @@ static void ButtonPress(CORO_PARAM, CONFBOX *box) {
assert(box->boxType == AAGBUT || box->boxType == ARSGBUT);
// Replace highlight image with normal image
- pfilm = _vm->_dialogs->getWindowData();
+ pfilm = _vm->_dialogs->GetWindowData();
MultiDeleteObjectIfExists(FIELD_STATUS, &_vm->_dialogs->_iconArray[HL1]);
- pfilm = _vm->_dialogs->getWindowData();
- _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->addObject(&pfilm->reels[box->bi + NORMGRAPH], -1);
- MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1], _vm->_dialogs->currentInventoryX() + box->xpos,
- _vm->_dialogs->currentInventoryY() + box->ypos,
+ pfilm = _vm->_dialogs->GetWindowData();
+ _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->AddObject(&pfilm->reels[box->bi + NORMGRAPH], -1);
+ MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1], _vm->_dialogs->CurrentInventoryX() + box->xpos,
+ _vm->_dialogs->CurrentInventoryY() + box->ypos,
Z_INV_ICONS + 1);
// Hold normal image for 1 frame
@@ -5670,11 +5611,11 @@ static void ButtonPress(CORO_PARAM, CONFBOX *box) {
return;
// Replace normal image with depresses image
- pfilm = _vm->_dialogs->getWindowData();
+ pfilm = _vm->_dialogs->GetWindowData();
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _vm->_dialogs->_iconArray[HL1]);
- _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->addObject(&pfilm->reels[box->bi + DOWNGRAPH], -1);
- MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1], _vm->_dialogs->currentInventoryX() + box->xpos,
- _vm->_dialogs->currentInventoryY() + box->ypos,
+ _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->AddObject(&pfilm->reels[box->bi + DOWNGRAPH], -1);
+ MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1], _vm->_dialogs->CurrentInventoryX() + box->xpos,
+ _vm->_dialogs->CurrentInventoryY() + box->ypos,
Z_INV_ICONS + 1);
// Hold depressed image for 2 frames
@@ -5683,11 +5624,11 @@ static void ButtonPress(CORO_PARAM, CONFBOX *box) {
return;
// Replace depressed image with normal image
- pfilm = _vm->_dialogs->getWindowData();
+ pfilm = _vm->_dialogs->GetWindowData();
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_STATUS), _vm->_dialogs->_iconArray[HL1]);
- _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->addObject(&pfilm->reels[box->bi + NORMGRAPH], -1);
- MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1], _vm->_dialogs->currentInventoryX() + box->xpos,
- _vm->_dialogs->currentInventoryY() + box->ypos,
+ _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->AddObject(&pfilm->reels[box->bi + NORMGRAPH], -1);
+ MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1], _vm->_dialogs->CurrentInventoryX() + box->xpos,
+ _vm->_dialogs->CurrentInventoryY() + box->ypos,
Z_INV_ICONS + 1);
CORO_SLEEP(1);
@@ -5710,15 +5651,15 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
// Hold normal image for 1 frame
CORO_SLEEP(1);
- if (!_vm->_dialogs->inventoryIsActive())
+ if (!_vm->_dialogs->InventoryIsActive())
return;
// Add depressed image
- pfilm = _vm->_dialogs->getWindowData();
- _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->addObject(&pfilm->reels[box->bi + DOWNGRAPH], -1);
+ pfilm = _vm->_dialogs->GetWindowData();
+ _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->AddObject(&pfilm->reels[box->bi + DOWNGRAPH], -1);
MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1],
- _vm->_dialogs->currentInventoryX() + box->xpos,
- _vm->_dialogs->currentInventoryY() + box->ypos,
+ _vm->_dialogs->CurrentInventoryX() + box->xpos,
+ _vm->_dialogs->CurrentInventoryY() + box->ypos,
Z_INV_ICONS + 1);
// Hold depressed image for 1 frame
@@ -5729,18 +5670,18 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
// Toggle state
(*box->ival) = *(box->ival) ^ 1; // XOR with true
box->bi = *(box->ival) ? IX_TICK1 : IX_CROSS1;
- _vm->_dialogs->addBoxes(false);
+ _vm->_dialogs->AddBoxes(false);
// Keep highlight (e.g. flag)
if (cd.selBox != NOBOX)
- _vm->_dialogs->select(cd.selBox, true);
+ _vm->_dialogs->Select(cd.selBox, true);
// New state, depressed image
- pfilm = _vm->_dialogs->getWindowData();
+ pfilm = _vm->_dialogs->GetWindowData();
MultiDeleteObjectIfExists(FIELD_STATUS, &_vm->_dialogs->_iconArray[HL1]);
- _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->addObject(&pfilm->reels[box->bi + DOWNGRAPH], -1);
+ _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->AddObject(&pfilm->reels[box->bi + DOWNGRAPH], -1);
MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1],
- _vm->_dialogs->currentInventoryX() + box->xpos,
- _vm->_dialogs->currentInventoryY() + box->ypos,
+ _vm->_dialogs->CurrentInventoryX() + box->xpos,
+ _vm->_dialogs->CurrentInventoryY() + box->ypos,
Z_INV_ICONS + 1);
// Hold new depressed image for 1 frame
@@ -5753,16 +5694,16 @@ static void ButtonToggle(CORO_PARAM, CONFBOX *box) {
// Hold normal image for 1 frame
CORO_SLEEP(1);
- if (!_vm->_dialogs->inventoryIsActive())
+ if (!_vm->_dialogs->InventoryIsActive())
return;
// New state, highlighted
- pfilm = _vm->_dialogs->getWindowData();
+ pfilm = _vm->_dialogs->GetWindowData();
MultiDeleteObjectIfExists(FIELD_STATUS, &_vm->_dialogs->_iconArray[HL1]);
- _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->addObject(&pfilm->reels[box->bi + HIGRAPH], -1);
+ _vm->_dialogs->_iconArray[HL1] = _vm->_dialogs->AddObject(&pfilm->reels[box->bi + HIGRAPH], -1);
MultiSetAniXYZ(_vm->_dialogs->_iconArray[HL1],
- _vm->_dialogs->currentInventoryX() + box->xpos,
- _vm->_dialogs->currentInventoryY() + box->ypos,
+ _vm->_dialogs->CurrentInventoryX() + box->xpos,
+ _vm->_dialogs->CurrentInventoryY() + box->ypos,
Z_INV_ICONS + 1);
CORO_END_CODE;
@@ -5784,14 +5725,14 @@ extern void InventoryProcess(CORO_PARAM, const void *) {
while (1) {
CORO_SLEEP(1); // allow scheduling
- _vm->_dialogs->redraw();
+ _vm->_dialogs->Redraw();
if (_vm->_dialogs->_buttonEffect.bButAnim) {
assert(_vm->_dialogs->_buttonEffect.box);
if (_vm->_dialogs->_buttonEffect.press) {
if (_vm->_dialogs->_buttonEffect.box->boxType == AAGBUT || _vm->_dialogs->_buttonEffect.box->boxType == ARSGBUT)
CORO_INVOKE_1(ButtonPress, _vm->_dialogs->_buttonEffect.box);
- _vm->_dialogs->callFunction(_vm->_dialogs->_buttonEffect.box->boxFunc);
+ _vm->_dialogs->CallFunction(_vm->_dialogs->_buttonEffect.box->boxFunc);
} else
CORO_INVOKE_1(ButtonToggle, _vm->_dialogs->_buttonEffect.box);
@@ -5840,7 +5781,7 @@ static void ObjectProcess(CORO_PARAM, const void *param) {
CORO_SLEEP(1);
int x, y;
_vm->_cursor->GetCursorXY(&x, &y, false);
- if (_vm->_dialogs->invItemId(x, y) != to->pinvo->getId())
+ if (_vm->_dialogs->InvItemId(x, y) != to->pinvo->getId())
break;
// Fix the 'repeated pressing bug'
@@ -5861,7 +5802,7 @@ static void ObjectProcess(CORO_PARAM, const void *param) {
static void InvTinselEvent(const InventoryObject *pinvo, TINSEL_EVENT event, PLR_EVENT be, int index) {
OP_INIT to = {pinvo, event, be, 0};
- if (_vm->_dialogs->inventoryIsHidden() || ((TinselVersion >= 2) && !pinvo->getScript()))
+ if (_vm->_dialogs->InventoryIsHidden() || ((TinselVersion >= 2) && !pinvo->getScript()))
return;
_vm->_dialogs->_glitterIndex = index;
@@ -5880,7 +5821,7 @@ extern void ObjectEvent(CORO_PARAM, int objId, TINSEL_EVENT event, bool bWait, i
if (result)
*result = false;
- _ctx->pInvo = _vm->_dialogs->getInvObject(objId);
+ _ctx->pInvo = _vm->_dialogs->GetInvObject(objId);
if (!_ctx->pInvo->getScript())
return;
diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index de52cfd35a6..9bba1f88786 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -231,7 +231,7 @@ enum TM { TM_POINTER,
TM_UNK4,
TM_NONE };
-// For slideSlider() and similar
+// For SlideSlider() and similar
enum SSFN {
S_START,
S_SLIDE,
@@ -269,23 +269,23 @@ public:
Dialogs();
virtual ~Dialogs();
- void popUpInventory(int invno, int menuId = -1);
- void openMenu(CONFTYPE menuType);
+ void PopUpInventory(int invno, int menuId = -1);
+ void OpenMenu(CONFTYPE type);
- void xMovement(int x);
- void yMovement(int y);
+ void Xmovement(int x);
+ void Ymovement(int y);
- void eventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds);
+ void EventToInventory(PLR_EVENT pEvent, const Common::Point &coOrds);
- int whichItemHeld();
+ int WhichItemHeld();
- void holdItem(int item, bool bKeepFilm = false);
- void dropItem(int item);
- void clearInventory(int invno);
- void addToInventory(int invno, int icon, bool hold = false);
- bool remFromInventory(int invno, int icon);
+ void HoldItem(int item, bool bKeepFilm = false);
+ void DropItem(int item);
+ void ClearInventory(int invno);
+ void AddToInventory(int invno, int icon, bool hold = false);
+ bool RemFromInventory(int invno, int icon);
- void registerIcons(void *cptr, int num);
+ void RegisterIcons(void *cptr, int num);
void idec_convw(SCNHANDLE text, int MaxContents, int MinWidth, int MinHeight,
int StartWidth, int StartHeight, int MaxWidth, int MaxHeight);
@@ -295,81 +295,76 @@ public:
int StartWidth, int StartHeight, int MaxWidth, int MaxHeight);
// Noir
- Common::Array<int> getAllNotebookClues() const;
void idec_invMain(SCNHANDLE text, int MaxContents);
- bool inventoryActive();
- bool inventoryOrNotebookActive();
+ bool InventoryActive();
- void permaConvIcon(int icon, bool bEnd = false);
+ void PermaConvIcon(int icon, bool bEnd = false);
void convPos(int bpos);
- void convPoly(HPOLYGON hPoly);
- int getIcon();
- void closeDownConv();
- void hideConversation(bool hide);
- bool convIsHidden();
+ void ConvPoly(HPOLYGON hp);
+ int GetIcon();
+ void CloseDownConv();
+ void HideConversation(bool hide);
+ bool ConvIsHidden();
- void convAction(int index);
- void setConvDetails(CONV_PARAM fn, HPOLYGON hPoly, int ano);
- void inventoryIconCursor(bool bNewItem);
+ void ConvAction(int index);
+ void SetConvDetails(CONV_PARAM fn, HPOLYGON hPoly, int ano);
+ void InventoryIconCursor(bool bNewItem);
void setInvWinParts(SCNHANDLE hf);
void setFlagFilms(SCNHANDLE hf);
void setConfigStrings(SCNHANDLE *tp);
- int invItem(Common::Point &coOrds, bool update);
- int invItem(int *x, int *y, bool update);
- int invItemId(int x, int y);
+ int InvItem(Common::Point &coOrds, bool update);
+ int InvItem(int *x, int *y, bool update);
+ int InvItemId(int x, int y);
- int inventoryPos(int num);
+ int InventoryPos(int num);
- bool isInInventory(int object, int invnum);
+ bool IsInInventory(int object, int invnum);
- void killInventory();
+ void KillInventory();
void syncInvInfo(Common::Serializer &s);
- int invGetLimit(int invno);
- void invSetLimit(int invno, int MaxContents);
- void invSetSize(int invno, int MinWidth, int MinHeight,
+ int InvGetLimit(int invno);
+ void InvSetLimit(int invno, int n);
+ void InvSetSize(int invno, int MinWidth, int MinHeight,
int StartWidth, int StartHeight, int MaxWidth, int MaxHeight);
- bool getIsInvObject(int id);
-
- int whichInventoryOpen();
-
- bool isTopWindow();
- bool menuActive();
- bool isConvWindow();
-
- const FILM *getObjectFilm(int object) const;
- void setObjectFilm(int object, SCNHANDLE hFilm);
- void callFunction(BFUNC boxFunc);
-
- OBJECT *addObject(const FREEL *pfreel, int num);
- void invPutDown(int index);
- void slideMSlider(int x, SSFN fn);
- void addBoxes(bool posnSlide);
- void select(int i, bool force);
- void fillInInventory();
- void invCursor(InvCursorFN fn, int CurX, int CurY);
- const InventoryObject *getInvObject(int id);
- const InventoryObjectT3 *getInvObjectT3(int id);
- void invPointEvent(const InventoryObject *invObj, int index);
- bool updateString(const Common::KeyState &kbd);
- bool inventoryIsActive() { return _inventoryState == ACTIVE_INV; }
- bool isMixingDeskControl() { return _invDragging == ID_MDCONT; }
- int currentInventoryX() { return _invD[_activeInv].inventoryX; }
- int currentInventoryY() { return _invD[_activeInv].inventoryY; }
- bool configurationIsActive() { return _activeInv == INV_CONF; }
- bool displayObjectsActive() { return _objArray[0] != NULL; }
- bool inventoryIsHidden() { return _InventoryHidden; }
- const FILM *getWindowData();
- void redraw();
+ bool GetIsInvObject(int id);
+
+ int WhichInventoryOpen();
+
+ bool IsTopWindow();
+ bool MenuActive();
+ bool IsConvWindow();
+
+ void SetObjectFilm(int object, SCNHANDLE hFilm);
+ void CallFunction(BFUNC boxFunc);
+
+ OBJECT *AddObject(const FREEL *pfreel, int num);
+ void InvPutDown(int index);
+ void SlideMSlider(int x, SSFN fn);
+ void AddBoxes(bool posnSlide);
+ void Select(int i, bool force);
+ void FillInInventory();
+ void InvCursor(InvCursorFN fn, int CurX, int CurY);
+ const InventoryObject *GetInvObject(int id);
+ bool UpdateString(const Common::KeyState &kbd);
+ bool InventoryIsActive() { return _inventoryState == ACTIVE_INV; }
+ bool IsMixingDeskControl() { return _invDragging == ID_MDCONT; }
+ int CurrentInventoryX() { return _invD[_activeInv].inventoryX; }
+ int CurrentInventoryY() { return _invD[_activeInv].inventoryY; }
+ bool ConfigurationIsActive() { return _activeInv == INV_CONF; }
+ bool DisplayObjectsActive() { return _objArray[0] != NULL; }
+ bool InventoryIsHidden() { return _InventoryHidden; }
+ const FILM *GetWindowData();
+ void Redraw();
// Noir
- bool isConvAndNotMove();
+ bool IsConvAndNotMove();
bool _noLanguage;
int _glitterIndex;
@@ -381,67 +376,67 @@ public:
BUTTONEFFECT _buttonEffect;
private:
- int whichMenuBox(int curX, int curY, bool bSlides);
- void confActionSpecial(int i);
- bool rePosition();
- bool languageChange();
- void primeSceneHopper();
- void freeSceneHopper();
- void rememberChosenScene();
- void setChosenScene();
- void firstEntry(int first);
- void hopAction();
- void dumpIconArray();
- void dumpDobjArray();
- void dumpObjArray();
- void firstScene(int first);
- void firstFile(int first);
- int getObjectIndex(int id) const;
- void invSaveGame();
- void invLoadGame();
- int invArea(int x, int y);
- void invBoxes(bool InBody, int curX, int curY);
- void invLabels(bool InBody, int aniX, int aniY);
- void adjustTop();
- OBJECT *addInvObject(int num, const FREEL **pfreel, const FILM **pfilm);
- void addBackground(OBJECT **rect, const Common::Rect &bounds, OBJECT **title = nullptr, int textFrom = 0);
- void addTitle(OBJECT **title, const Common::Rect &rect);
- void addSlider(OBJECT **slide, const FILM *pfilm);
- void addBox(int *pi, const int i);
- void addEWSlider(OBJECT **slide, const FILM *pfilm);
- void positionInventory(OBJECT *pMultiObj, int xOffset, int yOffset, int zPosition);
- int addExtraWindow(int x, int y, OBJECT **retObj);
- void constructInventoryCommon(SysReel reel, bool hasTitle);
- void constructConversationInventory();
- void constructInventory(InventoryType filling);
- void constructOtherInventory(int menuId);
- void constructMainInventory();
- void alterCursor(int num);
- void setMenuGlobals(CONFINIT *ci);
- void closeInventory();
- int nearestSlideY(int fity);
- void slideSlider(int y, SSFN fn);
- void slideCSlider(int y, SSFN fn);
- void gettingTaller();
- void gettingShorter();
- void gettingWider();
- void gettingNarrower();
- void changeingSize();
- void invDragStart();
- void invDragEnd();
- bool menuDown(int lines);
- bool menuUp(int lines);
- void menuRollDown();
- void menuRollUp();
- void menuPageDown();
- void menuPageUp();
- void inventoryDown();
- void inventoryUp();
- void menuAction(int i, bool dbl);
- void invPickup(int index);
- void invWalkTo(const Common::Point &coOrds);
- void invAction();
- void invLook(const Common::Point &coOrds);
+ int WhichMenuBox(int curX, int curY, bool bSlides);
+ void ConfActionSpecial(int i);
+ bool RePosition();
+ bool LanguageChange();
+ void PrimeSceneHopper();
+ void FreeSceneHopper();
+ void RememberChosenScene();
+ void SetChosenScene();
+ void FirstEntry(int first);
+ void HopAction();
+ void DumpIconArray();
+ void DumpDobjArray();
+ void DumpObjArray();
+ void FirstScene(int first);
+ void FirstFile(int first);
+ int GetObjectIndex(int id);
+ void InvSaveGame();
+ void InvLoadGame();
+ int InvArea(int x, int y);
+ void InvBoxes(bool InBody, int curX, int curY);
+ void InvLabels(bool InBody, int aniX, int aniY);
+ void AdjustTop();
+ OBJECT *AddInvObject(int num, const FREEL **pfreel, const FILM **pfilm);
+ void AddBackground(OBJECT **rect, const Common::Rect &bounds, OBJECT **title = nullptr, int textFrom = 0);
+ void AddTitle(OBJECT **title, const Common::Rect &rect);
+ void AddSlider(OBJECT **slide, const FILM *pfilm);
+ void AddBox(int *pi, const int i);
+ void AddEWSlider(OBJECT **slide, const FILM *pfilm);
+ void PositionInventory(OBJECT *pMultiObj, int xOffset, int yOffset, int zPosition);
+ int AddExtraWindow(int x, int y, OBJECT **retObj);
+ void ConstructInventoryCommon(SysReel reel, bool hasTitle);
+ void ConstructConversationInventory();
+ void ConstructInventory(InventoryType filling);
+ void ConstructOtherInventory(int menuId);
+ void ConstructMainInventory();
+ void AlterCursor(int num);
+ void SetMenuGlobals(CONFINIT *ci);
+ void CloseInventory();
+ int NearestSlideY(int fity);
+ void SlideSlider(int y, SSFN fn);
+ void SlideCSlider(int y, SSFN fn);
+ void GettingTaller();
+ void GettingShorter();
+ void GettingWider();
+ void GettingNarrower();
+ void ChangeingSize();
+ void InvDragStart();
+ void InvDragEnd();
+ bool MenuDown(int lines);
+ bool MenuUp(int lines);
+ void MenuRollDown();
+ void MenuRollUp();
+ void MenuPageDown();
+ void MenuPageUp();
+ void InventoryDown();
+ void InventoryUp();
+ void MenuAction(int i, bool dbl);
+ void InvPickup(int index);
+ void InvWalkTo(const Common::Point &coOrds);
+ void InvAction();
+ void InvLook(const Common::Point &coOrds);
void idec_inv(int num, SCNHANDLE text, int MaxContents,
int MinWidth, int MinHeight,
int StartWidth, int StartHeight,
@@ -524,9 +519,9 @@ private:
CONV_PARAM _thisConvFn; // Top, 'Middle' or Bottom
HPOLYGON _thisConvPoly; // Conversation code is in a polygon code block
int _thisConvActor; // ...or an actor's code block.
- int _pointedIcon; // used by invLabels - icon pointed to on last call
- int _sX; // used by slideMSlider() - current x-coordinate
- int _lX; // used by slideMSlider() - last x-coordinate
+ int _pointedIcon; // used by InvLabels - icon pointed to on last call
+ int _sX; // used by SlideMSlider() - current x-coordinate
+ int _lX; // used by SlideMSlider() - last x-coordinate
bool _bMoveOnUnHide; // Set before start of conversation
// - causes conversation to be started in a sensible place
diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp
index 1ab7ef4ddde..f4923df7324 100644
--- a/engines/tinsel/drives.cpp
+++ b/engines/tinsel/drives.cpp
@@ -57,7 +57,7 @@ void CdCD(CORO_PARAM) {
while (g_bChangingCD) {
if (CoroScheduler.getCurrentProcess()) {
// FIXME: CdCD gets passed a Common::nullContext in RegisterGlobals() and
- // primeSceneHopper(), because I didn't know how to get a proper
+ // PrimeSceneHopper(), because I didn't know how to get a proper
// context without converting the whole calling stack to CORO'd
// functions. If these functions really get called while a CD
// change is requested, this needs to be resolved.
diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp
index 5c76aab7751..cbc51fa6fa9 100644
--- a/engines/tinsel/events.cpp
+++ b/engines/tinsel/events.cpp
@@ -160,7 +160,7 @@ void ControlOn() {
_vm->_cursor->UnHideCursor();
// Turn tags back on
- if (!_vm->_dialogs->inventoryOrNotebookActive())
+ if (!_vm->_dialogs->InventoryActive())
EnableTags();
}
}
@@ -399,18 +399,6 @@ void ProcessKeyEvent(PLR_EVENT ke) {
lastRealAction = DwGetCurrentTime(); \
}
-void CloseOpenInventories() {
- if (_vm->_notebook->isOpen()) {
- _vm->_notebook->close();
- } else {
- if (_vm->_dialogs->inventoryActive()) {
- if (_vm->_dialogs->whichInventoryOpen() != INV_3) {
- _vm->_dialogs->killInventory();
- }
- }
- }
-}
-
/**
* Main interface point for specifying player atcions
*/
@@ -445,55 +433,44 @@ void PlayerEvent(PLR_EVENT pEvent, const Common::Point &coOrds) {
if (!ControlIsOn() && (pEvent != PLR_DRAG1_END))
return;
- if ((TinselVersion >= 2) && _vm->_dialogs->inventoryOrNotebookActive()) {
+ if ((TinselVersion >= 2) && _vm->_dialogs->InventoryActive()) {
int x, y;
_vm->_bg->PlayfieldGetPos(FIELD_WORLD, &x, &y);
- _vm->_dialogs->eventToInventory(pEvent, Common::Point(coOrds.x - x, coOrds.y - y));
+ _vm->_dialogs->EventToInventory(pEvent, Common::Point(coOrds.x - x, coOrds.y - y));
return;
}
switch (pEvent) {
case PLR_QUIT:
- _vm->_dialogs->openMenu(QUIT_MENU);
+ _vm->_dialogs->OpenMenu(QUIT_MENU);
break;
case PLR_MENU:
- if (TinselVersion == 3) {
- CloseOpenInventories();
- }
- _vm->_dialogs->openMenu(MAIN_MENU);
+ _vm->_dialogs->OpenMenu(MAIN_MENU);
break;
case PLR_INVENTORY:
if (TinselVersion == 3) {
- CloseOpenInventories();
- _vm->_dialogs->popUpInventory(INV_1);
+ _vm->_dialogs->PopUpInventory(INV_1);
}
break;
case PLR_NOTEBOOK:
if (TinselVersion == 3) {
- CloseOpenInventories();
- _vm->_notebook->show(false);
+ _vm->_notebook->Show(false);
}
break;
case PLR_JUMP:
- _vm->_dialogs->openMenu(HOPPER_MENU1);
+ _vm->_dialogs->OpenMenu(HOPPER_MENU1);
break;
case PLR_SAVE:
- if (TinselVersion == 3) {
- CloseOpenInventories();
- }
- _vm->_dialogs->openMenu(SAVE_MENU);
+ _vm->_dialogs->OpenMenu(SAVE_MENU);
break;
case PLR_LOAD:
- if (TinselVersion == 3) {
- CloseOpenInventories();
- }
- _vm->_dialogs->openMenu(LOAD_MENU);
+ _vm->_dialogs->OpenMenu(LOAD_MENU);
break;
case PLR_PROV_WALKTO: // Provisional WALKTO !
@@ -503,33 +480,33 @@ void PlayerEvent(PLR_EVENT pEvent, const Common::Point &coOrds) {
case PLR_WALKTO:
REAL_ACTION_CHECK;
- if ((TinselVersion >= 2) || !_vm->_dialogs->inventoryActive())
+ if ((TinselVersion >= 2) || !_vm->_dialogs->InventoryActive())
ProcessUserEvent(WALKTO, coOrds, PLR_SLEFT);
else
- _vm->_dialogs->eventToInventory(PLR_SLEFT, coOrds);
+ _vm->_dialogs->EventToInventory(PLR_SLEFT, coOrds);
break;
case PLR_ACTION:
REAL_ACTION_CHECK;
- if ((TinselVersion >= 2) || !_vm->_dialogs->inventoryActive())
+ if ((TinselVersion >= 2) || !_vm->_dialogs->InventoryActive())
ProcessUserEvent(ACTION, coOrds, PLR_DLEFT);
else
- _vm->_dialogs->eventToInventory(PLR_DLEFT, coOrds);
+ _vm->_dialogs->EventToInventory(PLR_DLEFT, coOrds);
break;
case PLR_LOOK:
REAL_ACTION_CHECK;
- if ((TinselVersion >= 2) || !_vm->_dialogs->inventoryActive())
+ if ((TinselVersion >= 2) || !_vm->_dialogs->InventoryActive())
ProcessUserEvent(LOOK, coOrds, PLR_SRIGHT);
else
- _vm->_dialogs->eventToInventory(PLR_SRIGHT, coOrds);
+ _vm->_dialogs->EventToInventory(PLR_SRIGHT, coOrds);
break;
default:
- if (_vm->_dialogs->inventoryActive())
- _vm->_dialogs->eventToInventory(pEvent, coOrds);
+ if (_vm->_dialogs->InventoryActive())
+ _vm->_dialogs->EventToInventory(pEvent, coOrds);
break;
}
}
@@ -600,7 +577,7 @@ void PolyTinselProcess(CORO_PARAM, const void *param) {
// Take control for CONVERSE events
if (to->event == CONVERSE) {
_ctx->bTookControl = GetControl();
- _vm->_dialogs->hideConversation(true);
+ _vm->_dialogs->HideConversation(true);
} else
_ctx->bTookControl = false;
@@ -612,7 +589,7 @@ void PolyTinselProcess(CORO_PARAM, const void *param) {
if (_ctx->bTookControl)
ControlOn();
- _vm->_dialogs->hideConversation(false);
+ _vm->_dialogs->HideConversation(false);
}
} else {
@@ -632,7 +609,7 @@ void PolyTinselProcess(CORO_PARAM, const void *param) {
// Hide conversation if appropriate
if (to->event == CONVERSE)
- _vm->_dialogs->hideConversation(true);
+ _vm->_dialogs->HideConversation(true);
// Run the code
_ctx->pic = InitInterpretContext(GS_POLYGON, GetPolyScript(to->hPoly), to->event, to->hPoly, to->actor, NULL);
@@ -644,7 +621,7 @@ void PolyTinselProcess(CORO_PARAM, const void *param) {
// Restore conv window if applicable
if (to->event == CONVERSE)
- _vm->_dialogs->hideConversation(false);
+ _vm->_dialogs->HideConversation(false);
}
CORO_END_CODE;
diff --git a/engines/tinsel/film.cpp b/engines/tinsel/film.cpp
deleted file mode 100644
index 10a6f2d03fc..00000000000
--- a/engines/tinsel/film.cpp
+++ /dev/null
@@ -1,36 +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 3 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, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-#include "tinsel/film.h"
-#include "tinsel/handle.h"
-#include "tinsel/tinsel.h"
-
-namespace Tinsel {
-
-MULTI_INIT *FREEL::GetMultiInit() {
- return (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(mobj));
-}
-
-const MULTI_INIT *FREEL::GetMultiInit() const {
- return (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(mobj));
-}
-
-} // End of namespace Tinsel
diff --git a/engines/tinsel/film.h b/engines/tinsel/film.h
index 37d8621fc1b..74ac52245e5 100644
--- a/engines/tinsel/film.h
+++ b/engines/tinsel/film.h
@@ -28,13 +28,9 @@ namespace Tinsel {
#include "common/pack-start.h" // START STRUCT PACKING
-struct MULTI_INIT;
struct FREEL {
SCNHANDLE mobj;
SCNHANDLE script;
-
- MULTI_INIT *GetMultiInit();
- const MULTI_INIT *GetMultiInit() const;
} PACKED_STRUCT;
struct FILM {
diff --git a/engines/tinsel/inv_objects.cpp b/engines/tinsel/inv_objects.cpp
index 00082576da8..b754a76dcf2 100644
--- a/engines/tinsel/inv_objects.cpp
+++ b/engines/tinsel/inv_objects.cpp
@@ -29,19 +29,55 @@ InventoryObject::InventoryObject(Common::MemoryReadStreamEndian &stream) {
_id = stream.readUint32();
_hIconFilm = stream.readUint32();
_hScript = stream.readUint32();
- if (TinselVersion == 0) {
- _attribute = 0;
- } else {
+}
+
+int32 InventoryObject::getUnknown() const {
+ error("Querying Noir-value from non-Noir game");
+}
+
+int32 InventoryObject::getTitle() const {
+ error("Querying Noir-value from non-Noir game");
+}
+
+class InventoryObjectT1 : public InventoryObject {
+public:
+ InventoryObjectT1(Common::MemoryReadStreamEndian &stream) : InventoryObject(stream) {
_attribute = stream.readUint32();
}
-}
+ // Tinsel1+
+ virtual int32 getAttribute() const {
+ return _attribute;
+ };
+ static const int SIZE = InventoryObject::SIZE + 4;
+private:
+ int32 _attribute;
+};
+
+class InventoryObjectT3 : public InventoryObjectT1 {
+public:
+ InventoryObjectT3(Common::MemoryReadStreamEndian &stream) : InventoryObjectT1(stream) {
+ _unknown = stream.readUint32();
+ _title = stream.readUint32();
+ }
+ // Noir:
+ virtual int32 getUnknown() const {
+ return _unknown;
+ }
+ virtual int32 getTitle() const {
+ return _title;
+ }
+ static const int SIZE = InventoryObjectT1::SIZE + 8;
+private:
+ int32 _unknown;
+ int32 _title;
+};
template<typename T>
class InventoryObjectsImpl : public InventoryObjects {
public:
InventoryObjectsImpl(const byte *objects, int numObjects) {
bool bigEndian = (TinselV1Mac || TinselV1Saturn);
- auto stream = new Common::MemoryReadStreamEndian(objects, T::SIZE() * numObjects, bigEndian, DisposeAfterUse::NO);
+ auto stream = new Common::MemoryReadStreamEndian(objects, T::SIZE * numObjects, bigEndian, DisposeAfterUse::NO);
for (int i = 0; i < numObjects; i++) {
_objects.push_back(T(*stream));
}
@@ -49,24 +85,22 @@ public:
delete stream;
}
~InventoryObjectsImpl(){};
- const InventoryObject *GetInvObject(int id) override {
+ const InventoryObject *GetInvObject(int id) {
auto index = GetObjectIndexIfExists(id);
if (index != -1) {
return _objects.data() + index;
}
return nullptr;
}
- const InventoryObjectT3 *GetInvObjectT3(int id) override;
-
- const InventoryObject *GetObjectByIndex(int index) const override {
+ const InventoryObject *GetObjectByIndex(int index) const {
assert(index >= 0 && index < numObjects());
return _objects.data() + index;
}
- void SetObjectFilm(int id, SCNHANDLE hFilm) override {
+ void SetObjectFilm(int id, SCNHANDLE hFilm) {
int index = GetObjectIndexIfExists(id);
_objects[index].setIconFilm(hFilm);
}
- int GetObjectIndexIfExists(int id) const override {
+ int GetObjectIndexIfExists(int id) const {
for (uint i = 0; i < _objects.size(); i++) {
if (_objects[i].getId() == id) {
return i;
@@ -74,33 +108,21 @@ public:
}
return -1;
};
- int numObjects() const override {
+ int numObjects() const {
return _objects.size();
}
private:
Common::Array<T> _objects;
};
-template<>
-const InventoryObjectT3 *InventoryObjectsImpl<InventoryObjectT3>::GetInvObjectT3(int id) {
- auto index = GetObjectIndexIfExists(id);
- if (index != -1) {
- return _objects.data() + index;
- }
- return nullptr;
-}
-
-template<>
-const InventoryObjectT3 *InventoryObjectsImpl<InventoryObject>::GetInvObjectT3(int id) {
- error("Can't query Noir inventory objects from non Noir-game");
-}
-
InventoryObjects *InstantiateInventoryObjects(const byte *invObjects, int numObjects) {
switch (TinselVersion) {
+ case 0:
+ return new InventoryObjectsImpl<InventoryObject>(invObjects, numObjects);
case 3:
return new InventoryObjectsImpl<InventoryObjectT3>(invObjects, numObjects);
default:
- return new InventoryObjectsImpl<InventoryObject>(invObjects, numObjects);
+ return new InventoryObjectsImpl<InventoryObjectT1>(invObjects, numObjects);
}
}
diff --git a/engines/tinsel/inv_objects.h b/engines/tinsel/inv_objects.h
index 0bf677ed343..daa9fb5a45d 100644
--- a/engines/tinsel/inv_objects.h
+++ b/engines/tinsel/inv_objects.h
@@ -23,7 +23,6 @@
#define TINSEL_INV_OBJECT_H
#include "common/memstream.h"
-#include "tinsel/tinsel.h"
#include "tinsel/dw.h"
namespace Tinsel {
@@ -40,7 +39,7 @@ enum class InvObjAttr {
// Noir only
V3ATTR_X80 = 0x80,
- NOTEBOOK_CLUE = 0x200,
+ V3ATTR_X200 = 0x200,
V3ATTR_X400 = 0x400,
NOTEBOOK_TITLE = 0x800, // is a notebook title
V3ATTR_X1000 = 0x1000,
@@ -50,6 +49,7 @@ enum class InvObjAttr {
class InventoryObject {
public:
InventoryObject(Common::MemoryReadStreamEndian &stream);
+ virtual ~InventoryObject() {}
int32 getId() const { return _id; }
SCNHANDLE getIconFilm() const { return _hIconFilm; };
void setIconFilm(SCNHANDLE hIconFilm) { _hIconFilm = hIconFilm; }
@@ -58,55 +58,25 @@ public:
bool hasAttribute(InvObjAttr attribute) const {
return getAttribute() & (int32)attribute;
}
-
- // Data size consumed by constructor
- static int SIZE() {
- return (TinselVersion == 0 ? T0_SIZE : T1_SIZE);
- }
+ // Noir:
+ virtual int32 getUnknown() const;
+ virtual int32 getTitle() const;
+ static const int SIZE = 12;
protected:
- static const int T0_SIZE = 3 * 4;
- static const int T1_SIZE = T0_SIZE + 4; // Versions above 0 have attributes
// Tinsel 1+
- int32 getAttribute() const {
- return _attribute;
+ virtual int32 getAttribute() const {
+ return 0;
};
private:
int32 _id; // inventory objects id
SCNHANDLE _hIconFilm; // inventory objects animation film
SCNHANDLE _hScript; // inventory objects event handling script
- int32 _attribute = 0;
-};
-
-class InventoryObjectT3 : public InventoryObject {
-public:
- InventoryObjectT3(Common::MemoryReadStreamEndian &stream) : InventoryObject(stream) {
- _unknown = stream.readUint32();
- _title = stream.readUint32();
- }
- // Noir:
- bool isNotebookTitle() const {
- return (getAttribute() & (int)InvObjAttr::NOTEBOOK_TITLE) != 0;
- }
- int32 getUnknown() const {
- return _unknown;
- }
- int32 getTitle() const {
- return _title;
- }
- // Data size consumed by constructor
- static int SIZE() {
- return InventoryObject::SIZE() + 8;
- }
-private:
- int32 _unknown;
- int32 _title;
};
class InventoryObjects {
public:
virtual ~InventoryObjects() {};
virtual const InventoryObject *GetInvObject(int id) = 0;
- virtual const InventoryObjectT3 *GetInvObjectT3(int id) = 0;
virtual const InventoryObject *GetObjectByIndex(int index) const = 0;
virtual void SetObjectFilm(int id, SCNHANDLE hFilm) = 0;
virtual int GetObjectIndexIfExists(int id) const = 0;
diff --git a/engines/tinsel/module.mk b/engines/tinsel/module.mk
index e7b30e8cb23..7edd3eacb3d 100644
--- a/engines/tinsel/module.mk
+++ b/engines/tinsel/module.mk
@@ -17,7 +17,6 @@ MODULE_OBJS := \
effect.o \
events.o \
faders.o \
- film.o \
font.o \
graphics.o \
handle.o \
@@ -50,7 +49,6 @@ MODULE_OBJS := \
tinsel.o \
token.o \
noir/notebook.o \
- noir/notebook_page.o \
noir/sysreel.o \
# This module can be built as a plugin
diff --git a/engines/tinsel/movers.cpp b/engines/tinsel/movers.cpp
index d44bedad29a..94b52c09565 100644
--- a/engines/tinsel/movers.cpp
+++ b/engines/tinsel/movers.cpp
@@ -718,7 +718,7 @@ static void InitialPathChecks(MOVER *pMover, int xpos, int ypos) {
static void MoverProcessHelper(int X, int Y, int id, MOVER *pMover) {
const FILM *pfilm = (const FILM *)_vm->_handle->LockMem(pMover->walkReels[0][FORWARD]);
- const MULTI_INIT *pmi = pfilm->reels[0].GetMultiInit();
+ const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfilm->reels[0].mobj));
assert(_vm->_bg->BgPal()); // Can't start actor without a background palette
assert(pMover->walkReels[0][FORWARD]); // Starting actor process without walk reels
@@ -812,7 +812,7 @@ void T2MoverProcess(CORO_PARAM, const void *param) {
MOVER *pMover = rpos->pMover;
int i;
FILM *pFilm;
- const MULTI_INIT *pmi;
+ MULTI_INIT *pmi;
CORO_BEGIN_CODE(_ctx);
@@ -826,7 +826,7 @@ void T2MoverProcess(CORO_PARAM, const void *param) {
InitialPathChecks(pMover, rpos->X, rpos->Y);
pFilm = (FILM *)_vm->_handle->LockMem(pMover->walkReels[i][FORWARD]); // Any old reel
- pmi = pFilm->reels[0].GetMultiInit();
+ pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pFilm->reels[0].mobj));
// Poke in the background palette
PokeInPalette(pmi);
diff --git a/engines/tinsel/multiobj.cpp b/engines/tinsel/multiobj.cpp
index f239916629c..1ec2c944b41 100644
--- a/engines/tinsel/multiobj.cpp
+++ b/engines/tinsel/multiobj.cpp
@@ -30,10 +30,6 @@
namespace Tinsel {
-const FRAME *MULTI_INIT::GetFrame() const {
- return (const FRAME *)_vm->_handle->LockMem(FROM_32(hMulFrame));
-}
-
/**
* Initialize a multi-part object using a list of images to init
* each object piece. One object is created for each image in the list.
@@ -44,11 +40,11 @@ const FRAME *MULTI_INIT::GetFrame() const {
OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) {
OBJ_INIT obj_init; // object init table
OBJECT *pFirst, *pObj; // object pointers
- const FRAME *pFrame; // list of images for the multi-part object
+ FRAME *pFrame; // list of images for the multi-part object
if (FROM_32(pInitTbl->hMulFrame)) {
// we have a frame handle
- pFrame = pInitTbl->GetFrame();
+ pFrame = (FRAME *)_vm->_handle->LockMem(FROM_32(pInitTbl->hMulFrame));
obj_init.hObjImg = READ_32(pFrame); // first objects shape
} else { // this must be a animation list for a NULL object
@@ -90,9 +86,9 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) {
}
OBJECT *InsertReelObj(const FREEL *reels) {
- const MULTI_INIT *pmi = reels->GetMultiInit();
+ const MULTI_INIT *pmi = (const MULTI_INIT*)_vm->_handle->LockMem(reels->mobj);
// Verify that there is an image defined
- const FRAME *frame = pmi->GetFrame();
+ const FRAME *frame = (const FRAME*)_vm->_handle->LockMem(pmi->hMulFrame);
const IMAGE *image = (const IMAGE*)_vm->_handle->LockMem(*frame);
assert(image);
@@ -102,7 +98,7 @@ OBJECT *InsertReelObj(const FREEL *reels) {
}
const FILM *GetSystemReelFilm(SysReel reelIndex) {
- SCNHANDLE hFilm = _vm->_systemReel->get(reelIndex);
+ SCNHANDLE hFilm = _vm->_systemReel->Get(reelIndex);
const FILM *pfilm = (const FILM *)_vm->_handle->LockMem(hFilm);
return pfilm;
}
diff --git a/engines/tinsel/multiobj.h b/engines/tinsel/multiobj.h
index c7688b829b2..67efe282127 100644
--- a/engines/tinsel/multiobj.h
+++ b/engines/tinsel/multiobj.h
@@ -43,8 +43,6 @@ struct MULTI_INIT {
int32 mulY; ///< multi-objects initial y ani position
int32 mulZ; ///< multi-objects initial z position
uint32 otherFlags; ///< multi-objects Tinsel 2 - other flags
-
- const FRAME *GetFrame() const;
} PACKED_STRUCT;
#include "common/pack-end.h" // END STRUCT PACKING
@@ -135,11 +133,11 @@ void MultiForceRedraw(
OBJECT *pMultiObj); // multi-part object to be forced
struct FREEL;
-OBJECT *InsertReelObj(const FREEL *reels);
+OBJECT* InsertReelObj(const FREEL *reels);
struct FILM;
enum class SysReel;
-const FILM *GetSystemReelFilm(SysReel reelIndex);
-OBJECT *InsertSystemReelObj(SysReel reelIndex);
+const FILM* GetSystemReelFilm(SysReel reelIndex);
+OBJECT* InsertSystemReelObj(SysReel reelIndex);
} // End of namespace Tinsel
diff --git a/engines/tinsel/noir/notebook.cpp b/engines/tinsel/noir/notebook.cpp
index c6789c3ca71..b8022c0319d 100644
--- a/engines/tinsel/noir/notebook.cpp
+++ b/engines/tinsel/noir/notebook.cpp
@@ -21,35 +21,19 @@
#include "tinsel/noir/notebook.h"
-#include "tinsel/background.h"
#include "tinsel/dialogs.h"
-#include "tinsel/film.h"
-#include "tinsel/handle.h"
-#include "tinsel/multiobj.h"
-#include "tinsel/noir/sysreel.h"
-#include "tinsel/pdisplay.h"
-#include "tinsel/polygons.h"
-#include "tinsel/timers.h"
namespace Tinsel {
-Notebook::Notebook() {
- _polygons = instantiateNoteBookPolygons();
-}
-
-Notebook::~Notebook() {
- delete _polygons;
-}
-
-void Notebook::addHyperlink(int32 id1, int32 id2) {
- auto *invObject = _vm->_dialogs->getInvObjectT3(id1);
+void Notebook::AddHyperlink(int32 id1, int32 id2) {
+ auto *invObject = _vm->_dialogs->GetInvObject(id1);
if (invObject->getTitle() != 0) {
error("A clue can only be hyperlinked if it only has one title!");
return;
}
- invObject = _vm->_dialogs->getInvObjectT3(id2);
+ invObject = _vm->_dialogs->GetInvObject(id2);
if (invObject->getTitle() != 0) {
error("A clue can only be hyperlinked if it only has one title!");
@@ -77,246 +61,13 @@ void Notebook::addHyperlink(int32 id1, int32 id2) {
error("Too many hyperlinks");
}
-void Notebook::clearNotebookPage() {
- if (_prevPage != -1) {
- _pages[_prevPage].clear();
- }
- _prevPage = -1;
- _pages[_currentPage].clear();
-}
-
-void Notebook::refresh() {
- auto reel = (_currentPage == 0 ? SysReel::NOTEPAD_CLOSED : SysReel::NOTEPAD_OPEN);
- auto film = GetSystemReelFilm(reel);
- InitStepAnimScript(&_anim, _object, film->reels->script, ONE_SECOND / film->frate);
- clearNotebookPage();
- if (_currentPage != 0) {
- _pages[_currentPage].fillIn();
- }
-}
-
-int Notebook::addTitle(const InventoryObjectT3 &invObject) {
- int id = invObject.getId();
- assert(invObject.isNotebookTitle());
- for (int i = 0; i < _numPages; i++) {
- if (_pages[i].getTitle() == id) {
- return i;
- }
- }
- int linkedFromPage = invObject.getUnknown();
- // 0 page is the closed notebook, has no entries.
- if (linkedFromPage != 0) {
- // Allocate a line on the linked from page.
- assert(_pages[linkedFromPage].getTitle() != 0);
- _pages[linkedFromPage].addLine(id);
- }
- int pageIndex = _numPages++;
- _pages[pageIndex].setTitle(id);
- return pageIndex;
-}
-
-void Notebook::addClue(const InventoryObjectT3 &invObject) {
- if (invObject.getUnknown() == 0) {
- // This affects two clues, that should get special treatment.
- warning("TODO: Handle clues with no parent page");
- return;
- }
- // Add title if missing, otherwise just get the page it's on.
- auto titleObject = _vm->_dialogs->getInvObjectT3(invObject.getUnknown());
- int pageIndex = addTitle(*titleObject);
- _pages[pageIndex].addLine(invObject.getId());
- if (invObject.getTitle() != 0) {
- auto secondTitleObject = _vm->_dialogs->getInvObjectT3(invObject.getTitle());
- pageIndex = addTitle(*secondTitleObject);
- _pages[pageIndex].addLine(invObject.getId());
- }
+void Notebook::Show(bool isOpen) {
+ error("TODO: Implement Notebook::Show()");
}
-void Notebook::addClue(int id) {
- auto invObject = _vm->_dialogs->getInvObjectT3(id);
- if (invObject->isNotebookTitle()) {
- addTitle(*invObject);
- } else {
- addClue(*invObject);
- }
-}
-
-int Notebook::getPageWithTitle(int id) {
- for (int i = 0; i < _numPages; i++) {
- if (_pages[i].getTitle() == id) {
- return i;
- }
- }
- return -1;
-}
-
-void Notebook::crossClue(int id) {
- auto invObject = _vm->_dialogs->getInvObjectT3(id);
- if (invObject->isNotebookTitle()) {
- return;
- }
- int titles[2] = {
- invObject->getUnknown(),
- invObject->getTitle()
- };
- for (int i = 0; i < 2; i++) {
- if (titles[i] == 0) {
- continue;
- }
- int page = getPageWithTitle(titles[i]);
- if (page != -1) {
- _pages[page].crossClue(id);
- }
- }
-}
-
-void InitNotebookAnim(OBJECT **obj, ANIM &anim, SysReel reel, int zPosition) {
- auto film = GetSystemReelFilm(reel);
- MultiDeleteObjectIfExists(FIELD_STATUS, obj);
- *obj = InsertReelObj(film->reels);
- MultiSetZPosition(*obj, zPosition);
- InitStepAnimScript(&anim, *obj, film->reels->script, ONE_SECOND / film->frate);
-}
-
-void Notebook::setNextPage(int pageIndex) {
- assert(_prevPage == -1 || _prevPage == _currentPage); // Check that we've cleaned any outstanding page.
- _prevPage = _currentPage;
- _currentPage = pageIndex;
-}
-
-void Notebook::pageFlip(bool up) {
- int nextPage = _currentPage + (up ? -1 : 1);
- if (nextPage <= 0) {
- setNextPage(0);
- refresh();
- return;
- } else if (nextPage == 1) {
- // TODO: Should possibly just call whatever function we use to open.
- InitNotebookAnim(&_object, _anim, SysReel::NOTEPAD_OPENING, Z_INV_RFRAME);
- _state = BOOKSTATE::OPEN_ANIMATING;
- setNextPage(nextPage);
- return;
- }
- setNextPage(nextPage);
- SysReel reel = (up ? SysReel::NOTEPAD_FLIPUP : SysReel::NOTEPAD_FLIPDOWN);
- InitNotebookAnim(&_pageObject, _pageAnim, reel, 19);
- _state = BOOKSTATE::PAGEFLIP;
-}
-
-void Notebook::show(bool isOpen) {
- auto reel = (isOpen ? SysReel::NOTEPAD_OPEN : SysReel::NOTEPAD_OPENING);
- InitNotebookAnim(&_object, _anim, reel, Z_INV_MFRAME);
-
- _state = (isOpen ? BOOKSTATE::OPENED : BOOKSTATE::OPEN_ANIMATING);
- setNextPage(1);
- refresh();
- DisableTags(); // Tags disabled in Notebook
- DisablePointing(); // Pointing disabled in Notebook
-}
-
-bool Notebook::isOpen() const {
+bool Notebook::IsOpen() const {
return _state != BOOKSTATE::CLOSED;
}
-void Notebook::close() {
- clearNotebookPage();
- MultiDeleteObjectIfExists(FIELD_STATUS, &_object);
- MultiDeleteObjectIfExists(FIELD_STATUS, &_pageObject);
- _state = BOOKSTATE::CLOSED;
- if (_vm->_dialogs->inventoryOrNotebookActive()) {
- EnablePointing();
- EnableTags();
- }
-}
-
-void Notebook::stepAnimScripts() {
- if (_state == BOOKSTATE::OPEN_ANIMATING) {
- auto state = StepAnimScript(&_anim);
- if (state == ScriptFinished) {
- _state = BOOKSTATE::OPENED;
- refresh();
- }
- }
- if (_state == BOOKSTATE::PAGEFLIP) {
- auto state = StepAnimScript(&_pageAnim);
- if (state == ScriptFinished) {
- MultiDeleteObjectIfExists(FIELD_STATUS, &_pageObject);
- _state = BOOKSTATE::OPENED;
- refresh();
- }
- }
-}
-
-int32 Notebook::GetPointedClue(const Common::Point &point) const {
- if (_currentPage == 0 || _currentPage > _numPages) {
- return 0;
- }
- return _pages[_currentPage].getClueForLine(_polygons->lineHit(point));
-}
-
-bool Notebook::handlePointer(const Common::Point &point) {
- if (!isOpen()) {
- return 0;
- }
- auto inside = _polygons->isInsideNotebook(point);
- if (inside) {
- auto hit = _polygons->lineHit(point);
- _pages[_currentPage].handlePointAtLine(hit);
- return true; // We handled the pointer
- }
- return false;
-}
-
-bool Notebook::handleEvent(PLR_EVENT pEvent, const Common::Point &coOrds) {
- if (!isOpen()) { // TODO: Clicking outside should close the notebook
- return false;
- }
- auto inside = _polygons->isInsideNotebook(coOrds);
- switch(pEvent) {
- case PLR_ACTION:
- if (inside) {
- return true;
- }
- return false;
- case PLR_LOOK:
- if (inside) {
- return true;
- }
- return false;
- case PLR_WALKTO: {
- // Handle clue-clicks
- auto poly = _polygons->mostSpecificHit(coOrds);
- switch (poly) {
- case NoteBookPoly::NEXT:
- handleEvent(PLR_PGUP, coOrds);
- return true;
- case NoteBookPoly::PREV:
- handleEvent(PLR_PGDN, coOrds);
- return true;
- case NoteBookPoly::NONE:
- handleEvent(PLR_ESCAPE, coOrds);
- return true;
- default:
- return true;
- }
- }
-
- case PLR_ESCAPE:
- close();
- return true;
- case PLR_PGUP:
- pageFlip(true);
- return true;
- case PLR_PGDN:
- pageFlip(false);
- return true;
- case PLR_HOME:
- case PLR_END:
- default:
- return false;
- }
- return false;
-}
-
} // End of namespace Tinsel
diff --git a/engines/tinsel/noir/notebook.h b/engines/tinsel/noir/notebook.h
index 799c30d2573..79b7bcdb071 100644
--- a/engines/tinsel/noir/notebook.h
+++ b/engines/tinsel/noir/notebook.h
@@ -24,16 +24,13 @@
#include "common/scummsys.h"
-#include "notebook_page.h"
-#include "tinsel/anim.h"
#include "tinsel/events.h"
-#include "tinsel/object.h"
namespace Tinsel {
// links two clue/title objects together
struct HYPERLINK {
- int32 id1 = 0;
- int32 id2 = 0;
+ int32 id1;
+ int32 id2;
};
// 6 bytes large
@@ -50,67 +47,37 @@ enum class BOOKSTATE {
CLOSED = 0,
OPEN_UNKNOWN = 1,
OPEN_ANIMATING = 2,
- OPENED = 3,
- PAGEFLIP = 4
+ OPENED = 3
};
-class NoteBookPolygons;
-class InventoryObjectT3;
-
class Notebook {
public:
- Notebook();
- ~Notebook();
+ Notebook() = default;
+ // Can be a title or clue
+ void AddEntry(int32 entryIdx, int32 page1, int32 page2);
// Adds a connection between a clue/title
- void addHyperlink(int32 id1, int32 id2);
- void addClue(int id);
- void crossClue(int id);
+ void AddHyperlink(int32 id1, int32 id2);
// Called within InventoryProcess loop
- void redraw();
-
+ void Redraw();
+ // Called by EventToInventory
+ void EventToNotebook(PLR_EVENT event, bool p2, bool p3);
// Called from OPENNOTEBOOK
- void show(bool isOpen);
- bool isOpen() const;
- void close();
-
- bool handlePointer(const Common::Point &point);
- bool handleEvent(PLR_EVENT pEvent, const Common::Point &coOrds);
- void stepAnimScripts();
- void refresh();
-
- NoteBookPolygons *_polygons = nullptr;
+ void Show(bool isOpen);
+ bool IsOpen() const;
private:
- int addTitle(const InventoryObjectT3 &invObject);
- void addClue(const InventoryObjectT3 &invObject);
- int getPageWithTitle(int id);
-
- void pageFlip(bool up);
-
- int32 GetPointedClue(const Common::Point &point) const;
-
- void clearNotebookPage();
-
- void setNextPage(int pageIndex);
-
+ const static uint32 MAX_ENTRIES = 100;
const static uint32 MAX_PAGES = 0x15;
const static uint32 MAX_HYPERS = 0xf;
+ const static uint32 MAX_ENTRIES_PER_PAGE = 8;
HYPERLINK _hyperlinks[MAX_HYPERS];
- uint32 _numPages = 1;
- uint32 _prevPage = -1;
- uint32 _currentPage = 1;
-
- NotebookPage _pages[MAX_PAGES] = {};
-
- ANIM _anim = {};
- OBJECT *_object = nullptr;
+ const static uint32 _numEntries = 0;
- ANIM _pageAnim = {};
- OBJECT *_pageObject = nullptr;
+ ENTRY _entries[MAX_ENTRIES];
- BOOKSTATE _state = BOOKSTATE::CLOSED;
+ BOOKSTATE _state;
};
} // End of namespace Tinsel
diff --git a/engines/tinsel/noir/notebook_page.cpp b/engines/tinsel/noir/notebook_page.cpp
deleted file mode 100644
index 68f19991e6b..00000000000
--- a/engines/tinsel/noir/notebook_page.cpp
+++ /dev/null
@@ -1,162 +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 3 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, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-#include "tinsel/noir/notebook_page.h"
-#include "tinsel/dialogs.h"
-#include "tinsel/dw.h"
-#include "tinsel/film.h"
-#include "tinsel/handle.h"
-#include "tinsel/multiobj.h"
-#include "tinsel/polygons.h"
-#include "tinsel/timers.h"
-#include "tinsel/tinsel.h"
-#include "tinsel/noir/sysreel.h"
-
-namespace Tinsel {
-
-void NotebookLine::clear() {
- MultiDeleteObjectIfExists(FIELD_STATUS, &_obj);
-}
-
-bool HasReelFrame(SCNHANDLE pReel) {
- if (pReel) {
- const FREEL* reel = (const FREEL*)_vm->_handle->LockMem(pReel);
- if (reel && reel->mobj) {
- const MULTI_INIT* pmi = reel->GetMultiInit();
- if (pmi) {
- return pmi->GetFrame() != nullptr;
- }
- }
- }
- return false;
-}
-
-int FindReelIndexForEntry(const FILM *pFilm, int pageLine) {
- if (HasReelFrame(pFilm->reels[pageLine].mobj)) {
- return pageLine;
- }
- for (int i = pageLine; i < pFilm->numreels; i++) {
- if (HasReelFrame(pFilm->reels[i].mobj)) {
- return i;
- }
- }
- for (int i = pageLine; i >= 0; i--) {
- if (HasReelFrame(pFilm->reels[i].mobj)) {
- return i;
- }
- }
- return -1;
-}
-
-void NotebookLine::fillIn(int pageLine) {
- const FILM *pFilm = _vm->_dialogs->getObjectFilm(_id);
- if (!pFilm)
- return;
-
- int reelIndex = FindReelIndexForEntry(pFilm, pageLine);
- assert(reelIndex >= 0);
- const FREEL *reel = &pFilm->reels[reelIndex];
- MultiDeleteObjectIfExists(FIELD_STATUS, &_obj);
- _obj = InsertReelObj(reel);
-
- MultiSetZPosition(_obj, 17);
- InitStepAnimScript(&_anim, _obj, pFilm->reels[reelIndex].script, ONE_SECOND / pFilm->frate);
-
- if (_crossedOut) {
- auto scribbleFilm = GetSystemReelFilm(SysReel::SCRIBBLES);
- _scribbles = InsertReelObj(&scribbleFilm->reels[reelIndex]);
- MultiSetZPosition(_scribbles, 18);
-
- InitStepAnimScript(&_scribbleAnim, _scribbles, scribbleFilm->reels[reelIndex].script, ONE_SECOND / pFilm->frate);
- }
-}
-
-void NotebookLine::crossOut() {
- _crossedOut = true;
-}
-
-void NotebookPage::handlePointAtLine(int line) {
- auto objId = getClueForLine(line);
- if (objId != 0 && objId != _pointedClue) {
- auto obj = _vm->_dialogs->getInvObject(objId);
- _vm->_dialogs->invPointEvent(obj, -1);
- _pointedClue = objId;
- }
-}
-
-int NotebookPage::indexOfClue(int id) const {
- for (int i = 0; i < _numLines; i++) {
- if (_lines[i]._id == id) {
- return i;
- }
- }
- return -1;
-}
-
-bool NotebookPage::containsClue(int id) {
- return indexOfClue(id) != -1;
-}
-
-void NotebookPage::crossClue(int id) {
- int index = indexOfClue(id);
- assert(index != -1);
- _lines[index].crossOut();
-}
-
-void NotebookPage::addLine(int id) {
- if (containsClue(id)) {
- return;
- }
- assert(_numLines < MAX_ENTRIES_PER_PAGE);
- _lines[_numLines++]._id = id;
-}
-
-void NotebookPage::setTitle(int id) {
- _lines[0]._id = id;
- if (_numLines == 0) {
- _numLines++;
- }
-}
-int32 NotebookPage::getTitle() const {
- return _lines[0]._id;
-}
-
-void NotebookPage::fillIn() {
- for (int i = 0; i < _numLines; i++) {
- _lines[i].fillIn(i);
- }
-}
-
-void NotebookPage::clear() {
- for (int i = 0; i < _numLines; i++) {
- _lines[i].clear();
- }
- _pointedClue = -1;
-}
-
-int NotebookPage::getClueForLine(int line) const {
- if (line >= _numLines) {
- return 0;
- }
- return _lines[line]._id;
-}
-
-} // End of namespace Tinsel
diff --git a/engines/tinsel/noir/notebook_page.h b/engines/tinsel/noir/notebook_page.h
deleted file mode 100644
index 7a394700062..00000000000
--- a/engines/tinsel/noir/notebook_page.h
+++ /dev/null
@@ -1,69 +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 3 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, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-#ifndef TINSEL_NOTEBOOK_PAGE_H // prevent multiple includes
-#define TINSEL_NOTEBOOK_PAGE_H
-
-#include "common/scummsys.h"
-#include "tinsel/anim.h"
-#include "tinsel/tinsel.h"
-#include "tinsel/object.h"
-
-namespace Tinsel {
-
-class NotebookLine {
-public:
- int _id = 0;
- void crossOut();
- void clear();
- void fillIn(int pageLine);
-private:
- bool _crossedOut = false;
- ANIM _anim = {};
- OBJECT *_obj = nullptr;
- OBJECT *_scribbles = nullptr;
- ANIM _scribbleAnim = {};
-};
-
-class NotebookPage {
-public:
- bool containsClue(int id);
- void crossClue(int id);
- void addLine(int id);
- void setTitle(int id);
- int32 getTitle() const;
- void fillIn();
- void clear();
- int getPointedClue(const Common::Point &point) const;
- int getClueForLine(int line) const;
- void handlePointAtLine(int line);
-private:
- int indexOfClue(int id) const;
-
- int _pointedClue = -1;
- const static uint32 MAX_ENTRIES_PER_PAGE = 8;
- NotebookLine _lines[MAX_ENTRIES_PER_PAGE] = {};
- uint32 _numLines = 0;
-};
-
-} // End of namespace Tinsel
-
-#endif // SCUMMVM_NOTEBOOK_PAGE_H
diff --git a/engines/tinsel/noir/sysreel.cpp b/engines/tinsel/noir/sysreel.cpp
index b2224538adb..15512876818 100644
--- a/engines/tinsel/noir/sysreel.cpp
+++ b/engines/tinsel/noir/sysreel.cpp
@@ -34,7 +34,7 @@ namespace Tinsel {
*
* @param index reel to get the handle to
*/
-SCNHANDLE SystemReel::get(SysReel index) {
+SCNHANDLE SystemReel::Get(SysReel index) {
assert((int)index >= 0 && (int)index < MAX_SYSREELS);
return _reels[(int)index];
@@ -46,7 +46,7 @@ SCNHANDLE SystemReel::get(SysReel index) {
* @param index where to store the reel
* @param reel handle to the reel
*/
-void SystemReel::set(int32 index, SCNHANDLE reel) {
+void SystemReel::Set(int32 index, SCNHANDLE reel) {
assert(index >= 0 && index < MAX_SYSREELS);
if (index == (int)SysReel::LOADSCREEN) {
diff --git a/engines/tinsel/noir/sysreel.h b/engines/tinsel/noir/sysreel.h
index febbd8155f9..a003751fcb7 100644
--- a/engines/tinsel/noir/sysreel.h
+++ b/engines/tinsel/noir/sysreel.h
@@ -32,7 +32,6 @@ enum class SysReel {
NOTEPAD_CLOSED = 6,
NOTEPAD_FLIPDOWN = 7,
NOTEPAD_FLIPUP = 8,
- SCRIBBLES = 9,
CURSOR = 11,
INVMAIN = 15,
SLIDER = 16,
@@ -52,8 +51,8 @@ class SystemReel {
public:
SystemReel() = default;
- SCNHANDLE get(SysReel index);
- void set(int32 index, SCNHANDLE reel);
+ SCNHANDLE Get(SysReel index);
+ void Set(int32 index, SCNHANDLE reel);
private:
const static int32 MAX_SYSREELS = 0x28;
diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp
index d754dcd8f3b..a92fb36135c 100644
--- a/engines/tinsel/play.cpp
+++ b/engines/tinsel/play.cpp
@@ -101,7 +101,7 @@ static void PokeInPalette(SCNHANDLE hMulFrame) {
void PokeInPalette(const MULTI_INIT *pmi) {
// Could be an empty column
if (pmi->hMulFrame) {
- const FRAME *pFrame = pmi->GetFrame();
+ const FRAME *pFrame = (const FRAME *)_vm->_handle->LockMem(FROM_32(pmi->hMulFrame));
_vm->_handle->SetImagePalette(READ_32(pFrame), _vm->_bg->BgPal());
}
}
@@ -235,8 +235,10 @@ static void SoundReel(CORO_PARAM, SCNHANDLE hFilm, int column, int speed,
CORO_BEGIN_CODE(_ctx);
if (actorCol) {
+ MULTI_INIT *pmi; // MULTI_INIT structure
+
pReel = GetReel(hFilm, actorCol - 1);
- const MULTI_INIT *pmi = pReel->GetMultiInit();
+ pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pReel->mobj));
_ctx->reelActor = (int32)FROM_32(pmi->mulID);
} else
_ctx->reelActor = 0;
@@ -449,7 +451,7 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) {
_ctx->pfreel = &pfilm->reels[ppi->column];
// Get the MULTI_INIT structure
- pmi = _ctx->pfreel->GetMultiInit();
+ pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(_ctx->pfreel->mobj));
// Save actor's ID
_ctx->reelActor = (int32)FROM_32(pmi->mulID);
@@ -703,7 +705,7 @@ static void t2PlayReel(CORO_PARAM, int x, int y, bool bRestore, int speed, SCNHA
// Get the reel and MULTI_INIT structure
_ctx->pFreel = GetReel(hFilm, column);
- _ctx->pmi = _ctx->pFreel->GetMultiInit();
+ _ctx->pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(_ctx->pFreel->mobj));
if ((int32)FROM_32(_ctx->pmi->mulID) == -2) {
CORO_INVOKE_ARGS(SoundReel, (CORO_SUBCTX, hFilm, column, speed, myescEvent,
@@ -956,7 +958,7 @@ void NewestFilm(SCNHANDLE film, const FREEL *reel) {
const MULTI_INIT *pmi; // MULTI_INIT structure
// Get the MULTI_INIT structure
- pmi = reel->GetMultiInit();
+ pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(reel->mobj));
if ((TinselVersion <= 1) || ((int32)FROM_32(pmi->mulID) != -2))
_vm->_actor->SetActorLatestFilm((int32)FROM_32(pmi->mulID), film);
@@ -1160,7 +1162,7 @@ void RestoreActorReels(SCNHANDLE hFilm, int actor, int x, int y) {
// Search backwards for now as later column will be the one
for (i = (int)FROM_32(pFilm->numreels) - 1; i >= 0; i--) {
pFreel = &pFilm->reels[i];
- pmi = pFreel->GetMultiInit();
+ pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pFreel->mobj));
if ((int32)FROM_32(pmi->mulID) == actor) {
ppi.column = (short)i;
NewestFilm(hFilm, &pFilm->reels[i]);
@@ -1179,7 +1181,7 @@ void RestoreActorReels(SCNHANDLE hFilm, int actor, int x, int y) {
int ExtractActor(SCNHANDLE hFilm) {
const FILM *pFilm = (const FILM *)_vm->_handle->LockMem(hFilm);
const FREEL *pReel = &pFilm->reels[0];
- const MULTI_INIT *pmi = pReel->GetMultiInit();
+ const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pReel->mobj));
return (int)FROM_32(pmi->mulID);
}
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index c615e284adb..3a601a3fb5d 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -25,7 +25,6 @@
#include "tinsel/pid.h"
#include "tinsel/polygons.h"
#include "tinsel/movers.h"
-#include "tinsel/noir/notebook.h"
#include "tinsel/sched.h"
#include "common/serializer.h"
#include "tinsel/tinsel.h"
@@ -110,11 +109,6 @@ struct POLYGON {
*/
POLYGON *adjpaths[MAXADJ];
- void setPoint(int index, const Common::Point &point) {
- cx[index] = point.x;
- cy[index] = point.y;
- }
- bool containsPoint(const Common::Point &point) const;
};
#define MAXONROUTE 40
@@ -410,8 +404,13 @@ static HPOLYGON PolygonIndex(const POLYGON *pp) {
* have two polygon corners above it and two corners to the left of it.
*/
bool IsInPolygon(int xt, int yt, HPOLYGON hp) {
+ const POLYGON *pp;
+ int i;
+ bool BeenTested = false;
+ int pl = 0, pa = 0;
+
CHECK_HP_OR(hp, "Out of range polygon handle (1)");
- const POLYGON *pp = Polys[hp];
+ pp = Polys[hp];
assert(pp != NULL); // Testing whether in a NULL polygon
// Shift cursor for relative polygons
@@ -420,26 +419,18 @@ bool IsInPolygon(int xt, int yt, HPOLYGON hp) {
yt -= volatileStuff[hp].yoff;
}
- return pp->containsPoint(Common::Point(xt, yt));
-}
-
-bool POLYGON::containsPoint(const Common::Point &point) const {
- int xt = point.x;
- int yt = point.y;
/* Is point within the external rectangle? */
- if (point.x < this->pleft || point.x > this->pright || yt < this->ptop || yt > this->pbottom)
+ if (xt < pp->pleft || xt > pp->pright || yt < pp->ptop || yt > pp->pbottom)
return false;
- bool BeenTested = false;
-
// For each corner/side
- for (int i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
// If within this side's 'testable' area
// i.e. within the width of the line in y direction of end of line
// or within the height of the line in x direction of end of line
- if ((xt >= this->lleft[i] && xt <= this->lright[i] && ((yt > this->cy[i]) == (this->cy[(i+1)%4] > this->cy[i])))
- || (yt >= this->ltop[i] && yt <= this->lbottom[i] && ((xt > this->cx[i]) == (this->cx[(i+1)%4] > this->cx[i])))) {
- if (((long)xt*this->a[i] + (long)yt*this->b[i]) < this->c[i])
+ if ((xt >= pp->lleft[i] && xt <= pp->lright[i] && ((yt > pp->cy[i]) == (pp->cy[(i+1)%4] > pp->cy[i])))
+ || (yt >= pp->ltop[i] && yt <= pp->lbottom[i] && ((xt > pp->cx[i]) == (pp->cx[(i+1)%4] > pp->cx[i])))) {
+ if (((long)xt*pp->a[i] + (long)yt*pp->b[i]) < pp->c[i])
return false;
else
BeenTested = true;
@@ -448,23 +439,21 @@ bool POLYGON::containsPoint(const Common::Point &point) const {
if (BeenTested) {
// New dodgy code 29/12/94
- if (this->polyType == BLOCK) {
+ if (pp->polyType == BLOCK) {
// For each corner/side
- for (int i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
// Pretend the corners of blocking polys are not in the poly.
- if (xt == this->cx[i] && yt == this->cy[i])
+ if (xt == pp->cx[i] && yt == pp->cy[i])
return false;
}
}
return true;
} else {
- int pl = 0, pa = 0;
-
// Is point within the internal rectangle?
- for (int i = 0; i < 4; i++) {
- if (this->cx[i] < xt)
+ for (i = 0; i < 4; i++) {
+ if (pp->cx[i] < xt)
pl++;
- if (this->cy[i] < yt)
+ if (pp->cy[i] < yt)
pa++;
}
@@ -2488,95 +2477,17 @@ void UpdateGroundPlane() {
//...
}
-class NoteBookPolygonsImpl : public NoteBookPolygons {
-public:
- NoteBookPolygonsImpl() {
- setPolygon(NoteBookPoly::MAIN,
- Common::Point(220, 0),
- Common::Point(446, 0),
- Common::Point(553, 425),
- Common::Point(164, 410));
- }
-
- void setPolygon(NoteBookPoly polyKind, const Common::Point &c0, const Common::Point &c1, const Common::Point &c2, const Common::Point &c3) override {
- POLYGON *poly = nullptr;
- switch(polyKind) {
- case NoteBookPoly::MAIN:
- poly = &_main;
- break;
- case NoteBookPoly::NEXT:
- poly = &_next;
- break;
- case NoteBookPoly::PREV:
- poly = &_prev;
- break;
- default:
- poly = _cluePoly + static_cast<int>(polyKind);
- break;
- }
- poly->polyType = SHAPE;
- poly->setPoint(0, c0);
- poly->setPoint(1, c1);
- poly->setPoint(2, c2);
- poly->setPoint(3, c3);
- FiddlyBit(poly);
- }
-
- void pushPolygon(const Common::Point &c0, const Common::Point &c1, const Common::Point &c2, const Common::Point &c3) override {
- assert(_polyIndex < MAX_CLUE_POLYS);
- setPolygon(static_cast<NoteBookPoly>(_polyIndex), c0, c1, c2, c3);
- _polyIndex++;
- }
-
- bool isInsideNotebook(const Common::Point &point) const override {
- return _main.containsPoint(point);
- }
-
- int lineHit(const Common::Point &point) const override {
- for (int i = 0; i < MAX_CLUE_POLYS; i++) {
- if (_cluePoly[i].containsPoint(point)) {
- return i;
- }
- }
- return -1;
- }
-
- NoteBookPoly mostSpecificHit(const Common::Point &point) const override {
- auto line = lineHit(point);
- if (line != -1) {
- return static_cast<NoteBookPoly>(line);
- }
- if (_next.containsPoint(point)) {
- return NoteBookPoly::NEXT;
- } else if (_prev.containsPoint(point)) {
- return NoteBookPoly::PREV;
- } else if (_main.containsPoint(point)) {
- return NoteBookPoly::MAIN;
- }
- return NoteBookPoly::NONE;
- }
-private:
- static const int MAX_CLUE_POLYS = 8;
- int _polyIndex = 0;
- POLYGON _main, _prev, _next;
- POLYGON _cluePoly[MAX_CLUE_POLYS];
-};
-
-NoteBookPolygons *instantiateNoteBookPolygons() {
- return new NoteBookPolygonsImpl;
-}
-
// Notebook (Tinsel)
void NotebookPolyEntry(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3) {
- _vm->_notebook->_polygons->pushPolygon(c0, c1, c2, c3);
+ warning("TODO: Finish implementation of NotebookPolyEntry(%d, %d, %d, %d, %d, %d, %d, %d)", c0.x, c0.y, c1.x, c1.y, c2.x, c2.y, c3.x, c3.y);
}
void NotebookPolyNextPage(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3) {
- _vm->_notebook->_polygons->setPolygon(NoteBookPoly::NEXT, c0, c1, c2, c3);
+ warning("TODO: Finish implementation of NotebookPolyNextPage(%d, %d, %d, %d, %d, %d, %d, %d)", c0.x, c0.y, c1.x, c1.y, c2.x, c2.y, c3.x, c3.y);
}
void NotebookPolyPrevPage(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3) {
- _vm->_notebook->_polygons->setPolygon(NoteBookPoly::PREV, c0, c1, c2, c3);
+ warning("TODO: Finish implementation of NotebookPolyPrevPage(%d, %d, %d, %d, %d, %d, %d, %d)", c0.x, c0.y, c1.x, c1.y, c2.x, c2.y, c3.x, c3.y);
}
} // End of namespace Tinsel
diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h
index da767caf363..31f5a1f8cb6 100644
--- a/engines/tinsel/polygons.h
+++ b/engines/tinsel/polygons.h
@@ -38,7 +38,7 @@ enum PTYPE {
// Extra polygon types from Tinsel v1
EXIT, EX_EXIT,
// Extra polygon types from Tinsel v3
- SCALE, EX_SCALE, SHAPE
+ SCALE, EX_SCALE
};
// subtype
@@ -160,34 +160,6 @@ void NotebookPolyPrevPage(Common::Point c0, Common::Point c1, Common::Point c2,
void UpdateGroundPlane();
-enum class NoteBookPoly {
- CLUE_0 = 0,
- CLUE_1 = 1,
- CLUE_2 = 2,
- CLUE_3 = 3,
- CLUE_4 = 4,
- CLUE_5 = 5,
- CLUE_6 = 6,
- CLUE_7 = 7,
- MAIN,
- NEXT,
- PREV,
- NONE
-};
-
-class NoteBookPolygons {
-public:
- virtual ~NoteBookPolygons() {}
- virtual void setPolygon(NoteBookPoly polyKind, const Common::Point &c0, const Common::Point &c1, const Common::Point &c2, const Common::Point &c3) = 0;
- virtual void pushPolygon(const Common::Point &c0, const Common::Point &c1, const Common::Point &c2, const Common::Point &c3) = 0;
-
- virtual NoteBookPoly mostSpecificHit(const Common::Point &point) const = 0;
- virtual int lineHit(const Common::Point &point) const = 0;
- virtual bool isInsideNotebook(const Common::Point &point) const = 0;
-};
-
-NoteBookPolygons *instantiateNoteBookPolygons();
-
} // End of namespace Tinsel
#endif /* TINSEL_POLYGONS_H */
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index fbab7cea7e9..c1832ec7e71 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -456,7 +456,7 @@ static bool DoSync(Common::Serializer &s, int numInterp) {
s.syncAsSint16LE(g_restoreCD);
if (s.isLoading())
- _vm->_dialogs->holdItem(INV_NOICON);
+ _vm->_dialogs->HoldItem(INV_NOICON);
}
@@ -466,17 +466,17 @@ static bool DoSync(Common::Serializer &s, int numInterp) {
// Held object
if (s.isSaving())
- sg = _vm->_dialogs->whichItemHeld();
+ sg = _vm->_dialogs->WhichItemHeld();
s.syncAsSint32LE(sg);
if (s.isLoading()) {
- if (sg != -1 && !_vm->_dialogs->getIsInvObject(sg))
+ if (sg != -1 && !_vm->_dialogs->GetIsInvObject(sg))
// Not a valid inventory object, so return false
return false;
if (TinselVersion >= 2)
g_thingHeld = sg;
else
- _vm->_dialogs->holdItem(sg);
+ _vm->_dialogs->HoldItem(sg);
}
syncTimerInfo(s); // Timer data
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index df8b7a565ba..d49a2662b61 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -387,7 +387,7 @@ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) {
return n;
if (sd == &g_sgData)
- _vm->_dialogs->holdItem(g_thingHeld, true);
+ _vm->_dialogs->HoldItem(g_thingHeld, true);
if (sd->bTinselDim)
_vm->_pcmMusic->dim(true);
_vm->_pcmMusic->restoreThatTune(sd->SavedTune);
@@ -413,7 +413,7 @@ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) {
* @param num num
*/
void RestoreGame(int num) {
- _vm->_dialogs->killInventory();
+ _vm->_dialogs->KillInventory();
RequestRestoreGame(num, &g_sgData, &g_savedSceneCount, g_ssData);
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp
index ef5068989b7..e77ec484754 100644
--- a/engines/tinsel/scene.cpp
+++ b/engines/tinsel/scene.cpp
@@ -390,7 +390,7 @@ void EndScene() {
g_SceneHandle = 0;
}
- _vm->_dialogs->killInventory(); // Close down any open inventory
+ _vm->_dialogs->KillInventory(); // Close down any open inventory
DropPolygons(); // No polygons
_vm->_scroll->DropScroll(); // No no-scrolls
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index e8115ab90f7..508f3b825f0 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -156,7 +156,7 @@ enum MASTER_LIB_CODES {
WALKTAG, WALKXPOS, WALKYPOS, WHICHCD, WHICHINVENTORY, ZZZZZZ, DEC3D, DECINVMAIN,
ADDNOTEBOOK, ADDINV3, ADDCONV, SET3DTEXTURE, FADEMUSIC, VOICEOVER, SETVIEW,
HELDOBJECTORTOPIC, BOOKADDHYPERLINK, OPENNOTEBOOK, NTBPOLYENTRY, NTBPOLYPREVPAGE,
- NTBPOLYNEXTPAGE, CROSSCLUE, HIGHEST_LIBCODE
+ NTBPOLYNEXTPAGE, HIGHEST_LIBCODE
};
static const MASTER_LIB_CODES DW1DEMO_CODES[] = {
@@ -616,7 +616,7 @@ static void ActorsOn() {
* Adds an icon to the conversation window.
*/
static void AddTopic(int icon) {
- _vm->_dialogs->addToInventory(INV_CONV, icon, false);
+ _vm->_dialogs->AddToInventory(INV_CONV, icon, false);
}
/**
@@ -626,7 +626,7 @@ static void AddInv(int invno, int object) {
// illegal inventory number
assert(invno == INV_1 || invno == INV_2 || invno == INV_3 || invno == INV_OPEN || invno == INV_DEFAULT);
- _vm->_dialogs->addToInventory(invno, object, false);
+ _vm->_dialogs->AddToInventory(invno, object, false);
}
/**
@@ -738,7 +738,7 @@ static void ClearHookScene() {
* Guess what.
*/
static void CloseInventory() {
- _vm->_dialogs->killInventory();
+ _vm->_dialogs->KillInventory();
}
/**
@@ -752,11 +752,11 @@ void Control(int param) {
else {
ControlOff();
- switch (_vm->_dialogs->whichInventoryOpen()) {
+ switch (_vm->_dialogs->WhichInventoryOpen()) {
case INV_1:
case INV_2:
case INV_MENU:
- _vm->_dialogs->killInventory();
+ _vm->_dialogs->KillInventory();
break;
default:
break;
@@ -812,7 +812,7 @@ void Control(int param) {
FreeControlToken(); // Release control
- if (!_vm->_dialogs->inventoryActive())
+ if (!_vm->_dialogs->InventoryActive())
EnableTags(); // Tags back on
_vm->_cursor->RestoreMainCursor(); // Re-instate cursor...
@@ -835,7 +835,7 @@ static void Conversation(CORO_PARAM, int fn, HPOLYGON hp, int actor, bool escOn,
if (fn == CONV_END) {
// Close down conversation
- _vm->_dialogs->closeDownConv();
+ _vm->_dialogs->CloseDownConv();
} else if ((fn == CONV_TOP) || (fn == CONV_DEF) || (fn == CONV_BOTTOM)) {
// TOP of screen, Default (i.e. TOP of screen), or BOTTOM of screen
@@ -848,10 +848,10 @@ static void Conversation(CORO_PARAM, int fn, HPOLYGON hp, int actor, bool escOn,
return;
// Don't do it if already in a conversation
- if (_vm->_dialogs->isConvWindow())
+ if (_vm->_dialogs->IsConvWindow())
return;
- _vm->_dialogs->killInventory();
+ _vm->_dialogs->KillInventory();
if (TinselVersion >= 2) {
// If this is from a tag polygon, get the associated
@@ -865,14 +865,14 @@ static void Conversation(CORO_PARAM, int fn, HPOLYGON hp, int actor, bool escOn,
}
// Top or bottom; tag polygon or tagged actor
- _vm->_dialogs->setConvDetails((CONV_PARAM)fn, hp, actor);
+ _vm->_dialogs->SetConvDetails((CONV_PARAM)fn, hp, actor);
} else {
_vm->_dialogs->convPos(fn);
- _vm->_dialogs->convPoly(hp);
+ _vm->_dialogs->ConvPoly(hp);
}
- _vm->_dialogs->popUpInventory(INV_CONV); // Conversation window
- _vm->_dialogs->convAction(INV_OPENICON); // CONVERSATION event
+ _vm->_dialogs->PopUpInventory(INV_CONV); // Conversation window
+ _vm->_dialogs->ConvAction(INV_OPENICON); // CONVERSATION event
}
CORO_END_CODE;
@@ -882,7 +882,7 @@ static void Conversation(CORO_PARAM, int fn, HPOLYGON hp, int actor, bool escOn,
* Add icon to conversation window's permanent default list.
*/
static void ConvTopic(int icon) {
- _vm->_dialogs->permaConvIcon(icon);
+ _vm->_dialogs->PermaConvIcon(icon);
}
/**
@@ -1071,24 +1071,24 @@ static void DecScale(int actor, int scale,
* Remove an icon from the conversation window.
*/
static void DelIcon(int icon) {
- _vm->_dialogs->remFromInventory(INV_CONV, icon);
+ _vm->_dialogs->RemFromInventory(INV_CONV, icon);
}
/**
* Delete the object from inventory 1 or 2.
*/
static void DelInv(int object) {
- if (!_vm->_dialogs->remFromInventory(INV_1, object)) // Remove from inventory 1...
- _vm->_dialogs->remFromInventory(INV_2, object); // ...or 2 (whichever)
+ if (!_vm->_dialogs->RemFromInventory(INV_1, object)) // Remove from inventory 1...
+ _vm->_dialogs->RemFromInventory(INV_2, object); // ...or 2 (whichever)
- _vm->_dialogs->dropItem(object); // Stop holding it
+ _vm->_dialogs->DropItem(object); // Stop holding it
}
/**
* DelTopic
*/
static void DelTopic(int icon) {
- _vm->_dialogs->remFromInventory(INV_CONV, icon);
+ _vm->_dialogs->RemFromInventory(INV_CONV, icon);
}
/**
@@ -1098,20 +1098,20 @@ static void Drop(int object) {
if (object == -1)
object = HeldObject();
- if (!_vm->_dialogs->remFromInventory(INV_1, object)) // Remove from inventory 1...
- _vm->_dialogs->remFromInventory(INV_2, object); // ...or 2 (whichever)
+ if (!_vm->_dialogs->RemFromInventory(INV_1, object)) // Remove from inventory 1...
+ _vm->_dialogs->RemFromInventory(INV_2, object); // ...or 2 (whichever)
- _vm->_dialogs->dropItem(object); // Stop holding it
+ _vm->_dialogs->DropItem(object); // Stop holding it
}
/**
* Delete all objects from inventory 1 and 2.
*/
static void DropEverything() {
- _vm->_dialogs->holdItem(INV_NOICON, false);
+ _vm->_dialogs->HoldItem(INV_NOICON, false);
- _vm->_dialogs->clearInventory(INV_1);
- _vm->_dialogs->clearInventory(INV_2);
+ _vm->_dialogs->ClearInventory(INV_1);
+ _vm->_dialogs->ClearInventory(INV_2);
}
/**
@@ -1200,7 +1200,7 @@ static void FreezeCursor(bool bFreeze) {
* Guess what.
*/
static int GetInvLimit(int invno) {
- return _vm->_dialogs->invGetLimit(invno);
+ return _vm->_dialogs->InvGetLimit(invno);
}
/**
@@ -1230,14 +1230,14 @@ static bool HasRestarted() {
* See if an object is in the inventory.
*/
int Have(int object) {
- return (_vm->_dialogs->inventoryPos(object) != INV_NOICON);
+ return (_vm->_dialogs->InventoryPos(object) != INV_NOICON);
}
/**
* Returns which object is currently held.
*/
static int HeldObject() {
- return _vm->_dialogs->whichItemHeld();
+ return _vm->_dialogs->WhichItemHeld();
}
/**
@@ -1287,7 +1287,7 @@ static void HideTag(CORO_PARAM, int tag, HPOLYGON hp) {
* Hold the specified object.
*/
static void Hold(int object) {
- _vm->_dialogs->holdItem(object, false);
+ _vm->_dialogs->HoldItem(object, false);
}
/**
@@ -1326,14 +1326,14 @@ void InstantScroll(int onoff) {
* invdepict
*/
static void InvDepict(int object, SCNHANDLE hFilm) {
- _vm->_dialogs->setObjectFilm(object, hFilm);
+ _vm->_dialogs->SetObjectFilm(object, hFilm);
}
/**
* See if an object is in the inventory.
*/
int InInventory(int object) {
- return (_vm->_dialogs->inventoryPos(object) != INV_NOICON);
+ return (_vm->_dialogs->InventoryPos(object) != INV_NOICON);
}
/**
@@ -1346,27 +1346,27 @@ static void Inventory(int invno, bool escOn, int myEscape) {
assert((invno == INV_1 || invno == INV_2)); // Trying to open illegal inventory
- _vm->_dialogs->popUpInventory(invno);
+ _vm->_dialogs->PopUpInventory(invno);
}
/**
* Alter inventory object's icon.
*/
static void InvPlay(int object, SCNHANDLE hFilm) {
- _vm->_dialogs->setObjectFilm(object, hFilm);
+ _vm->_dialogs->SetObjectFilm(object, hFilm);
}
/**
* See if an object is in the inventory.
*/
static int InWhichInv(int object) {
- if (_vm->_dialogs->whichItemHeld() == object)
+ if (_vm->_dialogs->WhichItemHeld() == object)
return 0;
- if (_vm->_dialogs->isInInventory(object, INV_1))
+ if (_vm->_dialogs->IsInInventory(object, INV_1))
return 1;
- if (_vm->_dialogs->isInInventory(object, INV_2))
+ if (_vm->_dialogs->IsInInventory(object, INV_2))
return 2;
return -1;
@@ -1502,7 +1502,7 @@ static void NoScroll(int x1, int y1, int x2, int y2) {
* Hold the specified object.
*/
static void ObjectHeld(int object) {
- _vm->_dialogs->holdItem(object);
+ _vm->_dialogs->HoldItem(object);
}
/**
@@ -1526,15 +1526,15 @@ int OtherObject(const InventoryObject *pinvo) {
// return held object or object clicked on - whichever is not the calling object
// pinvo->id is the calling object
- // whichItemHeld() gives the held object
- // getIcon() gives the object clicked on
+ // WhichItemHeld() gives the held object
+ // GetIcon() gives the object clicked on
- assert(_vm->_dialogs->getIcon() == pinvo->getId() || _vm->_dialogs->whichItemHeld() == pinvo->getId());
+ assert(_vm->_dialogs->GetIcon() == pinvo->getId() || _vm->_dialogs->WhichItemHeld() == pinvo->getId());
- if (_vm->_dialogs->getIcon() == pinvo->getId())
- return _vm->_dialogs->whichItemHeld();
+ if (_vm->_dialogs->GetIcon() == pinvo->getId())
+ return _vm->_dialogs->WhichItemHeld();
else
- return _vm->_dialogs->getIcon();
+ return _vm->_dialogs->GetIcon();
}
/**
@@ -2013,7 +2013,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust
// Adjust x, y, or z if necessary
KeepOnScreen(_ctx->pText, &x, &y);
- if (_vm->_dialogs->isTopWindow())
+ if (_vm->_dialogs->IsTopWindow())
MultiSetZPosition(_ctx->pText, Z_TOPW_TEXT);
} else if (bJapDoPrintText || (!_vm->_config->isJapanMode() && (_vm->_config->_useSubtitles || !_ctx->bSample))) {
@@ -2025,7 +2025,7 @@ static void Print(CORO_PARAM, int x, int y, SCNHANDLE text, int time, bool bSust
0, x - Loffset, y - Toffset,
fontHandle, TXT_CENTER);
assert(_ctx->pText); // string produced NULL text
- if (_vm->_dialogs->isTopWindow())
+ if (_vm->_dialogs->IsTopWindow())
MultiSetZPosition(_ctx->pText, Z_TOPW_TEXT);
/*
@@ -2144,7 +2144,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const InventoryObject *p
* Find out which icon the cursor is over, and where to put the text.
*/
_vm->_cursor->GetCursorXY(&_ctx->textx, &_ctx->texty, false); // Cursor position..
- _ctx->item = _vm->_dialogs->invItem(&_ctx->textx, &_ctx->texty, true); // ..to text position
+ _ctx->item = _vm->_dialogs->InvItem(&_ctx->textx, &_ctx->texty, true); // ..to text position
if (_ctx->item == INV_NOICON)
return;
@@ -2219,7 +2219,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const InventoryObject *p
int x, y;
do {
// Give up if this item gets picked up
- if (_vm->_dialogs->whichItemHeld() == pinvo->getId())
+ if (_vm->_dialogs->WhichItemHeld() == pinvo->getId())
break;
// Give way to non-POINTED-generated text
@@ -2231,7 +2231,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const InventoryObject *p
CORO_SLEEP(1);
_vm->_cursor->GetCursorXY(&x, &y, false);
- if (_vm->_dialogs->invItem(&x, &y, false) != _ctx->item)
+ if (_vm->_dialogs->InvItem(&x, &y, false) != _ctx->item)
break;
// Re-display in the same place
@@ -2250,7 +2250,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const InventoryObject *p
// Carry on until the cursor leaves this icon
_vm->_cursor->GetCursorXY(&x, &y, false);
- } while (_vm->_dialogs->invItemId(x, y) == pinvo->getId());
+ } while (_vm->_dialogs->InvItemId(x, y) == pinvo->getId());
} else {
/*
* PrintObj() called from other event
@@ -2270,7 +2270,7 @@ static void PrintObj(CORO_PARAM, const SCNHANDLE hText, const InventoryObject *p
// Abort if sample times out
// Abort if conversation hidden
if (LeftEventChange(_ctx->myLeftEvent)
- || --_ctx->timeout <= 0 || _vm->_dialogs->convIsHidden())
+ || --_ctx->timeout <= 0 || _vm->_dialogs->ConvIsHidden())
break;
if (_ctx->bSample) {
@@ -2334,7 +2334,7 @@ static void PrintObjPointed(CORO_PARAM, const SCNHANDLE text, const InventoryObj
int x, y;
do {
// Give up if this item gets picked up
- if (_vm->_dialogs->whichItemHeld() == pinvo->getId())
+ if (_vm->_dialogs->WhichItemHeld() == pinvo->getId())
break;
// Give way to non-POINTED-generated text
@@ -2345,7 +2345,7 @@ static void PrintObjPointed(CORO_PARAM, const SCNHANDLE text, const InventoryObj
CORO_SLEEP(1);
_vm->_cursor->GetCursorXY(&x, &y, false);
- if (_vm->_dialogs->invItem(&x, &y, false) != item)
+ if (_vm->_dialogs->InvItem(&x, &y, false) != item)
break;
// Re-display in the same place
@@ -2360,7 +2360,7 @@ static void PrintObjPointed(CORO_PARAM, const SCNHANDLE text, const InventoryObj
// Carry on until the cursor leaves this icon
_vm->_cursor->GetCursorXY(&x, &y, false);
- } while (_vm->_dialogs->invItemId(x, y) == pinvo->getId());
+ } while (_vm->_dialogs->InvItemId(x, y) == pinvo->getId());
CORO_END_CODE;
}
@@ -2403,7 +2403,7 @@ static void PrintObjNonPointed(CORO_PARAM, const SCNHANDLE text, const OBJECT *p
// Abort if left click - hardwired feature for talky-print!
// Abort if sample times out
// Abort if conversation hidden
- if (_ctx->myleftEvent != GetLeftEvents() || _ctx->timeout <= 0 || _vm->_dialogs->convIsHidden())
+ if (_ctx->myleftEvent != GetLeftEvents() || _ctx->timeout <= 0 || _vm->_dialogs->ConvIsHidden())
break;
if (_ctx->bSample) {
@@ -2596,7 +2596,7 @@ static void ScalingReels(int actor, int scale, int direction,
* Return the icon that caused the CONVERSE event.
*/
static int ScanIcon() {
- return _vm->_dialogs->getIcon();
+ return _vm->_dialogs->GetIcon();
}
/**
@@ -2749,7 +2749,7 @@ static void SetExit(int exitno) {
* Guess what.
*/
static void SetInvLimit(int invno, int n) {
- _vm->_dialogs->invSetLimit(invno, n);
+ _vm->_dialogs->InvSetLimit(invno, n);
}
/**
@@ -2757,7 +2757,7 @@ static void SetInvLimit(int invno, int n) {
*/
static void SetInvSize(int invno, int MinWidth, int MinHeight,
int StartWidth, int StartHeight, int MaxWidth, int MaxHeight) {
- _vm->_dialogs->invSetSize(invno, MinWidth, MinHeight, StartWidth, StartHeight, MaxWidth, MaxHeight);
+ _vm->_dialogs->InvSetSize(invno, MinWidth, MinHeight, StartWidth, StartHeight, MaxWidth, MaxHeight);
}
/**
@@ -2786,7 +2786,7 @@ static void SetPalette(SCNHANDLE hPal, bool escOn, int myEscape) {
* Set system reel
*/
static void SetSystemReel(int index, SCNHANDLE reel) {
- _vm->_systemReel->set(index, reel);
+ _vm->_systemReel->Set(index, reel);
}
/**
@@ -2867,7 +2867,7 @@ static void showstring() {
* Shows the main menu
*/
static void ShowMenu() {
- _vm->_dialogs->openMenu(MAIN_MENU);
+ _vm->_dialogs->OpenMenu(MAIN_MENU);
}
/**
@@ -3437,7 +3437,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
_vm->_font->GetTalkFontHandle(), TXT_CENTER);
assert(_ctx->pText); // talk() string produced NULL text;
- if (_vm->_dialogs->isTopWindow())
+ if (_vm->_dialogs->IsTopWindow())
MultiSetZPosition(_ctx->pText, Z_TOPW_TEXT);
if ((_ctx->whatSort == IS_SAY) || (_ctx->whatSort == IS_TALK)) {
@@ -3710,7 +3710,7 @@ static int TimerFn(int timerno) {
* Return the icon that caused the CONVERSE event.
*/
int Topic() {
- return _vm->_dialogs->getIcon();
+ return _vm->_dialogs->GetIcon();
}
/**
@@ -3729,10 +3729,10 @@ static void TopPlay(CORO_PARAM, SCNHANDLE hFilm, int x, int y, bool bComplete, i
static void TopWindow(int bpos) {
bool isStart = ((TinselVersion >= 2) && (bpos != 0)) || ((TinselVersion <= 1) && (bpos == TW_START));
- _vm->_dialogs->killInventory();
+ _vm->_dialogs->KillInventory();
if (isStart)
- _vm->_dialogs->openMenu(TOP_WINDOW);
+ _vm->_dialogs->OpenMenu(TOP_WINDOW);
}
/**
@@ -3830,16 +3830,16 @@ static void WaitKey(CORO_PARAM, bool escOn, int myEscape) {
break;
}
- if (_vm->_dialogs->menuActive())
+ if (_vm->_dialogs->MenuActive())
break;
}
- if (!_vm->_dialogs->menuActive())
+ if (!_vm->_dialogs->MenuActive())
return;
do {
CORO_SLEEP(1);
- } while (_vm->_dialogs->menuActive());
+ } while (_vm->_dialogs->MenuActive());
CORO_SLEEP(ONE_SECOND / 2); // Let it die down
}
@@ -4261,7 +4261,7 @@ int WhichCd() {
* whichinventory
*/
int WhichInventory() {
- return _vm->_dialogs->whichInventoryOpen();
+ return _vm->_dialogs->WhichInventoryOpen();
}
@@ -4446,10 +4446,7 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
debug(7, "%s(%08X)", mapping.name, pp[0]);
break;
case 39: // 1 param
- mapping = NoirMapping{"CROSSCLUE", CROSSCLUE, 1};
- pp -= mapping.numArgs - 1;
- debug(7, "%s(0x%08X)", mapping.name, pp[0]);
- break;
+ error("Unsupported libCode %d to set_notebook _entry_bool", libCode);
case 40:
mapping = NoirMapping{"CURSOR", CURSOR, 1};
pp -= mapping.numArgs - 1;
@@ -4498,7 +4495,7 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
pp -= mapping.numArgs - 1;
debug(7, "%s(0x%08X)", mapping.name, pp[0]);
break;
- case 50: // 1 parameter, calls remFromInventory variant of TinselV1
+ case 50: // 1 parameter, calls RemFromInventory variant of TinselV1
error("Unsupported libCode %d del_inv3_item", libCode);
case 51: // 1 parameter
error("Unsupported libCode %d DELTOPIC variant", libCode);
@@ -5398,7 +5395,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
case ADDNOTEBOOK:
// Noir Only
- _vm->_notebook->addClue(pp[0]);
+ warning("TODO: Implement ADDNOTEBOOK");
return -1;
case ADDOPENINV:
@@ -5425,7 +5422,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
case BOOKADDHYPERLINK:
// Noir
pp -= 1; // 2 parameters
- _vm->_notebook->addHyperlink(pp[0], pp[1]);
+ _vm->_notebook->AddHyperlink(pp[0], pp[1]);
return -2;
case BLOCKING:
@@ -5573,11 +5570,6 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
ConvTopic(pp[0]);
return -1;
- case CROSSCLUE:
- // Noir only
- _vm->_notebook->crossClue(pp[0]);
- return -1;
-
case CURSOR:
// DW2 only
ToggleCursor(pp[0]);
@@ -5830,7 +5822,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
case HELDOBJECTORTOPIC:
// Noir
- if (_vm->_dialogs->isConvAndNotMove()) {
+ if (_vm->_dialogs->IsConvAndNotMove()) {
pp[0] = HeldObject();
} else {
pp[0] = Topic();
@@ -6067,7 +6059,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
case OPENNOTEBOOK:
// Noir only
- _vm->_notebook->show(0);
+ _vm->_notebook->Show(0);
return 0;
case PAUSE:
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index eb3a0b8c120..13daadb9006 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -545,8 +545,8 @@ void SetNewScene(SCNHANDLE scene, int entrance, int transition) {
// right items: player must have Mambo the swamp dragon, and mustn't have fireworks (used on
// the swamp dragon previously to "load it up").
if (TinselV1PSX && g_NextScene.scene == 0x1800000 && g_NextScene.entry == 2) {
- if ((_vm->_dialogs->isInInventory(261, INV_1) || _vm->_dialogs->isInInventory(261, INV_2)) &&
- (!_vm->_dialogs->isInInventory(232, INV_1) && !_vm->_dialogs->isInInventory(232, INV_2)))
+ if ((_vm->_dialogs->IsInInventory(261, INV_1) || _vm->_dialogs->IsInInventory(261, INV_2)) &&
+ (!_vm->_dialogs->IsInInventory(232, INV_1) && !_vm->_dialogs->IsInInventory(232, INV_2)))
g_NextScene.entry = 1;
}
}
@@ -809,7 +809,7 @@ void LoadBasicChunks() {
RegisterGlobals(game.numGlobals);
cptr = FindChunk(INV_OBJ_SCNHANDLE, CHUNK_OBJECTS);
- _vm->_dialogs->registerIcons(cptr, game.numObjects);
+ _vm->_dialogs->RegisterIcons(cptr, game.numObjects);
// Max polygons are 0 in the original DW1 V0 demo and in DW1 Mac (both in the demo and the full version)
if (game.numPolygons != 0)
@@ -1238,7 +1238,7 @@ void TinselEngine::CreateConstProcesses() {
* Restart the game
*/
void TinselEngine::RestartGame() {
- _vm->_dialogs->holdItem(INV_NOICON); // Holding nothing
+ _vm->_dialogs->HoldItem(INV_NOICON); // Holding nothing
_bg->DropBackground(); // No background
More information about the Scummvm-git-logs
mailing list