diff options
Diffstat (limited to 'engines/wintermute')
6 files changed, 12 insertions, 19 deletions
diff --git a/engines/wintermute/base/base_save_thumb_helper.cpp b/engines/wintermute/base/base_save_thumb_helper.cpp index 68cfb8a7ea..9f87f392e5 100644 --- a/engines/wintermute/base/base_save_thumb_helper.cpp +++ b/engines/wintermute/base/base_save_thumb_helper.cpp @@ -65,7 +65,7 @@ bool BaseSaveThumbHelper::storeThumbnail(bool doFlip) { // normal thumbnail
if (_gameRef->_thumbnailWidth > 0 && _gameRef->_thumbnailHeight > 0) {
- _thumbnail = new BaseImage(_gameRef);
+ _thumbnail = new BaseImage(_gameRef->_fileManager);
_thumbnail->copyFrom(screenshot, _gameRef->_thumbnailWidth, _gameRef->_thumbnailHeight);
}
diff --git a/engines/wintermute/base/gfx/base_image.cpp b/engines/wintermute/base/gfx/base_image.cpp index 533c3a866e..bdc7cb76e2 100644 --- a/engines/wintermute/base/gfx/base_image.cpp +++ b/engines/wintermute/base/gfx/base_image.cpp @@ -26,9 +26,7 @@ * Copyright (c) 2011 Jan Nedoma
*/
-#include "engines/wintermute/dcgf.h"
#include "engines/wintermute/base/gfx/base_image.h"
-#include "engines/wintermute/base/base_game.h"
#include "engines/wintermute/base/base_file_manager.h"
#include "engines/wintermute/graphics/transparent_surface.h"
#include "engines/wintermute/utils/string_util.h"
@@ -44,11 +42,8 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-BaseImage::BaseImage(BaseGame *inGame, FIBITMAP *bitmap): BaseClass(inGame) {
-#if 0
- _bitmap = bitmap;
-#endif
- _bitmap = NULL;
+BaseImage::BaseImage(BaseFileManager *fileManager) {
+ _fileManager = fileManager;
_palette = NULL;
_surface = NULL;
_decoder = NULL;
@@ -86,13 +81,13 @@ bool BaseImage::loadFile(const Common::String &filename) { error("BaseImage::loadFile : Unsupported fileformat %s", filename.c_str());
}
_filename = filename;
- Common::SeekableReadStream *file = _gameRef->_fileManager->openFile(filename.c_str());
+ Common::SeekableReadStream *file = _fileManager->openFile(filename.c_str());
if (!file) return STATUS_FAILED;
_decoder->loadStream(*file);
_surface = _decoder->getSurface();
_palette = _decoder->getPalette();
- _gameRef->_fileManager->closeFile(file);
+ _fileManager->closeFile(file);
return STATUS_OK;
}
diff --git a/engines/wintermute/base/gfx/base_image.h b/engines/wintermute/base/gfx/base_image.h index 4b43e36a6d..7f344b5c1c 100644 --- a/engines/wintermute/base/gfx/base_image.h +++ b/engines/wintermute/base/gfx/base_image.h @@ -29,7 +29,6 @@ #ifndef WINTERMUTE_BIMAGE_H
#define WINTERMUTE_BIMAGE_H
-#include "engines/wintermute/base/base.h"
#include "graphics/surface.h"
#include "graphics/pixelformat.h"
#include "graphics/decoders/image_decoder.h"
@@ -37,14 +36,13 @@ #include "common/str.h"
#include "common/stream.h"
-struct FIBITMAP;
-
namespace WinterMute {
class BaseSurface;
-class BaseImage: BaseClass {
+class BaseFileManager;
+class BaseImage {
public:
- BaseImage(BaseGame *inGame, FIBITMAP *bitmap = NULL);
+ BaseImage(BaseFileManager *fileManager);
~BaseImage();
bool loadFile(const Common::String &filename);
@@ -63,10 +61,10 @@ public: private:
Common::String _filename;
Graphics::ImageDecoder *_decoder;
- FIBITMAP *_bitmap;
const Graphics::Surface *_surface;
Graphics::Surface *_deletableSurface;
const byte *_palette;
+ BaseFileManager *_fileManager;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index ec69a80095..24e3ddb0ae 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -561,7 +561,7 @@ bool BaseRenderOSystem::drawLine(int x1, int y1, int x2, int y2, uint32 color) { BaseImage *BaseRenderOSystem::takeScreenshot() {
// TODO: Fix this
warning("BaseRenderOSystem::TakeScreenshot() - not ported yet");
- BaseImage *screenshot = new BaseImage(_gameRef);
+ BaseImage *screenshot = new BaseImage(_gameRef->_fileManager);
screenshot->copyFrom(_renderSurface);
return screenshot;
#if 0
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 772f7c35ba..c8cbe99f73 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -117,7 +117,7 @@ bool BaseSurfaceOSystem::create(const char *filename, bool defaultCK, byte ckRed }
bool BaseSurfaceOSystem::finishLoad() {
- BaseImage *image = new BaseImage(_gameRef);
+ BaseImage *image = new BaseImage(_gameRef->_fileManager);
if (!image->loadFile(_filename)) {
return false;
}
diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 91161cbd3b..f20d4470ac 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -672,7 +672,7 @@ bool VideoTheoraPlayer::setAlphaImage(const Common::String &filename) { warning("VideoTheoraPlayer::SetAlphaImage(%s) - Not implemented", filename.c_str()); delete _alphaImage; - _alphaImage = new BaseImage(_gameRef); + _alphaImage = new BaseImage(_gameRef->_fileManager); if (!_alphaImage || DID_FAIL(_alphaImage->loadFile(filename))) { delete _alphaImage; _alphaImage = NULL; |