aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-10-02 04:46:50 +0000
committerTorbjörn Andersson2006-10-02 04:46:50 +0000
commitd7b786ea41838b6c3fe950fe01c97b97daca711d (patch)
tree455791fd73d3850c3909c688f63c11256ee64811
parent42cb69827eaab991912022c28be09f2addffe55e (diff)
downloadscummvm-rg350-d7b786ea41838b6c3fe950fe01c97b97daca711d.tar.gz
scummvm-rg350-d7b786ea41838b6c3fe950fe01c97b97daca711d.tar.bz2
scummvm-rg350-d7b786ea41838b6c3fe950fe01c97b97daca711d.zip
Implemented "iconify window" opcode. This, of course, needs support in the
backend to work, and so far it's only done in the SDL backend. See the new kFeatureIconifyWindow flag. (This is patch #1568775.) svn-id: r24060
-rw-r--r--backends/platform/sdl/sdl.cpp7
-rw-r--r--common/system.cpp1
-rw-r--r--common/system.h7
-rw-r--r--engines/agos/agos.h2
-rw-r--r--engines/agos/items.cpp8
5 files changed, 19 insertions, 6 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index ca00349020..5f76d21c9d 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -227,7 +227,8 @@ bool OSystem_SDL::hasFeature(Feature f) {
(f == kFeatureFullscreenMode) ||
(f == kFeatureAspectRatioCorrection) ||
(f == kFeatureAutoComputeDirtyRects) ||
- (f == kFeatureCursorHasPalette);
+ (f == kFeatureCursorHasPalette) ||
+ (f == kFeatureIconifyWindow);
}
void OSystem_SDL::setFeatureState(Feature f, bool enable) {
@@ -244,6 +245,10 @@ void OSystem_SDL::setFeatureState(Feature f, bool enable) {
else
_modeFlags &= ~DF_WANT_RECT_OPTIM;
break;
+ case kFeatureIconifyWindow:
+ if (enable)
+ SDL_WM_IconifyWindow();
+ break;
default:
break;
}
diff --git a/common/system.cpp b/common/system.cpp
index 22bbb9aba4..614dff6199 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -83,4 +83,3 @@ void OSystem::stopCD() {
void OSystem::updateCD() {
}
-
diff --git a/common/system.h b/common/system.h
index 91ea05b928..9508520cc1 100644
--- a/common/system.h
+++ b/common/system.h
@@ -128,7 +128,12 @@ public:
* This should only be set if it offers at least 3-4 bits of accuracy,
* as opposed to a single alpha bit.
*/
- kFeatureOverlaySupportsAlpha
+ kFeatureOverlaySupportsAlpha,
+
+ /**
+ * Set to true to iconify the window.
+ */
+ kFeatureIconifyWindow
};
/**
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 8f0aba39c2..1f11c69690 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1088,7 +1088,7 @@ public:
void o3_b3NotZero();
// Opcodes, Puzzle Pack only
- void o4_opcode30();
+ void o4_iconifyWindow();
void o4_restoreOopsPosition();
void o4_checkTiles();
void o4_loadMouseImage();
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 95925669c6..5953abd45e 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -435,7 +435,7 @@ void AGOSEngine::setupPuzzleOpcodes(OpcodeProc *op) {
setupAGOSOpcodes(op);
op[23] = &AGOSEngine::o3_chance;
- op[30] = &AGOSEngine::o4_opcode30;
+ op[30] = &AGOSEngine::o4_iconifyWindow;
op[32] = &AGOSEngine::o4_restoreOopsPosition;
op[37] = &AGOSEngine::o4_checkTiles;
op[38] = &AGOSEngine::o4_loadMouseImage;
@@ -2440,9 +2440,13 @@ void AGOSEngine::o3_b3NotZero() {
// Puzzle Pack Opcodes
// -----------------------------------------------------------------------
-void AGOSEngine::o4_opcode30() {
+void AGOSEngine::o4_iconifyWindow() {
// 30
getNextItemPtr();
+ if (_clockStopped != 0)
+ _gameTime += time(NULL) - _clockStopped;
+ _clockStopped = 0;
+ _system->setFeatureState(OSystem::kFeatureIconifyWindow, true);
}
void AGOSEngine::o4_restoreOopsPosition() {