Logo Search packages:      
Sourcecode: scummvm version File versions

modular-backend.cpp

/* 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.
 *
 * $URL$
 * $Id$
 *
 */

#include "backends/modular-backend.h"

#include "backends/fs/fs-factory.h"
#include "backends/audiocd/audiocd.h"
#include "backends/graphics/graphics.h"
#include "backends/mutex/mutex.h"

#include "audio/mixer.h"
#include "common/events.h"
#include "gui/message.h"
#include "graphics/pixelformat.h"

ModularBackend::ModularBackend()
      :
      _fsFactory(0),
      _eventManager(0),
      _savefileManager(0),
      _timerManager(0),
      _mutexManager(0),
      _graphicsManager(0),
      _mixer(0),
      _audiocdManager(0) {

}

ModularBackend::~ModularBackend() {
      delete _fsFactory;
      _fsFactory = 0;
      delete _graphicsManager;
      _graphicsManager = 0;
      delete _eventManager;
      _eventManager = 0;
      delete _mixer;
      _mixer = 0;
      delete _audiocdManager;
      _audiocdManager = 0;
      delete _savefileManager;
      _savefileManager = 0;
      delete _timerManager;
      _timerManager = 0;
      delete _mutexManager;
      _mutexManager = 0;
}

00070 bool ModularBackend::hasFeature(Feature f) {
      return _graphicsManager->hasFeature(f);
}

00074 void ModularBackend::setFeatureState(Feature f, bool enable) {
      return _graphicsManager->setFeatureState(f, enable);
}

00078 bool ModularBackend::getFeatureState(Feature f) {
      return _graphicsManager->getFeatureState(f);
}

GraphicsManager *ModularBackend::getGraphicsManager() {
      assert(_graphicsManager);
      return (GraphicsManager *)_graphicsManager;
}

00087 const OSystem::GraphicsMode *ModularBackend::getSupportedGraphicsModes() const {
      return _graphicsManager->getSupportedGraphicsModes();
}

00091 int ModularBackend::getDefaultGraphicsMode() const {
      return _graphicsManager->getDefaultGraphicsMode();
}

00095 bool ModularBackend::setGraphicsMode(int mode) {
      return _graphicsManager->setGraphicsMode(mode);
}

00099 int ModularBackend::getGraphicsMode() const {
      return _graphicsManager->getGraphicsMode();
}

00103 void ModularBackend::resetGraphicsScale() {
      _graphicsManager->resetGraphicsScale();
}

#ifdef USE_RGB_COLOR

Graphics::PixelFormat ModularBackend::getScreenFormat() const {
      return _graphicsManager->getScreenFormat();
}

Common::List<Graphics::PixelFormat> ModularBackend::getSupportedFormats() const {
      return _graphicsManager->getSupportedFormats();
}

#endif

00119 void ModularBackend::initSize(uint w, uint h, const Graphics::PixelFormat *format ) {
      _graphicsManager->initSize(w, h, format);
}

00123 int ModularBackend::getScreenChangeID() const {
      return _graphicsManager->getScreenChangeID();
}

00127 void ModularBackend::beginGFXTransaction() {
      _graphicsManager->beginGFXTransaction();
}

00131 OSystem::TransactionError ModularBackend::endGFXTransaction() {
      return _graphicsManager->endGFXTransaction();
}

00135 int16 ModularBackend::getHeight() {
      return _graphicsManager->getHeight();
}

00139 int16 ModularBackend::getWidth() {
      return _graphicsManager->getWidth();
}

00143 PaletteManager *ModularBackend::getPaletteManager() {
      return _graphicsManager;
}

00147 void ModularBackend::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
      _graphicsManager->copyRectToScreen(buf, pitch, x, y, w, h);
}

00151 Graphics::Surface *ModularBackend::lockScreen() {
      return _graphicsManager->lockScreen();
}

00155 void ModularBackend::unlockScreen() {
      _graphicsManager->unlockScreen();
}

00159 void ModularBackend::fillScreen(uint32 col) {
      _graphicsManager->fillScreen(col);
}

00163 void ModularBackend::updateScreen() {
      _graphicsManager->updateScreen();
}

00167 void ModularBackend::setShakePos(int shakeOffset) {
      _graphicsManager->setShakePos(shakeOffset);
}
00170 void ModularBackend::setFocusRectangle(const Common::Rect& rect) {
      _graphicsManager->setFocusRectangle(rect);
}

00174 void ModularBackend::clearFocusRectangle() {
      _graphicsManager->clearFocusRectangle();
}

00178 void ModularBackend::showOverlay() {
      _graphicsManager->showOverlay();
}

00182 void ModularBackend::hideOverlay() {
      _graphicsManager->hideOverlay();
}

00186 Graphics::PixelFormat ModularBackend::getOverlayFormat() const {
      return _graphicsManager->getOverlayFormat();
}

00190 void ModularBackend::clearOverlay() {
      _graphicsManager->clearOverlay();
}

00194 void ModularBackend::grabOverlay(OverlayColor *buf, int pitch) {
      _graphicsManager->grabOverlay(buf, pitch);
}

00198 void ModularBackend::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
      _graphicsManager->copyRectToOverlay(buf, pitch, x, y, w, h);
}

00202 int16 ModularBackend::getOverlayHeight() {
      return _graphicsManager->getOverlayHeight();
}

00206 int16 ModularBackend::getOverlayWidth() {
      return _graphicsManager->getOverlayWidth();
}

00210 bool ModularBackend::showMouse(bool visible) {
      return _graphicsManager->showMouse(visible);
}

00214 void ModularBackend::warpMouse(int x, int y) {
      _graphicsManager->warpMouse(x, y);
}

00218 void ModularBackend::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
      _graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format);
}

00222 void ModularBackend::setCursorPalette(const byte *colors, uint start, uint num) {
      _graphicsManager->setCursorPalette(colors, start, num);
}

00226 void ModularBackend::disableCursorPalette(bool disable) {
      _graphicsManager->disableCursorPalette(disable);
}

00230 Common::TimerManager *ModularBackend::getTimerManager() {
      assert(_timerManager);
      return _timerManager;
}

00235 Common::EventManager *ModularBackend::getEventManager() {
      assert(_eventManager);
      return _eventManager;
}

00240 OSystem::MutexRef ModularBackend::createMutex() {
      assert(_mutexManager);
      return _mutexManager->createMutex();
}

00245 void ModularBackend::lockMutex(MutexRef mutex) {
      assert(_mutexManager);
      _mutexManager->lockMutex(mutex);
}

00250 void ModularBackend::unlockMutex(MutexRef mutex) {
      assert(_mutexManager);
      _mutexManager->unlockMutex(mutex);
}

00255 void ModularBackend::deleteMutex(MutexRef mutex) {
      assert(_mutexManager);
      _mutexManager->deleteMutex(mutex);
}

00260 Audio::Mixer *ModularBackend::getMixer() {
      assert(_mixer);
      return (Audio::Mixer *)_mixer;
}

00265 AudioCDManager *ModularBackend::getAudioCDManager() {
      assert(_audiocdManager);
      return _audiocdManager;
}

00270 void ModularBackend::displayMessageOnOSD(const char *msg) {
      _graphicsManager->displayMessageOnOSD(msg);
}

00274 Common::SaveFileManager *ModularBackend::getSavefileManager() {
      assert(_savefileManager);
      return _savefileManager;
}

00279 FilesystemFactory *ModularBackend::getFilesystemFactory() {
      assert(_fsFactory);
      return _fsFactory;
}

Generated by  Doxygen 1.6.0   Back to index