diff options
-rw-r--r-- | engines/titanic/video_surface.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/video_surface.h | 12 |
2 files changed, 18 insertions, 12 deletions
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp index 1708504a80..8a723cce07 100644 --- a/engines/titanic/video_surface.cpp +++ b/engines/titanic/video_surface.cpp @@ -223,18 +223,24 @@ bool OSVideoSurface::hasSurface() { return _ddSurface != nullptr; } -int OSVideoSurface::getWidth() const { - assert(_ddSurface); +int OSVideoSurface::getWidth() { + if (!loadIfReady()) + error("Could not load resource"); + return _ddSurface->getWidth(); } -int OSVideoSurface::getHeight() const { - assert(_ddSurface); +int OSVideoSurface::getHeight() { + if (!loadIfReady()) + error("Could not load resource"); + return _ddSurface->getHeight(); } -int OSVideoSurface::getPitch() const { - assert(_ddSurface); +int OSVideoSurface::getPitch() { + if (!loadIfReady()) + error("Could not load resource"); + return _ddSurface->getPitch(); } diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h index 6090861404..ad8cb34277 100644 --- a/engines/titanic/video_surface.h +++ b/engines/titanic/video_surface.h @@ -115,17 +115,17 @@ public: /** * Returns the width of the surface */ - virtual int getWidth() const = 0; + virtual int getWidth() = 0; /** * Returns the height of the surface */ - virtual int getHeight() const = 0; + virtual int getHeight() = 0; /** * Returns the pitch of the surface in bytes */ - virtual int getPitch() const = 0; + virtual int getPitch() = 0; /** * Reiszes the surface @@ -236,17 +236,17 @@ public: /** * Returns the width of the surface */ - virtual int getWidth() const; + virtual int getWidth(); /** * Returns the height of the surface */ - virtual int getHeight() const; + virtual int getHeight(); /** * Returns the pitch of the surface in bytes */ - virtual int getPitch() const; + virtual int getPitch(); /** * Reiszes the surface |