diff options
Diffstat (limited to 'engines/titanic/support/direct_draw_surface.cpp')
-rw-r--r-- | engines/titanic/support/direct_draw_surface.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/titanic/support/direct_draw_surface.cpp b/engines/titanic/support/direct_draw_surface.cpp index 9ebda15b0e..126cebfaeb 100644 --- a/engines/titanic/support/direct_draw_surface.cpp +++ b/engines/titanic/support/direct_draw_surface.cpp @@ -38,8 +38,12 @@ void DirectDrawSurface::create(Graphics::ManagedSurface *surface) { _disposeAfterUse = DisposeAfterUse::NO; } -void DirectDrawSurface::create(int w, int h) { - Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); +void DirectDrawSurface::create(int w, int h, int bpp) { + assert(bpp == 16 || bpp == 32); + Graphics::PixelFormat pixelFormat = (bpp == 32) ? + Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0) : + Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); + _surface = new Graphics::ManagedSurface(w, h, pixelFormat); _disposeAfterUse = DisposeAfterUse::YES; } |