GOB: Urban: Fix missing visuals at Cemetary/Lab

Urban Runner decouples _frontSurface and
_spritesArray[kFrontSurface] at that screen... *sigh*

svn-id: r55346
This commit is contained in:
Sven Hesse 2011-01-20 10:20:57 +00:00
parent dd3894a442
commit 6b85f809d9
4 changed files with 23 additions and 5 deletions

View File

@ -329,6 +329,17 @@ void Draw::initSpriteSurf(int16 index, int16 width, int16 height,
_spritesArray[index]->clear();
}
void Draw::freeSprite(int16 index) {
assert(index < SPRITES_COUNT);
_spritesArray[index].reset();
if (index == kFrontSurface)
_spritesArray[index] = _frontSurface;
if (index == kBackSurface)
_spritesArray[index] = _backSurface;
}
void Draw::adjustCoords(char adjust, int16 *coord1, int16 *coord2) {
if (_needAdjust == 2)
return;
@ -550,10 +561,12 @@ void Draw::forceBlit(bool backwards) {
return;
if (_frontSurface == _backSurface)
return;
/*
if (_spritesArray[kFrontSurface] != _frontSurface)
return;
if (_spritesArray[kBackSurface] != _backSurface)
return;
*/
if (!backwards) {
_frontSurface->blit(*_backSurface);

View File

@ -179,10 +179,7 @@ public:
void dirtiedRect(SurfacePtr surface, int16 left, int16 top, int16 right, int16 bottom);
void initSpriteSurf(int16 index, int16 width, int16 height, int16 flags);
void freeSprite(int16 index) {
assert(index < SPRITES_COUNT);
_spritesArray[index].reset();
}
void freeSprite(int16 index);
void adjustCoords(char adjust, int16 *coord1, int16 *coord2);
void adjustCoords(char adjust, uint16 *coord1, uint16 *coord2) {
adjustCoords(adjust, (int16 *)coord1, (int16 *)coord2);

View File

@ -66,6 +66,7 @@ void Inter_v6::setupOpcodesFunc() {
OPCODEFUNC(0x03, o6_loadCursor);
OPCODEFUNC(0x09, o6_assign);
OPCODEFUNC(0x19, o6_removeHotspot);
OPCODEFUNC(0x32, o1_copySprite);
OPCODEFUNC(0x33, o6_fillRect);
}

View File

@ -158,13 +158,20 @@ int VideoPlayer::openVideo(bool primary, const Common::String &file, Properties
screenSize ? _vm->_height : video->decoder->getHeight(), 0);
}
if (!_vm->_draw->_spritesArray[properties.sprite]) {
if (!_vm->_draw->_spritesArray[properties.sprite] &&
(properties.sprite != Draw::kFrontSurface) &&
(properties.sprite != Draw::kBackSurface)) {
properties.sprite = -1;
video->surface.reset();
video->decoder->setSurfaceMemory();
properties.x = properties.y = 0;
} else {
video->surface = _vm->_draw->_spritesArray[properties.sprite];
if (properties.sprite == Draw::kFrontSurface)
video->surface = _vm->_draw->_frontSurface;
if (properties.sprite == Draw::kBackSurface)
video->surface = _vm->_draw->_backSurface;
video->decoder->setSurfaceMemory(video->surface->getData(),
video->surface->getWidth(), video->surface->getHeight(), video->surface->getBPP());