diff options
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/graphics.cpp | 68 | ||||
-rw-r--r-- | engines/hopkins/graphics.h | 1 |
2 files changed, 3 insertions, 66 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 255a00071f..589259b203 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -51,7 +51,7 @@ GraphicsManager::GraphicsManager(HopkinsEngine *vm) { _oldScrollPosX = 0; _vesaScreen = NULL; _vesaBuffer = NULL; - _screenBuffer = NULL; + _screenBuffer = g_PTRNUL; _showDirtyRects = false; _lineNbr2 = 0; @@ -440,66 +440,6 @@ void GraphicsManager::m_scroll16(const byte *surface, int xs, int ys, int width, addRefreshRect(destX, destY, destX + width, destY + height); } -// TODO: See if PAL_PIXELS can be converted to a uint16 array -void GraphicsManager::m_scroll16A(const byte *surface, int xs, int ys, int width, int height, int destX, int destY) { - int xCtr; - const byte *palette; - int yCtr; - const byte *srcCopyP; - byte *destCopyP; - - assert(_videoPtr); - const byte *srcP = xs + _lineNbr2 * ys + surface; - byte *destP = (byte *)_videoPtr + destX + destX + _screenLineSize * destY; - int yNext = height; - _enlargedX = 0; - _enlargedY = 0; - _enlargedYFl = false; - - do { - for (;;) { - destCopyP = destP; - srcCopyP = srcP; - xCtr = width; - yCtr = yNext; - palette = PAL_PIXELS; - _enlargedX = 0; - - do { - destP[0] = palette[2 * srcP[0]]; - destP[1] = palette[(2 * srcP[0]) + 1]; - destP += 2; - if (_enlargedX >= 100) { - _enlargedX -= 100; - destP[0] = palette[2 * srcP[0]]; - destP[1] = palette[(2 * srcP[0]) + 1]; - destP += 2; - } - ++srcP; - --xCtr; - } while (xCtr); - - yNext = yCtr; - srcP = srcCopyP; - destP = _screenLineSize + destCopyP; - if (_enlargedYFl) - break; - - if (_enlargedY >= 0 && _enlargedY < 100) - break; - - _enlargedY -= 100; - _enlargedYFl = true; - } - - _enlargedYFl = false; - srcP = _lineNbr2 + srcCopyP; - yNext = yCtr - 1; - } while (yCtr != 1); - - addRefreshRect(destX, destY, destX + width, destY + width); -} - void GraphicsManager::Copy_Vga16(const byte *surface, int xp, int yp, int width, int height, int destX, int destY) { int xCtr; const byte *palette; @@ -1177,10 +1117,8 @@ void GraphicsManager::displayDirtyRects() { dstRect.setWidth((r.right - r.left) * 2); dstRect.setHeight((r.bottom - r.top) * 2); } else if (r.right > _vm->_eventsManager->_startPos.x && r.left < _vm->_eventsManager->_startPos.x + SCREEN_WIDTH) { - if (r.left < _vm->_eventsManager->_startPos.x) - r.left = _vm->_eventsManager->_startPos.x; - if (r.right > _vm->_eventsManager->_startPos.x + SCREEN_WIDTH) - r.right = _vm->_eventsManager->_startPos.x + SCREEN_WIDTH; + r.left = MAX<int16>(r.left, _vm->_eventsManager->_startPos.x); + r.right = MIN<int16>(r.right, (int16)_vm->_eventsManager->_startPos.x + SCREEN_WIDTH); // WORKAROUND: Original didn't lock the screen for access lockScreen(); diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index e2e699d1fd..87a6ae251f 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -175,7 +175,6 @@ public: void Copy_Mem(const byte *srcSurface, int x1, int y1, uint16 width, int height, byte *destSurface, int destX, int destY); void Sprite_Vesa(byte *surface, const byte *spriteData, int xp, int yp, int spriteIndex); void m_scroll16(const byte *surface, int xs, int ys, int width, int height, int destX, int destY); - void m_scroll16A(const byte *surface, int xs, int ys, int width, int height, int destX, int destY); void Trans_bloc2(byte *surface, byte *col, int size); void NB_SCREEN(bool initPalette); }; |