diff options
author | richiesams | 2013-07-19 11:07:05 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:32:30 -0500 |
commit | 6d7541a43040ee6791bf0099ddff9645753ac24b (patch) | |
tree | cc7d9d1a7f2ad4fcd8881822d2be76b923de0f5e /engines | |
parent | 94000e07811831f1ffdb2575b0cc3513c34a1d36 (diff) | |
download | scummvm-rg350-6d7541a43040ee6791bf0099ddff9645753ac24b.tar.gz scummvm-rg350-6d7541a43040ee6791bf0099ddff9645753ac24b.tar.bz2 scummvm-rg350-6d7541a43040ee6791bf0099ddff9645753ac24b.zip |
ZVISION: Create RenderManager class and move code from image.cpp
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/render_manager.cpp (renamed from engines/zvision/image.cpp) | 11 | ||||
-rw-r--r-- | engines/zvision/render_manager.h | 70 |
2 files changed, 76 insertions, 5 deletions
diff --git a/engines/zvision/image.cpp b/engines/zvision/render_manager.cpp index c4823813dc..671e7c0136 100644 --- a/engines/zvision/image.cpp +++ b/engines/zvision/render_manager.cpp @@ -27,12 +27,14 @@ #include "graphics/decoders/tga.h" -#include "zvision/zvision.h" +#include "zvision/render_manager.h" #include "zvision/lzss_read_stream.h" namespace ZVision { -void ZVision::renderImageToScreen(const Common::String &fileName, uint32 x, uint32 y) { +RenderManager::RenderManager(OSystem *system) : _system(system) {} + +void RenderManager::renderImageToScreen(const Common::String &fileName, uint32 x, uint32 y) { Common::File file; if (!file.open(fileName)) { @@ -63,10 +65,9 @@ void ZVision::renderImageToScreen(const Common::String &fileName, uint32 x, uint // Decode Graphics::TGADecoder tga; - if (!tga.loadStream(file)) { + if (!tga.loadStream(file)) error("Error while reading TGA image"); - return; - } + file.close(); const Graphics::Surface *tgaSurface = tga.getSurface(); _system->copyRectToScreen(tgaSurface->pixels, tgaSurface->pitch, x, y, tgaSurface->w, tgaSurface->h); diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h new file mode 100644 index 0000000000..137ec51d5a --- /dev/null +++ b/engines/zvision/render_manager.h @@ -0,0 +1,70 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef ZVISION_RENDER_MANAGER_H +#define ZVISION_RENDER_MANAGER_H + +#include "common/types.h" + +class OSystem; + +namespace Common { +class String; +} + +namespace ZVision { + +class RenderManager { +public: + RenderManager(OSystem *system); + +public: + enum RenderState { + PANORAMA, + TILT, + FLAT + }; + +private: + OSystem *_system; + RenderState _renderState; + + struct { + uint16 fieldOfView; + uint16 linearScale; + } _panoramaOptions; + + // TODO: See if tilt and panorama need to have separate options + struct { + uint16 fieldOfView; + uint16 linearScale; + } _tiltOptions; + + bool _needsScreenUpdate; + +public: + void renderImageToScreen(const Common::String &fileName, uint32 x, uint32 y); +}; + +} // End of namespace ZVision + +#endif |