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 /engines/titanic/video_surface.cpp | |
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
Diffstat (limited to 'engines/titanic/video_surface.cpp')
-rw-r--r-- | engines/titanic/video_surface.cpp | 18 |
1 files changed, 12 insertions, 6 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(); } |