aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMax Horn2010-02-13 17:42:49 +0000
committerMax Horn2010-02-13 17:42:49 +0000
commitac4d325e0d61b649026a5f5414f749697b285ccc (patch)
treec58f62596d050be62e98180c0255e7998a9a62e4 /engines/sci/graphics
parent24fd77eb242c4d90e8c3a3b0bcc5f0c48a4dc77f (diff)
downloadscummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.tar.gz
scummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.tar.bz2
scummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.zip
SCI: Add global g_sci pointer to the active SciEngine instance
svn-id: r48046
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/frameout.cpp2
-rw-r--r--engines/sci/graphics/menu.cpp6
-rw-r--r--engines/sci/graphics/palette.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 4f4b0a9aea..79cbc6c669 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -239,7 +239,7 @@ void GfxFrameout::kernelFrameout() {
// TODO: rewrite this the "SCI2" way (i.e. implement the text buffer to draw inside kCreateTextBitmap)
// This doesn't work for SCI2.1 games...
if (getSciVersion() == SCI_VERSION_2) {
- Kernel *kernel = ((SciEngine *)g_engine)->getKernel();
+ Kernel *kernel = g_sci->getKernel();
if (lookup_selector(_segMan, itemEntry->object, kernel->_selectorCache.text, NULL, NULL) == kSelectorVariable) {
Common::String text = _segMan->getString(GET_SEL32(_segMan, itemEntry->object, SELECTOR(text)));
int16 fontRes = GET_SEL32V(_segMan, itemEntry->object, SELECTOR(font));
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index beeed27885..69b38df2e8 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -190,7 +190,7 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t
if (separatorCount == tempPos - beginPos) {
itemEntry->separatorLine = true;
} else {
- EngineState *s = ((SciEngine *)g_engine)->getEngineState(); // HACK: needed for strSplit()
+ EngineState *s = g_sci->getEngineState(); // HACK: needed for strSplit()
itemEntry->text = s->strSplit(Common::String(content.c_str() + beginPos, tempPos - beginPos).c_str());
// LSL6 uses "Ctrl-" prefix string instead of ^ like all the other games do
@@ -250,7 +250,7 @@ GuiMenuItemEntry *GfxMenu::findItem(uint16 menuId, uint16 itemId) {
}
void GfxMenu::kernelSetAttribute(uint16 menuId, uint16 itemId, uint16 attributeId, reg_t value) {
- EngineState *s = ((SciEngine *)g_engine)->getEngineState(); // HACK: needed for strSplit()
+ EngineState *s = g_sci->getEngineState(); // HACK: needed for strSplit()
GuiMenuItemEntry *itemEntry = findItem(menuId, itemId);
if (!itemEntry)
error("Tried to setAttribute() on non-existant menu-item %d:%d", menuId, itemId);
@@ -391,7 +391,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject) {
case SCI_EVENT_SAID:
// HACK: should be removed as soon as said() is cleaned up
- s = ((SciEngine *)g_engine)->getEngineState();
+ s = g_sci->getEngineState();
while (itemIterator != itemEnd) {
itemEntry = *itemIterator;
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 3652605a44..09b51117e0 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -442,7 +442,7 @@ void GfxPalette::startPalVary(uint16 paletteId, uint16 ticks) {
_palVaryId = paletteId;
_palVaryStart = g_system->getMillis();
_palVaryEnd = _palVaryStart + ticks * 1000 / 60;
- ((SciEngine*)g_engine)->getTimerManager()->installTimerProc(&palVaryCallback, 1000 / 60, this);
+ g_sci->getTimerManager()->installTimerProc(&palVaryCallback, 1000 / 60, this);
}
void GfxPalette::togglePalVary(bool pause) {
@@ -453,7 +453,7 @@ void GfxPalette::togglePalVary(bool pause) {
}
void GfxPalette::stopPalVary() {
- ((SciEngine*)g_engine)->getTimerManager()->removeTimerProc(&palVaryCallback);
+ g_sci->getTimerManager()->removeTimerProc(&palVaryCallback);
_palVaryId = -1; // invalidate the target palette
// HACK: just set the target palette