diff options
author | Paul Gilbert | 2016-03-29 07:35:56 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-29 07:35:56 -0400 |
commit | d183a7b4f98b2b0d1c51e80c40bf16e61b0f604e (patch) | |
tree | 4d27c1e3a5bd86294c743ea3497c3eb232f26336 | |
parent | d810e626ae70554bbc994393811b5b8a13cfeeb0 (diff) | |
download | scummvm-rg350-d183a7b4f98b2b0d1c51e80c40bf16e61b0f604e.tar.gz scummvm-rg350-d183a7b4f98b2b0d1c51e80c40bf16e61b0f604e.tar.bz2 scummvm-rg350-d183a7b4f98b2b0d1c51e80c40bf16e61b0f604e.zip |
TITANIC: Fix initial loading of game object images
-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 |