aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorKari Salminen2007-06-25 17:18:51 +0000
committerKari Salminen2007-06-25 17:18:51 +0000
commit696b99e9b74017ffe529cbeea9d504a03915e12a (patch)
treebbc9a25422ad7abc9ed4147045aed0d72af2f880 /engines
parentbfa84a05bfe9cf981cbc8e2bbb46ea5a8785f051 (diff)
downloadscummvm-rg350-696b99e9b74017ffe529cbeea9d504a03915e12a.tar.gz
scummvm-rg350-696b99e9b74017ffe529cbeea9d504a03915e12a.tar.bz2
scummvm-rg350-696b99e9b74017ffe529cbeea9d504a03915e12a.zip
Unified GfxMgr::putPixelsA-function's priority info handling.
svn-id: r27710
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/graphics.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 193485ebe3..b81871254c 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -808,6 +808,8 @@ int GfxMgr::deinitMachine() {
* FIXME: CGA rendering doesn't work correctly with AGI256 or AGI256-2.
*/
void GfxMgr::putPixelsA(int x, int y, int n, uint8 *p) {
+ const uint rShift = _vm->_debug.priority ? 4 : 0; // Priority information is in the top 4 bits of a byte taken from sbuf16c.
+
// Choose the correct screen to read from. If AGI256 or AGI256-2 is used and we're not trying to show the priority information,
// then choose the 256 color screen, otherwise choose the 16 color screen (Which also has the priority information).
p += _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) && !_vm->_debug.priority ? FROM_SBUF16_TO_SBUF256_OFFSET : 0;
@@ -815,17 +817,13 @@ void GfxMgr::putPixelsA(int x, int y, int n, uint8 *p) {
if (_vm->_renderMode == Common::kRenderCGA) {
for (x *= 2; n--; p++, x += 2) {
register uint16 q = (cgaMap[(*p & 0xf0) >> 4] << 4) | cgaMap[*p & 0x0f];
- if (_vm->_debug.priority)
- q >>= 4;
- *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = q & 0x0f0f;
+ *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = (q >> rShift) & 0x0f0f;
}
} else {
const uint16 mask = _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) && !_vm->_debug.priority ? 0xffff : 0x0f0f;
for (x *= 2; n--; p++, x += 2) {
register uint16 q = ((uint16) * p << 8) | *p;
- if (_vm->_debug.priority)
- q >>= 4;
- *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = q & mask;
+ *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = (q >> rShift) & mask;
}
}
}