diff options
author | Paul Gilbert | 2012-09-09 20:28:04 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-09-09 20:28:04 +1000 |
commit | 56c454fcb5db788ccdb662bc19e1675a72d73f8d (patch) | |
tree | 2f7ce5f2002ce2da7c2c214e3dee80a6f54a98ec /engines/hopkins | |
parent | 8fd0d0629a79d0e7813c7219dbab90a30c3b2bfe (diff) | |
download | scummvm-rg350-56c454fcb5db788ccdb662bc19e1675a72d73f8d.tar.gz scummvm-rg350-56c454fcb5db788ccdb662bc19e1675a72d73f8d.tar.bz2 scummvm-rg350-56c454fcb5db788ccdb662bc19e1675a72d73f8d.zip |
HOPKINS: Fix some obvious crashes in image loading
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/graphics.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 870d947ffe..ebe01405e0 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -55,9 +55,10 @@ GraphicsManager::GraphicsManager() { } GraphicsManager::~GraphicsManager() { + VESA_SCREEN.free(); + VESA_BUFFER.free(); } - void GraphicsManager::SET_MODE(int width, int height) { if (!SDL_MODEYES) { SDL_ECHELLE = 0; @@ -85,16 +86,17 @@ void GraphicsManager::SET_MODE(int width, int height) { //height = Reel_Zoom(height, SDL_ECHELLE); } + Graphics::PixelFormat pixelFormat16(2, 5, 5, 5, 0, 10, 5, 0, 0); + if (bpp == 8) { initGraphics(width, height, true); } else { - Graphics::PixelFormat pixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); - initGraphics(width, height, true, &pixelFormat); + initGraphics(width, height, true, &pixelFormat16); } // Init surfaces - //VESA_SCREEN = dos_malloc2(0x96000u); - //VESA_BUFFER = dos_malloc2(0x96000u); + VESA_SCREEN.create(SCREEN_WIDTH, SCREEN_HEIGHT, pixelFormat16); + VESA_BUFFER.create(SCREEN_WIDTH, SCREEN_HEIGHT, pixelFormat16); VideoPtr = NULL; XSCREEN = width; @@ -133,7 +135,7 @@ void GraphicsManager::Cls_Video() { } void GraphicsManager::LOAD_IMAGE(const Common::String &file) { - Common::String filename = Common::String::format("%s.PCX", file); + Common::String filename = Common::String::format("%s.PCX", file.c_str()); CHARGE_ECRAN(filename); GraphicsManager::INIT_TABLE(165, 170, Palette); } |