aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorBertrand Augereau2003-06-04 23:03:23 +0000
committerBertrand Augereau2003-06-04 23:03:23 +0000
commit69b55ea45f11b8a11b23d9092a706355b06b617a (patch)
tree18404d6815a5529d9fd5aa23fb5a5aa3b0304fa7 /scumm
parentffef453d1a34bc29604fd4339db0b8a317c267d4 (diff)
downloadscummvm-rg350-69b55ea45f11b8a11b23d9092a706355b06b617a.tar.gz
scummvm-rg350-69b55ea45f11b8a11b23d9092a706355b06b617a.tar.bz2
scummvm-rg350-69b55ea45f11b8a11b23d9092a706355b06b617a.zip
put a setFeatures member that allows to precompute game-wide stuff, such as CostumeRenderer, when features change, ie extremely rarely
svn-id: r8301
Diffstat (limited to 'scumm')
-rw-r--r--scumm/dialogs.cpp5
-rw-r--r--scumm/scumm.h5
-rw-r--r--scumm/scummvm.cpp7
3 files changed, 13 insertions, 4 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index 3c619507d3..d6a7e08d01 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -531,9 +531,10 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
// Amiga palette?
if (amigaPalCheckbox->getState())
- _scumm->_features |= GF_AMIGA;
+ _scumm->setFeatures (_scumm->_features | GF_AMIGA);
else
- _scumm->_features &= ~GF_AMIGA;
+ _scumm->setFeatures (_scumm->_features & (~GF_AMIGA));
+
g_config->setBool("amiga", amigaPalCheckbox->getState());
// Finally flush the modified config
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 494ca4638b..8ac28ddd55 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -270,7 +270,10 @@ public:
IMuse *_imuse;
IMuseDigital *_imuseDigital;
Player_V2 *_playerV2;
- uint32 _features;
+
+ uint32 _features; // Should only be accessed for reading (TODO enforce it compiler-wise with making it private and creating an accessor)
+ void setFeatures (uint32 newFeatures); // Changes the features set. This allows some gamewide stuff to be precalculated/prepared (ie CostumeRenderer)
+
VerbSlot *_verbs;
ObjectData *_objs;
ScummDebugger *_debugger;
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 25f6810174..20a4cdc15e 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -548,7 +548,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
_exe_name = strdup(detector->_gameRealName.c_str()); // FIXME: probably should use String class here
_game_name = strdup(detector->_gameFileName.c_str());
_gameId = detector->_gameId;
- _features = detector->_features;
+ setFeatures (detector->_features);
_noSubtitles = detector->_noSubtitles;
_defaultTalkDelay = detector->_talkSpeed;
_use_adlib = detector->_use_adlib;
@@ -732,6 +732,11 @@ Scumm::~Scumm ()
delete g_debugger;
}
+void Scumm::setFeatures (uint32 newFeatures)
+{
+ _features = newFeatures;
+}
+
void Scumm::scummInit() {
int i;