diff options
Diffstat (limited to 'engines/agi/graphics.cpp')
-rw-r--r-- | engines/agi/graphics.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index 2d64a4352e..193485ebe3 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -804,9 +804,14 @@ int GfxMgr::deinitMachine() { * @param x x coordinate of the row start (AGI coord.) * @param y y coordinate of the row start (AGI coord.) * @param n number of pixels in the row - * @param p pointer to the row start in the AGI screen + * @param p pointer to the row start in the AGI screen (Always use sbuf16c as base, not sbuf256c) + * FIXME: CGA rendering doesn't work correctly with AGI256 or AGI256-2. */ void GfxMgr::putPixelsA(int x, int y, int n, uint8 *p) { + // 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; + if (_vm->_renderMode == Common::kRenderCGA) { for (x *= 2; n--; p++, x += 2) { register uint16 q = (cgaMap[(*p & 0xf0) >> 4] << 4) | cgaMap[*p & 0x0f]; @@ -815,7 +820,7 @@ void GfxMgr::putPixelsA(int x, int y, int n, uint8 *p) { *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = q & 0x0f0f; } } else { - const uint16 mask = _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) ? 0xffff : 0x0f0f; + 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) |