[Scummvm-cvs-logs] scummvm master -> f8b1a16e3c10580f7945fd36149b6f1d2a277753
Strangerke
Strangerke at scummvm.org
Wed Mar 27 21:30:17 CET 2013
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f8b1a16e3c HOPKINS: Remove more dead code, simplify a couple of statements in Copy_Vga16()
Commit: f8b1a16e3c10580f7945fd36149b6f1d2a277753
https://github.com/scummvm/scummvm/commit/f8b1a16e3c10580f7945fd36149b6f1d2a277753
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-03-27T13:29:02-07:00
Commit Message:
HOPKINS: Remove more dead code, simplify a couple of statements in Copy_Vga16()
Changed paths:
engines/hopkins/graphics.cpp
engines/hopkins/graphics.h
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 255a000..589259b 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 e2e699d..87a6ae2 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);
};
More information about the Scummvm-git-logs
mailing list