aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-17 19:13:05 -0400
committerPaul Gilbert2016-03-17 19:13:05 -0400
commite80a15170640a495b5c7861abeea71d0325684cd (patch)
treedcf58d3bf5053f3d386fb1bdef54ab25b830b0d4 /engines/titanic
parent8a1d238fd59a6aef21f74721f039cc0375c18a24 (diff)
downloadscummvm-rg350-e80a15170640a495b5c7861abeea71d0325684cd.tar.gz
scummvm-rg350-e80a15170640a495b5c7861abeea71d0325684cd.tar.bz2
scummvm-rg350-e80a15170640a495b5c7861abeea71d0325684cd.zip
TITANIC: Fix image decoders
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/direct_draw.cpp4
-rw-r--r--engines/titanic/game_view.cpp1
-rw-r--r--engines/titanic/image_decoders.cpp6
-rw-r--r--engines/titanic/video_surface.cpp2
-rw-r--r--engines/titanic/video_surface.h3
5 files changed, 11 insertions, 5 deletions
diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index d5a8cf2409..551be5b87e 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -48,7 +48,9 @@ void DirectDraw::diagnostics() {
DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc) {
DirectDrawSurface *surface = new DirectDrawSurface();
- surface->create(desc._w, desc._h, Graphics::PixelFormat::createFormatCLUT8());
+
+ Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+ surface->create(desc._w, desc._h, pixelFormat);
return surface;
}
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 315b2a8909..bf901bb704 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -54,6 +54,7 @@ void CGameView::createSurface(const CResourceKey &key) {
// Create a fresh surface
CScreenManager::setCurrent();
_surface = CScreenManager::_currentScreenManagerPtr->createSurface(key);
+ _surface->_field3C = true;
}
/*------------------------------------------------------------------------*/
diff --git a/engines/titanic/image_decoders.cpp b/engines/titanic/image_decoders.cpp
index e6e547f009..721342ef6d 100644
--- a/engines/titanic/image_decoders.cpp
+++ b/engines/titanic/image_decoders.cpp
@@ -34,7 +34,8 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
const Graphics::Surface *srcSurf = getSurface();
// Resize the surface if necessary
- if (surface.getWidth() != srcSurf->w || surface.getHeight() != srcSurf->h)
+ if (!surface.hasSurface() || surface.getWidth() != srcSurf->w
+ || surface.getHeight() != srcSurf->h)
surface.resize(srcSurf->w, srcSurf->h);
// Convert the decoded surface to the correct pixel format, and then copy it over
@@ -60,7 +61,8 @@ void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
const Graphics::Surface *srcSurf = getSurface();
// Resize the surface if necessary
- if (surface.getWidth() != srcSurf->w || surface.getHeight() != srcSurf->h)
+ if (!surface.hasSurface() || surface.getWidth() != srcSurf->w
+ || surface.getHeight() != srcSurf->h)
surface.resize(srcSurf->w, srcSurf->h);
// Convert the decoded surface to the correct pixel format, and then copy it over
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index fdb9224001..08ba64ac75 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -30,7 +30,7 @@ int CVideoSurface::_videoSurfaceCounter = 0;
CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
_screenManager(screenManager), _rawSurface(nullptr),
- _field34(nullptr), _pendingLoad(false), _field3C(0), _field40(0),
+ _field34(nullptr), _pendingLoad(false), _field3C(false), _field40(0),
_field44(4), _field48(0), _field50(1) {
_videoSurfaceNum = _videoSurfaceCounter++;
}
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 412b50f66c..47caffdcaf 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -48,7 +48,6 @@ protected:
Graphics::Surface *_rawSurface;
void *_field34;
bool _pendingLoad;
- int _field3C;
int _field40;
int _field44;
int _field48;
@@ -56,6 +55,8 @@ protected:
int _field50;
int _lockCount;
public:
+ bool _field3C;
+public:
CVideoSurface(CScreenManager *screenManager);
virtual ~CVideoSurface();