From 9b5cf8f1bafd5aa0dba9194a8f04e58724652891 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 29 Jul 2012 02:30:26 +0200 Subject: WINTERMUTE: Introduce a Singleton-class for holding registry/filemanager. --- engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 9 +++++---- engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'engines/wintermute/base/gfx/osystem') diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index 58839d5ffe..51b0c2dd36 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -28,6 +28,7 @@ #include "engines/wintermute/base/gfx/osystem/base_render_osystem.h" #include "engines/wintermute/base/base_registry.h" +#include "engines/wintermute/base/base_engine.h" #include "engines/wintermute/base/gfx/osystem/base_surface_osystem.h" #include "engines/wintermute/base/base_surface_storage.h" #include "engines/wintermute/base/gfx/base_image.h" @@ -126,8 +127,8 @@ bool BaseRenderOSystem::initRenderer(int width, int height, bool windowed) { //TODO: Tiny resolution-displays might want to do some resolution-selection logic here - _realWidth = _gameRef->_registry->readInt("Debug", "ForceResWidth", _width); - _realHeight = _gameRef->_registry->readInt("Debug", "ForceResHeight", _height); + _realWidth = BaseEngine::getInstance()->getRegistry()->readInt("Debug", "ForceResWidth", _width); + _realHeight = BaseEngine::getInstance()->getRegistry()->readInt("Debug", "ForceResHeight", _height); float origAspect = (float)_width / (float)_height; float realAspect = (float)_realWidth / (float)_realHeight; @@ -152,7 +153,7 @@ bool BaseRenderOSystem::initRenderer(int width, int height, bool windowed) { _ratioX = (float)(_realWidth - _borderLeft - _borderRight) / (float)_width; _ratioY = (float)(_realHeight - _borderTop - _borderBottom) / (float)_height; - //_windowed = _gameRef->_registry->readBool("Video", "Windowed", true); TODO + //_windowed = BaseEngine::getInstance()->getRegistry()->readBool("Video", "Windowed", true); TODO Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0); g_system->beginGFXTransaction(); @@ -496,7 +497,7 @@ bool BaseRenderOSystem::drawLine(int x1, int y1, int x2, int y2, uint32 color) { BaseImage *BaseRenderOSystem::takeScreenshot() { // TODO: Clip by viewport. warning("BaseRenderOSystem::TakeScreenshot() - not ported yet"); - BaseImage *screenshot = new BaseImage(_gameRef->_fileManager); + BaseImage *screenshot = new BaseImage(); screenshot->copyFrom(_renderSurface); return screenshot; } diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 642f2179e6..c449f6471c 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -119,7 +119,7 @@ bool BaseSurfaceOSystem::create(const Common::String &filename, bool defaultCK, } bool BaseSurfaceOSystem::finishLoad() { - BaseImage *image = new BaseImage(_gameRef->_fileManager); + BaseImage *image = new BaseImage(); if (!image->loadFile(_filename)) { return false; } -- cgit v1.2.3