ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

modular-backend.cpp

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #define FORBIDDEN_SYMBOL_EXCEPTION_exit
00024 
00025 #include "backends/modular-backend.h"
00026 
00027 #include "backends/graphics/graphics.h"
00028 #include "backends/mutex/mutex.h"
00029 #include "gui/EventRecorder.h"
00030 
00031 #include "audio/mixer.h"
00032 #include "graphics/pixelformat.h"
00033 #include "graphics/pixelbuffer.h" // ResidualVM specific:
00034 
00035 ModularBackend::ModularBackend()
00036     :
00037     _mutexManager(0),
00038     _graphicsManager(0),
00039     _mixer(0) {
00040 
00041 }
00042 
00043 ModularBackend::~ModularBackend() {
00044     delete _graphicsManager;
00045     _graphicsManager = 0;
00046     delete _mixer;
00047     _mixer = 0;
00048     delete _mutexManager;
00049     _mutexManager = 0;
00050 }
00051 
00052 bool ModularBackend::hasFeature(Feature f) {
00053     return _graphicsManager->hasFeature(f);
00054 }
00055 
00056 void ModularBackend::setFeatureState(Feature f, bool enable) {
00057     _graphicsManager->setFeatureState(f, enable);
00058 }
00059 
00060 bool ModularBackend::getFeatureState(Feature f) {
00061     return _graphicsManager->getFeatureState(f);
00062 }
00063 
00064 GraphicsManager *ModularBackend::getGraphicsManager() {
00065     assert(_graphicsManager);
00066     return (GraphicsManager *)_graphicsManager;
00067 }
00068 
00069 const OSystem::GraphicsMode *ModularBackend::getSupportedGraphicsModes() const {
00070     return _graphicsManager->getSupportedGraphicsModes();
00071 }
00072 
00073 int ModularBackend::getDefaultGraphicsMode() const {
00074     return _graphicsManager->getDefaultGraphicsMode();
00075 }
00076 
00077 bool ModularBackend::setGraphicsMode(int mode) {
00078     return _graphicsManager->setGraphicsMode(mode);
00079 }
00080 
00081 int ModularBackend::getGraphicsMode() const {
00082     return _graphicsManager->getGraphicsMode();
00083 }
00084 
00085 const OSystem::GraphicsMode *ModularBackend::getSupportedShaders() const {
00086     return _graphicsManager->getSupportedShaders();
00087 }
00088 
00089 bool ModularBackend::setShader(int id) {
00090     return _graphicsManager->setShader(id);
00091 }
00092 
00093 int ModularBackend::getShader() const {
00094     return _graphicsManager->getShader();
00095 }
00096 
00097 const OSystem::GraphicsMode *ModularBackend::getSupportedStretchModes() const {
00098     return _graphicsManager->getSupportedStretchModes();
00099 }
00100 
00101 int ModularBackend::getDefaultStretchMode() const {
00102     return _graphicsManager->getDefaultStretchMode();
00103 }
00104 
00105 bool ModularBackend::setStretchMode(int mode) {
00106     return _graphicsManager->setStretchMode(mode);
00107 }
00108 
00109 int ModularBackend::getStretchMode() const {
00110     return _graphicsManager->getStretchMode();
00111 }
00112 
00113 void ModularBackend::resetGraphicsScale() {
00114     _graphicsManager->resetGraphicsScale();
00115 }
00116 
00117 #ifdef USE_RGB_COLOR
00118 
00119 Graphics::PixelFormat ModularBackend::getScreenFormat() const {
00120     return _graphicsManager->getScreenFormat();
00121 }
00122 
00123 Common::List<Graphics::PixelFormat> ModularBackend::getSupportedFormats() const {
00124     return _graphicsManager->getSupportedFormats();
00125 }
00126 
00127 #endif
00128 
00129 // ResidualVM specific method
00130 void ModularBackend::setupScreen(uint screenW, uint screenH, bool fullscreen, bool accel3d) {
00131     _graphicsManager->setupScreen(screenW, screenH, fullscreen, accel3d);
00132 }
00133 
00134 // ResidualVM specific method
00135 Graphics::PixelBuffer ModularBackend::getScreenPixelBuffer() {
00136     return _graphicsManager->getScreenPixelBuffer();
00137 }
00138 
00139 // ResidualVM specific method
00140 void ModularBackend::suggestSideTextures(Graphics::Surface *left, Graphics::Surface *right) {
00141     _graphicsManager->suggestSideTextures(left, right);
00142 }
00143 
00144 void ModularBackend::initSize(uint w, uint h, const Graphics::PixelFormat *format ) {
00145     _graphicsManager->initSize(w, h, format);
00146 }
00147 
00148 void ModularBackend::initSizeHint(const Graphics::ModeList &modes) {
00149     _graphicsManager->initSizeHint(modes);
00150 }
00151 
00152 int ModularBackend::getScreenChangeID() const {
00153     return _graphicsManager->getScreenChangeID();
00154 }
00155 
00156 void ModularBackend::beginGFXTransaction() {
00157     _graphicsManager->beginGFXTransaction();
00158 }
00159 
00160 OSystem::TransactionError ModularBackend::endGFXTransaction() {
00161     return _graphicsManager->endGFXTransaction();
00162 }
00163 
00164 int16 ModularBackend::getHeight() {
00165     return _graphicsManager->getHeight();
00166 }
00167 
00168 int16 ModularBackend::getWidth() {
00169     return _graphicsManager->getWidth();
00170 }
00171 
00172 PaletteManager *ModularBackend::getPaletteManager() {
00173     return _graphicsManager;
00174 }
00175 
00176 void ModularBackend::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
00177     _graphicsManager->copyRectToScreen(buf, pitch, x, y, w, h);
00178 }
00179 
00180 Graphics::Surface *ModularBackend::lockScreen() {
00181     return _graphicsManager->lockScreen();
00182 }
00183 
00184 void ModularBackend::unlockScreen() {
00185     _graphicsManager->unlockScreen();
00186 }
00187 
00188 void ModularBackend::fillScreen(uint32 col) {
00189     _graphicsManager->fillScreen(col);
00190 }
00191 
00192 void ModularBackend::updateScreen() {
00193 #ifdef ENABLE_EVENTRECORDER
00194     g_eventRec.preDrawOverlayGui();
00195 #endif
00196 
00197     _graphicsManager->updateScreen();
00198 
00199 #ifdef ENABLE_EVENTRECORDER
00200     g_eventRec.postDrawOverlayGui();
00201 #endif
00202 }
00203 
00204 void ModularBackend::setShakePos(int shakeOffset) {
00205     _graphicsManager->setShakePos(shakeOffset);
00206 }
00207 void ModularBackend::setFocusRectangle(const Common::Rect& rect) {
00208     _graphicsManager->setFocusRectangle(rect);
00209 }
00210 
00211 void ModularBackend::clearFocusRectangle() {
00212     _graphicsManager->clearFocusRectangle();
00213 }
00214 
00215 void ModularBackend::showOverlay() {
00216     _graphicsManager->showOverlay();
00217 }
00218 
00219 void ModularBackend::hideOverlay() {
00220     _graphicsManager->hideOverlay();
00221 }
00222 
00223 Graphics::PixelFormat ModularBackend::getOverlayFormat() const {
00224     return _graphicsManager->getOverlayFormat();
00225 }
00226 
00227 void ModularBackend::clearOverlay() {
00228     _graphicsManager->clearOverlay();
00229 }
00230 
00231 void ModularBackend::grabOverlay(void *buf, int pitch) {
00232     _graphicsManager->grabOverlay(buf, pitch);
00233 }
00234 
00235 void ModularBackend::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
00236     _graphicsManager->copyRectToOverlay(buf, pitch, x, y, w, h);
00237 }
00238 
00239 int16 ModularBackend::getOverlayHeight() {
00240     return _graphicsManager->getOverlayHeight();
00241 }
00242 
00243 int16 ModularBackend::getOverlayWidth() {
00244     return _graphicsManager->getOverlayWidth();
00245 }
00246 
00247 bool ModularBackend::showMouse(bool visible) {
00248     return _graphicsManager->showMouse(visible);
00249 }
00250 
00251 // ResidualVM specific method
00252 bool ModularBackend::lockMouse(bool visible) {
00253     return _graphicsManager->lockMouse(visible);
00254 }
00255 
00256 void ModularBackend::warpMouse(int x, int y) {
00257     _eventManager->purgeMouseEvents();
00258     _graphicsManager->warpMouse(x, y);
00259 }
00260 
00261 void ModularBackend::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
00262     _graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, dontScale, format);
00263 }
00264 
00265 void ModularBackend::setCursorPalette(const byte *colors, uint start, uint num) {
00266     _graphicsManager->setCursorPalette(colors, start, num);
00267 }
00268 
00269 void ModularBackend::saveScreenshot() {
00270     _graphicsManager->saveScreenshot();
00271 }
00272 
00273 OSystem::MutexRef ModularBackend::createMutex() {
00274     assert(_mutexManager);
00275     return _mutexManager->createMutex();
00276 }
00277 
00278 void ModularBackend::lockMutex(MutexRef mutex) {
00279     assert(_mutexManager);
00280     _mutexManager->lockMutex(mutex);
00281 }
00282 
00283 void ModularBackend::unlockMutex(MutexRef mutex) {
00284     assert(_mutexManager);
00285     _mutexManager->unlockMutex(mutex);
00286 }
00287 
00288 void ModularBackend::deleteMutex(MutexRef mutex) {
00289     assert(_mutexManager);
00290     _mutexManager->deleteMutex(mutex);
00291 }
00292 
00293 Audio::Mixer *ModularBackend::getMixer() {
00294     assert(_mixer);
00295     return (Audio::Mixer *)_mixer;
00296 }
00297 
00298 void ModularBackend::displayMessageOnOSD(const char *msg) {
00299     _graphicsManager->displayMessageOnOSD(msg);
00300 }
00301 
00302 void ModularBackend::displayActivityIconOnOSD(const Graphics::Surface *icon) {
00303     _graphicsManager->displayActivityIconOnOSD(icon);
00304 }
00305 
00306 void ModularBackend::quit() {
00307     exit(0);
00308 }


Generated on Sat Mar 16 2019 05:01:47 for ResidualVM by doxygen 1.7.1
curved edge   curved edge