mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 08:53:51 +00:00
Fix priority screen showing when using AGI256 or AGI256-2.
svn-id: r27707
This commit is contained in:
parent
bf4e75b678
commit
a741f3c010
@ -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)
|
||||
|
@ -686,7 +686,7 @@ void PictureMgr::showPic() {
|
||||
i = 0;
|
||||
offset = _vm->_game.lineMinPrint * CHAR_LINES;
|
||||
for (y = 0; y < _HEIGHT; y++) {
|
||||
_gfx->putPixelsA(0, y + offset, _WIDTH, &_vm->_game.sbuf[i]);
|
||||
_gfx->putPixelsA(0, y + offset, _WIDTH, &_vm->_game.sbuf16c[i]);
|
||||
i += _WIDTH;
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,8 @@ void SpritesMgr::objsRestoreArea(Sprite *s) {
|
||||
int y, offset;
|
||||
int16 xPos = s->xPos, yPos = s->yPos;
|
||||
int16 xSize = s->xSize, ySize = s->ySize;
|
||||
uint8 *p0, *q;
|
||||
uint8 *q;
|
||||
uint32 pos0;
|
||||
|
||||
if (xPos + xSize > _WIDTH)
|
||||
xSize = _WIDTH - xPos;
|
||||
@ -236,14 +237,14 @@ void SpritesMgr::objsRestoreArea(Sprite *s) {
|
||||
if (xSize <= 0 || ySize <= 0)
|
||||
return;
|
||||
|
||||
p0 = &_vm->_game.sbuf[xPos + yPos * _WIDTH];
|
||||
pos0 = xPos + yPos * _WIDTH;
|
||||
q = s->buffer;
|
||||
offset = _vm->_game.lineMinPrint * CHAR_LINES;
|
||||
for (y = 0; y < ySize; y++) {
|
||||
memcpy(p0, q, xSize);
|
||||
_gfx->putPixelsA(xPos, yPos + y + offset, xSize, p0);
|
||||
memcpy(&_vm->_game.sbuf[pos0], q, xSize);
|
||||
_gfx->putPixelsA(xPos, yPos + y + offset, xSize, &_vm->_game.sbuf16c[pos0]);
|
||||
q += xSize;
|
||||
p0 += _WIDTH;
|
||||
pos0 += _WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
@ -728,7 +729,7 @@ void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2) {
|
||||
debugC(7, kDebugLevelSprites, "%d, %d, %d, %d", x1, y1, x2, y2);
|
||||
|
||||
w = x2 - x1 + 1;
|
||||
q = &_vm->_game.sbuf[x1 + _WIDTH * y1];
|
||||
q = &_vm->_game.sbuf16c[x1 + _WIDTH * y1];
|
||||
offset = _vm->_game.lineMinPrint * CHAR_LINES;
|
||||
for (i = y1; i <= y2; i++) {
|
||||
_gfx->putPixelsA(x1, i + offset, w, q);
|
||||
|
Loading…
x
Reference in New Issue
Block a user