diff options
author | richiesams | 2013-08-03 15:00:15 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:33:10 -0500 |
commit | 8bbc260b8642d08c049acb81546e82bc88100ee2 (patch) | |
tree | f5b18ae306e8a4715008349b617fcc29c8d9c8dd /engines/zvision | |
parent | 11118262e4d884a838ac8ce0f8d674948aac1d33 (diff) | |
download | scummvm-rg350-8bbc260b8642d08c049acb81546e82bc88100ee2.tar.gz scummvm-rg350-8bbc260b8642d08c049acb81546e82bc88100ee2.tar.bz2 scummvm-rg350-8bbc260b8642d08c049acb81546e82bc88100ee2.zip |
ZVISION: Create RenderManager method to set the current background image
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/render_manager.cpp | 16 | ||||
-rw-r--r-- | engines/zvision/render_manager.h | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp index 4fd1a83088..b6163c83c1 100644 --- a/engines/zvision/render_manager.cpp +++ b/engines/zvision/render_manager.cpp @@ -24,6 +24,7 @@ #include "common/file.h" #include "common/system.h" +#include "common/stream.h" #include "engines/util.h" #include "graphics/decoders/tga.h" @@ -39,6 +40,7 @@ RenderManager::RenderManager(OSystem *system, const int width, const int height) _height(height), _pixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555 _currentVideo(0), + _currentBackground(0), _scaledVideoFrameBuffer(0), _needsScreenUpdate(false), _renderTable(width, height) { @@ -155,4 +157,18 @@ RenderTable *RenderManager::getRenderTable() { return &_renderTable; } +void RenderManager::setBackgroundImage(const Common::String &fileName) { + Common::File *file = new Common::File; + + if (!file->open(fileName)) { + warning("Could not open file %s", fileName.c_str()); + return; + } + + _currentBackground = file; + + // TODO: Check if all the panoramas are the same height. AKA: can we hardcode the vertical centering to 80px? + renderImageToScreen(*_currentBackground, 0, 80); +} + } // End of namespace ZVision diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h index f9d1375ecf..fc2598ecf9 100644 --- a/engines/zvision/render_manager.h +++ b/engines/zvision/render_manager.h @@ -54,6 +54,8 @@ private: const Graphics::PixelFormat _pixelFormat; RenderTable _renderTable; + Common::SeekableReadStream *_currentBackground; + Video::VideoDecoder *_currentVideo; byte *_scaledVideoFrameBuffer; @@ -101,6 +103,14 @@ public: */ void renderImageToScreen(Common::SeekableReadStream &stream, uint32 destinationX, uint32 destinationY, Common::Rect subRectangle = Common::Rect(0, 0, 0, 0)); + /** + * Sets the current background image to be used by the RenderManager and immediately + * blits it to the screen. (It won't show up until the end of the frame) + * + * @param fileName The name of the image file + */ + void setBackgroundImage(const Common::String &fileName); + RenderTable *getRenderTable(); bool needsScreenUpdate() { return _needsScreenUpdate; }; |