diff options
author | Sven Hesse | 2010-09-30 13:02:50 +0000 |
---|---|---|
committer | Sven Hesse | 2010-09-30 13:02:50 +0000 |
commit | 4f2b58b11740c8bdeb728a4798e572e8c9d1d990 (patch) | |
tree | 4c69900846df7782d707132f65a4a7cfd056af76 /engines/gob | |
parent | 51fd528fe56e00466255d54e1e71b19f34729bfd (diff) | |
download | scummvm-rg350-4f2b58b11740c8bdeb728a4798e572e8c9d1d990.tar.gz scummvm-rg350-4f2b58b11740c8bdeb728a4798e572e8c9d1d990.tar.bz2 scummvm-rg350-4f2b58b11740c8bdeb728a4798e572e8c9d1d990.zip |
GOB: Remove the now useless VGAVideoDriver
svn-id: r52948
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/driver_vga.cpp | 256 | ||||
-rw-r--r-- | engines/gob/driver_vga.h | 56 | ||||
-rw-r--r-- | engines/gob/init.cpp | 1 | ||||
-rw-r--r-- | engines/gob/module.mk | 1 | ||||
-rw-r--r-- | engines/gob/video.cpp | 18 | ||||
-rw-r--r-- | engines/gob/video.h | 18 |
6 files changed, 0 insertions, 350 deletions
diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp deleted file mode 100644 index 1c43b2640a..0000000000 --- a/engines/gob/driver_vga.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* 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 "common/endian.h" -#include "graphics/primitives.h" - -#include "gob/driver_vga.h" - -namespace Gob { - -/* -static void plotPixel(int x, int y, int color, void *data) { - Surface *dest = (Surface *)data; - - if ((x >= 0) && (x < dest->getWidth()) && - (y >= 0) && (y < dest->getHeight())) - dest->getVidMem()[(y * dest->getWidth()) + x] = color; -} -*/ - -void VGAVideoDriver::putPixel(int16 x, int16 y, byte color, Surface &dest) { /* - if ((x >= 0) && (x < dest.getWidth()) && - (y >= 0) && (y < dest.getHeight())) - dest.getVidMem()[(y * dest.getWidth()) + x] = color; -*/ } - -void VGAVideoDriver::drawLine(Surface &dest, int16 x0, int16 y0, int16 x1, - int16 y1, byte color) { /* - - Graphics::drawLine(x0, y0, x1, y1, color, &plotPixel, &dest); -*/ } - -void VGAVideoDriver::fillRect(Surface &dest, int16 left, int16 top, - int16 right, int16 bottom, byte color) { /* - - if ((left >= dest.getWidth()) || (right >= dest.getWidth()) || - (top >= dest.getHeight()) || (bottom >= dest.getHeight())) - return; - - byte *pos = dest.getVidMem() + (top * dest.getWidth()) + left; - int16 width = (right - left) + 1; - int16 height = (bottom - top) + 1; - - while (height--) { - for (int16 i = 0; i < width; ++i) - pos[i] = color; - - pos += dest.getWidth(); - } -*/ } - -void VGAVideoDriver::drawLetter(unsigned char item, int16 x, int16 y, - const Font &font, byte color1, byte color2, - byte transp, Surface &dest) { /* - uint16 data; - - const byte *src = font.getCharData(item); - - // This happens for me at the mountain (World 6) in Gobliins 2, if I - // move the cursor over the "!" part of the ledge while trying to use - // an object. - - if (!src) { - warning("drawLetter: getCharData() returned NULL"); - return; - } - - byte *dst = dest.getVidMem() + x + dest.getWidth() * y; - - int nWidth = font.getCharWidth(); - - if (nWidth & 7) - nWidth = (nWidth & 0xF8) + 8; - - nWidth >>= 3; - - for (int i = 0; i < font.getCharHeight(); i++) { - int width = font.getCharWidth(); - - for (int k = 0; k < nWidth; k++) { - - data = *src++; - for (int j = 0; j < MIN(8, width); j++) { - if (data & 0x80) - *dst = color2; - else if (color1 == 0) - *dst = transp; - - dst++; - data <<= 1; - } - - width -= 8; - - } - - dst += dest.getWidth() - font.getCharWidth(); - } -*/ } - -void VGAVideoDriver::drawSprite(Surface &source, Surface &dest, - int16 left, int16 top, int16 right, int16 bottom, - int16 x, int16 y, int16 transp) { /* - - if ((x >= dest.getWidth()) || (x < 0) || - (y >= dest.getHeight()) || (y < 0)) - return; - - int16 width = MIN((right - left) + 1, (int) dest.getWidth()); - int16 height = MIN((bottom - top) + 1, (int) dest.getHeight()); - - if ((width < 1) || (height < 1)) - return; - - const byte *srcPos = source.getVidMem() + (top * source.getWidth()) + left; - byte *destPos = dest.getVidMem() + (y * dest.getWidth()) + x; - - uint32 size = width * height; - - if (transp) { - - while (height--) { - for (int16 i = 0; i < width; ++i) { - if (srcPos[i]) - destPos[i] = srcPos[i]; - } - - srcPos += source.getWidth(); - destPos += dest.getWidth(); - } - - } else if (((srcPos >= destPos) && (srcPos <= (destPos + size))) || - ((destPos >= srcPos) && (destPos <= (srcPos + size)))) { - - while (height--) { - memmove(destPos, srcPos, width); - - srcPos += source.getWidth(); - destPos += dest.getWidth(); - } - - } else { - - while (height--) { - memcpy(destPos, srcPos, width); - - srcPos += source.getWidth(); - destPos += dest.getWidth(); - } - - } -*/ } - -void VGAVideoDriver::drawSpriteDouble(Surface &source, Surface &dest, - int16 left, int16 top, int16 right, int16 bottom, - int16 x, int16 y, int16 transp) { /* - - if ((x >= dest.getWidth()) || (x < 0) || - (y >= dest.getHeight()) || (y < 0)) - return; - - int16 width = MIN<int>((right - left) + 1, dest.getWidth() / 2); - int16 height = MIN<int>((bottom - top) + 1, dest.getHeight() / 2); - - if ((width < 1) || (height < 1)) - return; - - const byte *srcPos = source.getVidMem() + (top * source.getWidth()) + left; - byte *destPos = dest.getVidMem() + ((y * 2) * dest.getWidth()) + (x * 2); - - while (height--) { - const byte *srcBak = srcPos; - - for (int i = 0; i < 2; i++) { - srcPos = srcBak; - - for (int16 j = 0; j < width; j++) { - if (!transp || srcPos[i]) { - destPos[2 * j + 0] = srcPos[j]; - destPos[2 * j + 1] = srcPos[j]; - } - } - - destPos += dest.getWidth(); - } - - srcPos = srcBak + source.getWidth(); - } -*/ } - -void VGAVideoDriver::drawPackedSprite(byte *sprBuf, int16 width, int16 height, - int16 x, int16 y, byte transp, Surface &dest) { /* - int destRight = x + width; - int destBottom = y + height; - - byte *dst = dest.getVidMem() + x + dest.getWidth() * y; - - int curx = x; - int cury = y; - - while (1) { - uint8 val = *sprBuf++; - unsigned int repeat = val & 7; - val &= 0xF8; - - if (!(val & 8)) { - repeat <<= 8; - repeat |= *sprBuf++; - } - repeat++; - val >>= 4; - - for (unsigned int i = 0; i < repeat; ++i) { - if (curx < dest.getWidth() && cury < dest.getHeight()) - if (!transp || val) - *dst = val; - - dst++; - curx++; - if (curx == destRight) { - dst += dest.getWidth() + x - curx; - curx = x; - cury++; - if (cury == destBottom) - return; - } - } - - } - -*/ } - -} - diff --git a/engines/gob/driver_vga.h b/engines/gob/driver_vga.h deleted file mode 100644 index 18a2e252cb..0000000000 --- a/engines/gob/driver_vga.h +++ /dev/null @@ -1,56 +0,0 @@ -/* 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$ - * - */ - -#ifndef GOB_DRIVER_VGA_H -#define GOB_DRIVER_VGA_H - -#include "gob/video.h" - -namespace Gob { - -class VGAVideoDriver : public VideoDriver { -public: - VGAVideoDriver() {} - virtual ~VGAVideoDriver() {} - - void putPixel(int16 x, int16 y, byte color, Surface &dest); - void drawLine(Surface &dest, int16 x0, int16 y0, - int16 x1, int16 y1, byte color); - void fillRect(Surface &dest, int16 left, int16 top, - int16 right, int16 bottom, byte color); - void drawLetter(unsigned char item, int16 x, int16 y, - const Font &font, byte color1, byte color2, - byte transp, Surface &dest); - void drawSprite(Surface &source, Surface &dest, int16 left, - int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp); - void drawSpriteDouble(Surface &source, Surface &dest, int16 left, - int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp); - void drawPackedSprite(byte *sprBuf, int16 width, int16 height, - int16 x, int16 y, byte transp, Surface &dest); -}; - -} - -#endif // GOB_DRIVER_VGA_H diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index 7cb674ed5c..5c59a5692f 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -53,7 +53,6 @@ Init::~Init() { } void Init::cleanup() { - _vm->_video->freeDriver(); _vm->_global->_primarySurfDesc.reset(); _vm->_sound->speakerOff(); diff --git a/engines/gob/module.mk b/engines/gob/module.mk index e49580c8ea..05658e0ca8 100644 --- a/engines/gob/module.mk +++ b/engines/gob/module.mk @@ -9,7 +9,6 @@ MODULE_OBJS := \ draw_bargon.o \ draw_fascin.o \ draw_playtoons.o \ - driver_vga.o \ expression.o \ game.o \ global.o \ diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 1de25cb594..f4c12ad00e 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -38,8 +38,6 @@ #include "gob/dataio.h" #include "gob/draw.h" -#include "gob/driver_vga.h" - namespace Gob { Font::Font(const byte *data) : _dataPtr(data) { @@ -151,7 +149,6 @@ const byte *Font::getCharData(uint8 c) const { Video::Video(GobEngine *vm) : _vm(vm) { _doRangeClamp = false; - _videoDriver = 0; _surfWidth = 320; _surfHeight = 200; @@ -172,21 +169,9 @@ Video::Video(GobEngine *vm) : _vm(vm) { _dirtyAll = false; } -char Video::initDriver(int16 vidMode) { - if (_videoDriver) - return 1; - - _videoDriver = new VGAVideoDriver(); - return 1; -} - Video::~Video() { } -void Video::freeDriver() { - delete _videoDriver; -} - void Video::initPrimary(int16 mode) { if ((mode != 3) && (mode != -1)) _vm->validateVideoMode(mode); @@ -196,9 +181,6 @@ void Video::initPrimary(int16 mode) { mode = 3; _vm->_global->_oldMode = mode; - if (mode != 3) - Video::initDriver(mode); - if (mode != 3) { initSurfDesc(mode, _surfWidth, _surfHeight, PRIMARY_SURFACE); diff --git a/engines/gob/video.h b/engines/gob/video.h index 498f6d8650..5c49042496 100644 --- a/engines/gob/video.h +++ b/engines/gob/video.h @@ -107,7 +107,6 @@ public: int16 _screenDeltaX; int16 _screenDeltaY; - void freeDriver(); void initPrimary(int16 mode); SurfacePtr initSurfDesc(int16 vidMode, int16 width, int16 height, int16 flags); @@ -151,8 +150,6 @@ public: virtual ~Video(); protected: - class VideoDriver *_videoDriver; - bool _dirtyAll; Common::List<Common::Rect> _dirtyRects; @@ -161,8 +158,6 @@ protected: GobEngine *_vm; - char initDriver(int16 vidMode); - void drawPacked(byte *sprBuf, int16 width, int16 height, int16 x, int16 y, byte transp, Surface &dest); }; @@ -208,19 +203,6 @@ private: const byte *dataY, const byte *dataU, const byte *dataV); }; -class VideoDriver { -public: - VideoDriver() {} - virtual ~VideoDriver() {} - virtual void drawSprite(Surface &source, Surface &dest, int16 left, int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp) = 0; - virtual void drawSpriteDouble(Surface &source, Surface &dest, int16 left, int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp) = 0; - virtual void fillRect(Surface &dest, int16 left, int16 top, int16 right, int16 bottom, byte color) = 0; - virtual void putPixel(int16 x, int16 y, byte color, Surface &dest) = 0; - virtual void drawLetter(unsigned char item, int16 x, int16 y, const Font &font, byte color1, byte color2, byte transp, Surface &dest) = 0; - virtual void drawLine(Surface &dest, int16 x0, int16 y0, int16 x1, int16 y1, byte color) = 0; - virtual void drawPackedSprite(byte *sprBuf, int16 width, int16 height, int16 x, int16 y, byte transp, Surface &dest) = 0; -}; - } // End of namespace Gob #endif // GOB_VIDEO_H |