From 7b4dd0a682bf79cc86024d77d16411a6e2681f47 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Mon, 27 Aug 2012 12:39:58 +0200 Subject: TONY: Remove various bits of unused code. --- engines/tony/font.cpp | 19 ++--------- engines/tony/game.cpp | 6 ---- engines/tony/game.h | 5 --- engines/tony/gfxcore.cpp | 85 +++++++++++++--------------------------------- engines/tony/gfxcore.h | 23 +++++-------- engines/tony/gfxengine.cpp | 10 ------ engines/tony/gfxengine.h | 6 ---- engines/tony/input.cpp | 6 ---- engines/tony/input.h | 15 -------- engines/tony/tony.cpp | 12 ------- engines/tony/tony.h | 8 ----- engines/tony/window.cpp | 7 ---- engines/tony/window.h | 8 ----- 13 files changed, 35 insertions(+), 175 deletions(-) (limited to 'engines/tony') diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index 55e3b7627a..91dd8c0c39 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -49,21 +49,6 @@ RMFont::~RMFont() { unload(); } - -/** - * Dumps a font to a buffer - * @param buf Buffer for font contents - * @param nChars Number of characters (max 256) - * @param dimx X dimension in pixels - * @param dimy Y dimension in pixels -* -\****************************************************************************/ - -void DumpFontBMP(const char *filename, const byte *buf, int nChars, int charX, int charY, byte *pal) { - error("DumpFontBMP not supported in ScummVM"); -} - - void RMFont::load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID) { _letter = new RMGfxSourceBuffer8RLEByte[nChars]; @@ -150,7 +135,7 @@ int RMFont::stringLen(char bChar, char bNext) { } /****************************************************************************\ -* Metodi di RMFontColor +* RMFontColor Methods \****************************************************************************/ RMFontColor::RMFontColor() : RMFont() { @@ -180,7 +165,7 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) { _fontG = g1; _fontB = b1; - // Constructs a new paletter for the font + // Constructs a new palette for the font for (i = 1; i < 16; i++) { pal[i * 3 + 0] = r >> 16; pal[i * 3 + 1] = g >> 16; diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index 321a4fa88d..4699a9b9aa 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -1527,12 +1527,6 @@ void RMPointer::close() { } } - -int RMPointer::priority() { - // Pointer has minimum priority so it will be drawn last - return 200; -} - void RMPointer::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; int n; diff --git a/engines/tony/game.h b/engines/tony/game.h index aa7d45bce6..9c58f28714 100644 --- a/engines/tony/game.h +++ b/engines/tony/game.h @@ -100,11 +100,6 @@ public: */ void doFrame(); - /** - * Overloading of priorities - */ - int priority(); - /** * draw method */ diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp index 406ed8043b..f9f7cb02ec 100644 --- a/engines/tony/gfxcore.cpp +++ b/engines/tony/gfxcore.cpp @@ -65,7 +65,6 @@ void RMGfxTaskSetPrior::setPriority(int nPrior) { RMGfxBuffer::RMGfxBuffer() { _dimx = _dimy = 0; - _bUseDDraw = false; _origBuf = _buf = NULL; } @@ -73,7 +72,7 @@ RMGfxBuffer::~RMGfxBuffer() { destroy(); } -void RMGfxBuffer::create(int dimx, int dimy, int nBpp, bool bUseDDraw) { +void RMGfxBuffer::create(int dimx, int dimy, int nBpp) { // Destroy the buffer it is already exists if (_buf != NULL) destroy(); @@ -81,34 +80,17 @@ void RMGfxBuffer::create(int dimx, int dimy, int nBpp, bool bUseDDraw) { // Copy the parameters in the private members _dimx = dimx; _dimy = dimy; - _bUseDDraw = bUseDDraw; - if (!_bUseDDraw) { - // Allocate a buffer - _origBuf = _buf = new byte[_dimx * _dimy * nBpp / 8]; - assert(_buf != NULL); - Common::fill(_origBuf, _origBuf + _dimx * _dimy * nBpp / 8, 0); - } + // Allocate a buffer + _origBuf = _buf = new byte[_dimx * _dimy * nBpp / 8]; + assert(_buf != NULL); + Common::fill(_origBuf, _origBuf + _dimx * _dimy * nBpp / 8, 0); } void RMGfxBuffer::destroy() { - if (!_bUseDDraw) { - if (_origBuf != NULL && _origBuf == _buf) { - delete[] _origBuf; - _origBuf = _buf = NULL; - } - } -} - -void RMGfxBuffer::lock() { - if (_bUseDDraw) { - // Manages acceleration - } -} - -void RMGfxBuffer::unlock() { - if (_bUseDDraw) { - // Manages acceleration + if (_origBuf != NULL && _origBuf == _buf) { + delete[] _origBuf; + _origBuf = _buf = NULL; } } @@ -125,8 +107,8 @@ RMGfxBuffer::operator void *() { return (void *)_buf; } -RMGfxBuffer::RMGfxBuffer(int dimx, int dimy, int nBpp, bool bUseDDraw) { - create(dimx, dimy, nBpp, bUseDDraw); +RMGfxBuffer::RMGfxBuffer(int dimx, int dimy, int nBpp) { + create(dimx, dimy, nBpp); } /****************************************************************************\ @@ -240,8 +222,8 @@ RMGfxWoodyBuffer::RMGfxWoodyBuffer() { } -RMGfxWoodyBuffer::RMGfxWoodyBuffer(int dimx, int dimy, bool bUseDDraw) - : RMGfxBuffer(dimx, dimy, 16, bUseDDraw) { +RMGfxWoodyBuffer::RMGfxWoodyBuffer(int dimx, int dimy) + : RMGfxBuffer(dimx, dimy, 16) { } /****************************************************************************\ @@ -252,19 +234,15 @@ RMGfxTargetBuffer::RMGfxTargetBuffer() { _otlist = NULL; _otSize = 0; _trackDirtyRects = false; -// csModifyingOT = g_system->createMutex(); } RMGfxTargetBuffer::~RMGfxTargetBuffer() { clearOT(); -// g_system->deleteMutex(csModifyingOT); } void RMGfxTargetBuffer::clearOT() { OTList *cur, *n; -// g_system->lockMutex(csModifyingOT); - cur = _otlist; while (cur != NULL) { @@ -276,8 +254,6 @@ void RMGfxTargetBuffer::clearOT() { } _otlist = NULL; - -// g_system->unlockMutex(csModifyingOT); } void RMGfxTargetBuffer::drawOT(CORO_PARAM) { @@ -294,10 +270,6 @@ void RMGfxTargetBuffer::drawOT(CORO_PARAM) { _ctx->prev = NULL; _ctx->cur = _otlist; - // Lock the buffer to access it - lock(); -// g_system->lockMutex(csModifyingOT); - while (_ctx->cur != NULL) { // Call the task Draw method, passing it a copy of the original _ctx->myprim = _ctx->cur->_prim->duplicate(); @@ -330,11 +302,6 @@ void RMGfxTargetBuffer::drawOT(CORO_PARAM) { } } -// g_system->unlockMutex(csModifyingOT); - - //Unlock after writing - unlock(); - CORO_END_CODE; } @@ -342,8 +309,6 @@ void RMGfxTargetBuffer::addPrim(RMGfxPrimitive *prim) { int nPrior; OTList *cur, *n; -// g_system->lockMutex(csModifyingOT); - // Warn of the OT listing prim->_task->Register(); @@ -368,8 +333,6 @@ void RMGfxTargetBuffer::addPrim(RMGfxPrimitive *prim) { n->_next = cur->_next; cur->_next = n; } - -// g_system->unlockMutex(csModifyingOT); } void RMGfxTargetBuffer::addDirtyRect(const Common::Rect &r) { @@ -554,8 +517,8 @@ int RMGfxSourceBufferPal::loadPaletteWA(uint32 resID, bool bSwapped) { void RMGfxSourceBuffer4::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { } -RMGfxSourceBuffer4::RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw) - : RMGfxBuffer(dimx, dimy, 4, bUseDDraw) { +RMGfxSourceBuffer4::RMGfxSourceBuffer4(int dimx, int dimy) + : RMGfxBuffer(dimx, dimy, 4) { setPriority(0); } @@ -569,8 +532,8 @@ int RMGfxSourceBuffer4::getBpp() { return 4; } -void RMGfxSourceBuffer4::create(int dimx, int dimy, bool bUseDDraw) { - RMGfxBuffer::create(dimx, dimy, 4, bUseDDraw); +void RMGfxSourceBuffer4::create(int dimx, int dimy) { + RMGfxBuffer::create(dimx, dimy, 4); } /****************************************************************************\ @@ -641,8 +604,8 @@ void RMGfxSourceBuffer8::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit bigBuf.addDirtyRect(Common::Rect(dst._x1, dst._y1, dst._x1 + width, dst._y1 + height)); } -RMGfxSourceBuffer8::RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw) - : RMGfxBuffer(dimx, dimy, 8, bUseDDraw) { +RMGfxSourceBuffer8::RMGfxSourceBuffer8(int dimx, int dimy) + : RMGfxBuffer(dimx, dimy, 8) { setPriority(0); _bTrasp0 = false; } @@ -661,8 +624,8 @@ int RMGfxSourceBuffer8::getBpp() { return 8; } -void RMGfxSourceBuffer8::create(int dimx, int dimy, bool bUseDDraw) { - RMGfxBuffer::create(dimx, dimy, 8, bUseDDraw); +void RMGfxSourceBuffer8::create(int dimx, int dimy) { + RMGfxBuffer::create(dimx, dimy, 8); } #define GETRED(x) (((x) >> 10) & 0x1F) @@ -1989,8 +1952,8 @@ void RMGfxSourceBuffer16::prepareImage() { WRITE_LE_UINT16(&buf[i], FROM_LE_16(buf[i]) & 0x7FFF); } -RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw) - : RMGfxBuffer(dimx, dimy, 16, bUseDDraw) { +RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy) + : RMGfxBuffer(dimx, dimy, 16) { setPriority(0); _bTrasp0 = false; } @@ -2004,8 +1967,8 @@ int RMGfxSourceBuffer16::getBpp() { return 16; } -void RMGfxSourceBuffer16::create(int dimx, int dimy, bool bUseDDraw) { - RMGfxBuffer::create(dimx, dimy, 16, bUseDDraw); +void RMGfxSourceBuffer16::create(int dimx, int dimy) { + RMGfxBuffer::create(dimx, dimy, 16); } /****************************************************************************\ diff --git a/engines/tony/gfxcore.h b/engines/tony/gfxcore.h index 2402b1e029..cd7830be24 100644 --- a/engines/tony/gfxcore.h +++ b/engines/tony/gfxcore.h @@ -61,11 +61,10 @@ protected: int _dimx, _dimy; byte *_buf; byte *_origBuf; - bool _bUseDDraw; public: RMGfxBuffer(); - RMGfxBuffer(int dimx, int dimy, int nBpp, bool bUseDDraw = false); + RMGfxBuffer(int dimx, int dimy, int nBpp); virtual ~RMGfxBuffer(); // Attributes @@ -77,13 +76,9 @@ public: } // Creation - virtual void create(int dimx, int dimy, int nBpp, bool bUseDDraw = false); + virtual void create(int dimx, int dimy, int nBpp); virtual void destroy(); - // Buffer access - void lock(); - void unlock(); - // These are valid only if the buffer is locked operator byte *(); operator void *(); @@ -321,11 +316,11 @@ protected: public: RMGfxSourceBuffer16(bool bUseTrasp = false); - RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw = false); + RMGfxSourceBuffer16(int dimx, int dimy); virtual ~RMGfxSourceBuffer16(); // Initialization - void create(int dimx, int dimy, bool bUseDDraw = false); + void create(int dimx, int dimy); int getBpp(); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); @@ -366,11 +361,11 @@ protected: public: RMGfxSourceBuffer8(bool bTrasp0 = true); - RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw = false); + RMGfxSourceBuffer8(int dimx, int dimy); virtual ~RMGfxSourceBuffer8(); // Initialization - void create(int dimx, int dimy, bool bUseDDraw = false); + void create(int dimx, int dimy); int getBpp(); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); @@ -533,10 +528,10 @@ public: class RMGfxSourceBuffer4 : public RMGfxSourceBufferPal { public: RMGfxSourceBuffer4(); - RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw = false); + RMGfxSourceBuffer4(int dimx, int dimy); // Initialization - void create(int dimx, int dimy, bool bUseDDraw = false); + void create(int dimx, int dimy); int getBpp(); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); @@ -618,7 +613,7 @@ public: class RMGfxWoodyBuffer: public RMGfxSourceBuffer16, public RMGfxTargetBuffer { public: RMGfxWoodyBuffer(); - RMGfxWoodyBuffer(int dimx, int dimy, bool bUseDDraw = false); + RMGfxWoodyBuffer(int dimx, int dimy); virtual ~RMGfxWoodyBuffer(); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp index 5431a0ca7d..25aaa625f4 100644 --- a/engines/tony/gfxengine.cpp +++ b/engines/tony/gfxengine.cpp @@ -500,9 +500,6 @@ void RMGfxEngine::init() { GLOBALS._gfxEngine = this; mpalInstallItemIrq(itemIrq); - // Initialize the input - _input.init(); - // Initialize the mouse pointer _point.init(); @@ -530,13 +527,6 @@ void RMGfxEngine::close() { _inv.close(); _tony.close(); _point.close(); - _input.close(); -} - -void RMGfxEngine::switchFullscreen(bool bFull) { -} - -void RMGfxEngine::GDIControl(bool bCon) { } void RMGfxEngine::enableInput() { diff --git a/engines/tony/gfxengine.h b/engines/tony/gfxengine.h index 8be09ddd8b..7206496aaa 100644 --- a/engines/tony/gfxengine.h +++ b/engines/tony/gfxengine.h @@ -92,12 +92,6 @@ public: // Closes the graphics engine void close(); - // Warns when changing - void switchFullscreen(bool bFull); - - // Warn that we are guided by the GDI - void GDIControl(bool bCon); - // Warns when entering or exits the options menu void openOptionScreen(CORO_PARAM, int type); diff --git a/engines/tony/input.cpp b/engines/tony/input.cpp index 1e79032af2..88bc3f4092 100644 --- a/engines/tony/input.cpp +++ b/engines/tony/input.cpp @@ -101,12 +101,6 @@ void RMInput::poll() { } } -void RMInput::init() { -} - -void RMInput::close() { -} - bool RMInput::mouseLeft() { return _leftButton; } diff --git a/engines/tony/input.h b/engines/tony/input.h index d9b6dc7e89..55b067ec43 100644 --- a/engines/tony/input.h +++ b/engines/tony/input.h @@ -46,26 +46,11 @@ private: // Keyboard related fields bool _keyDown[350]; -private: - /** - * Deinitialize DirectInput - */ - void DIClose(); public: RMInput(); ~RMInput(); - /** - * Class initialization - */ - void init(/*uint32 hInst*/); - - /** - * Closes the class - */ - void close(); - /** * Polling (must be performed once per frame) */ diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index bb174dfbb1..b0ca074c16 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -610,9 +610,6 @@ void TonyEngine::grabThumbnail() { _window.grabThumbnail(_curThumbnail); } -void TonyEngine::optionScreen() { -} - void TonyEngine::openInitLoadMenu(CORO_PARAM) { _theEngine.openOptionScreen(coroParam, 1); } @@ -706,15 +703,6 @@ void TonyEngine::close() { delete[] _curThumbnail; } -void TonyEngine::switchFullscreen(bool bFull) { - _window.switchFullscreen(bFull); - _theEngine.switchFullscreen(bFull); -} - -void TonyEngine::GDIControl(bool bCon) { - _theEngine.GDIControl(bCon); -} - void TonyEngine::freezeTime() { _bTimeFreezed = true; _nTimeFreezed = getTime() - _startTime; diff --git a/engines/tony/tony.h b/engines/tony/tony.h index f8358b15a7..9a25f2ce35 100644 --- a/engines/tony/tony.h +++ b/engines/tony/tony.h @@ -167,20 +167,12 @@ public: Common::Error loadGameState(int slot); Common::Error saveGameState(int slot, const Common::String &desc); - /** - * Warn when are being controlled by the GDI - */ - void GDIControl(bool bCon); - void play(); void close(); void abortGame(); void getDataDirectory(DataDir dir, char *path); - void switchFullscreen(bool bFull); - void optionScreen(); - void showLocation() { _bDrawLocation = true; } diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index 9cf8167030..c412a53655 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -109,13 +109,6 @@ void RMWindow::repaint() { g_system->updateScreen(); } -bool RMWindow::lock() { - return true; -} - -void RMWindow::unlock() { -} - /** * Wipes an area of the screen */ diff --git a/engines/tony/window.h b/engines/tony/window.h index 25ec349196..4dfd63a3d8 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -53,8 +53,6 @@ public: class RMWindow { private: - bool lock(); - void unlock(); void plotSplices(const byte *lpBuf, const Common::Point ¢er, int x, int y); void plotLines(const byte *lpBuf, const Common::Point ¢er, int x, int y); @@ -83,7 +81,6 @@ public: * Initialization */ void init(/*HINSTANCE hInst*/); - void initDirectDraw(); void close(); /** @@ -91,11 +88,6 @@ public: */ void repaint(); - /** - * Switch between windowed and fullscreen - */ - void switchFullscreen(bool bFull) {} - /** * Reads the next frame */ -- cgit v1.2.3