aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-04-19 20:28:36 +0000
committerMatthew Hoops2010-04-19 20:28:36 +0000
commit001bca2d6cf6c211f1d1640a74c9f19d1ef7cca5 (patch)
treeae7630f6b47fa55095b3ac48b12effc808676dd8 /engines/mohawk/riven.cpp
parente6b835bce449ea6dba2a23feef6de627c318bdf3 (diff)
downloadscummvm-rg350-001bca2d6cf6c211f1d1640a74c9f19d1ef7cca5.tar.gz
scummvm-rg350-001bca2d6cf6c211f1d1640a74c9f19d1ef7cca5.tar.bz2
scummvm-rg350-001bca2d6cf6c211f1d1640a74c9f19d1ef7cca5.zip
Remove use of global constructors in Mohawk.
svn-id: r48731
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index d5a4e9b140..805ba52f8a 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -37,6 +37,11 @@
namespace Mohawk {
+Common::Rect *g_atrusJournalRectSolo;
+Common::Rect *g_atrusJournalRect;
+Common::Rect *g_cathJournalRect;
+Common::Rect *g_trapBookRect;
+
MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) {
_showHotspots = false;
_cardData.hasData = false;
@@ -50,6 +55,11 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio
SearchMan.addSubDirectoryMatching(_gameDataDir, "data");
SearchMan.addSubDirectoryMatching(_gameDataDir, "exe");
SearchMan.addSubDirectoryMatching(_gameDataDir, "assets2");
+
+ g_atrusJournalRectSolo = new Common::Rect(295, 402, 313, 426);
+ g_atrusJournalRect = new Common::Rect(222, 402, 240, 426);
+ g_cathJournalRect = new Common::Rect(291, 408, 311, 419);
+ g_trapBookRect = new Common::Rect(363, 396, 386, 432);
}
MohawkEngine_Riven::~MohawkEngine_Riven() {
@@ -62,6 +72,10 @@ MohawkEngine_Riven::~MohawkEngine_Riven() {
delete _loadDialog;
delete _optionsDialog;
delete _rnd;
+ delete g_atrusJournalRectSolo;
+ delete g_atrusJournalRect;
+ delete g_cathJournalRect;
+ delete g_trapBookRect;
_cardData.scripts.clear();
}
@@ -463,21 +477,21 @@ void MohawkEngine_Riven::checkInventoryClick() {
// Go to the book if a hotspot contains the mouse
if (!hasCathBook) {
- if (atrusJournalRectSolo.contains(_mousePos)) {
+ if (g_atrusJournalRectSolo->contains(_mousePos)) {
_gfx->hideInventory();
changeToStack(aspit);
changeToCard(5);
}
} else {
- if (atrusJournalRect.contains(_mousePos)) {
+ if (g_atrusJournalRect->contains(_mousePos)) {
_gfx->hideInventory();
changeToStack(aspit);
changeToCard(5);
- } else if (cathJournalRect.contains(_mousePos)) {
+ } else if (g_cathJournalRect->contains(_mousePos)) {
_gfx->hideInventory();
changeToStack(aspit);
changeToCard(6);
- } else if (trapBookRect.contains(_mousePos)) {
+ } else if (g_trapBookRect->contains(_mousePos)) {
_gfx->hideInventory();
changeToStack(aspit);
changeToCard(7);