aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMax Horn2006-08-04 13:10:28 +0000
committerMax Horn2006-08-04 13:10:28 +0000
commitca7880df6cbbb7fbc5bf58230f2f6255b0289b37 (patch)
tree9749fb5571e7ffe11e2e96ac0b1fc6819b81787c /backends
parentaf3241f70035db44a7510d4558a52bd7e1e92722 (diff)
downloadscummvm-rg350-ca7880df6cbbb7fbc5bf58230f2f6255b0289b37.tar.gz
scummvm-rg350-ca7880df6cbbb7fbc5bf58230f2f6255b0289b37.tar.bz2
scummvm-rg350-ca7880df6cbbb7fbc5bf58230f2f6255b0289b37.zip
Added new method OSystem::getScreenChangeID(), which can be used by code to track screen changes even without getting all EVENT_SCREEN_CHANGED events
svn-id: r23661
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/sdl/events.cpp1
-rw-r--r--backends/platform/sdl/sdl-common.h3
-rw-r--r--backends/platform/sdl/sdl.cpp2
-rw-r--r--backends/platform/wince/wince-sdl.cpp1
4 files changed, 6 insertions, 1 deletions
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index 72afad36df..22bf8f9564 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -180,6 +180,7 @@ bool OSystem_SDL::pollEvent(Event &event) {
if (_modeChanged) {
_modeChanged = false;
event.type = EVENT_SCREEN_CHANGED;
+ _screenChangeCount++;
return true;
}
diff --git a/backends/platform/sdl/sdl-common.h b/backends/platform/sdl/sdl-common.h
index f4c9383c63..093e7950f9 100644
--- a/backends/platform/sdl/sdl-common.h
+++ b/backends/platform/sdl/sdl-common.h
@@ -69,6 +69,8 @@ public:
// Typically, 320x200
virtual void initSize(uint w, uint h); // overloaded by CE backend
+ virtual int getScreenChangeID() const { return _screenChangeCount; }
+
// Set colors of the palette
void setPalette(const byte *colors, uint start, uint num);
@@ -265,6 +267,7 @@ protected:
/** Current video mode flags (see DF_* constants) */
uint32 _modeFlags;
bool _modeChanged;
+ int _screenChangeCount;
/** True if aspect ratio correction is enabled. */
bool _adjustAspectRatio;
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index b6d2d675df..ca00349020 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -178,7 +178,7 @@ OSystem_SDL::OSystem_SDL()
_overlayVisible(false),
_overlayscreen(0), _tmpscreen2(0),
_samplesPerSec(0),
- _cdrom(0), _scalerProc(0), _modeChanged(false), _dirtyChecksums(0),
+ _cdrom(0), _scalerProc(0), _modeChanged(false), _screenChangeCount(0), _dirtyChecksums(0),
_mouseVisible(false), _mouseDrawn(false), _mouseData(0), _mouseSurface(0),
_mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true),
_joystick(0),
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 6ba02e3949..f29c3dde96 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -2082,6 +2082,7 @@ bool OSystem_WINCE3::pollEvent(Event &event) {
if (_modeChanged) {
_modeChanged = false;
event.type = EVENT_SCREEN_CHANGED;
+ screenChangeCount++;
return true;
}