mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-06 02:46:49 +00:00
DIRECTOR: Using shared casts for rendering
This commit is contained in:
parent
aac6c9695a
commit
0b9e3607a0
@ -67,6 +67,9 @@ public:
|
||||
const byte *getPalette() const { return _currentPalette; }
|
||||
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
|
||||
void loadSharedCastsFrom(Common::String filename);
|
||||
Common::HashMap<int, Common::SeekableReadStream *> getSharedDIB() const { return _sharedDIB; }
|
||||
Common::HashMap<int, Common::SeekableReadStream *> getSharedSTXT() const { return _sharedSTXT; }
|
||||
Common::HashMap<int, Cast *> getSharedCasts() const { return _sharedCasts; }
|
||||
|
||||
Common::HashMap<Common::String, Score *> *_movies;
|
||||
Score *_currentScore;
|
||||
|
@ -1118,7 +1118,18 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
|
||||
if ((_sprites[i]->_trails == 0 && renderTrail) || (_sprites[i]->_trails == 1 && !renderTrail))
|
||||
continue;
|
||||
|
||||
Cast *cast = _vm->_currentScore->_casts[_sprites[i]->_castId];
|
||||
Cast *cast;
|
||||
if (!_vm->_currentScore->_casts.contains(_sprites[i]->_castId)) {
|
||||
if (!_vm->getSharedCasts().contains(_sprites[i]->_castId)) {
|
||||
warning("Cast id %d not found", _sprites[i]->_castId);
|
||||
continue;
|
||||
} else {
|
||||
cast = _vm->getSharedCasts().getVal(_sprites[i]->_castId);
|
||||
}
|
||||
} else {
|
||||
cast = _vm->_currentScore->_casts[_sprites[i]->_castId];
|
||||
}
|
||||
|
||||
if (cast->type == kCastText) {
|
||||
renderText(surface, i);
|
||||
continue;
|
||||
@ -1128,11 +1139,16 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
|
||||
uint32 imgId = 1024 + _sprites[i]->_castId;
|
||||
|
||||
if (!_vm->_currentScore->getArchive()->hasResource(MKTAG('D', 'I', 'B', ' '), imgId)) {
|
||||
continue;
|
||||
if (!_vm->getSharedDIB().contains(imgId)) {
|
||||
warning("DIB id %d not found", imgId);
|
||||
continue;
|
||||
} else {
|
||||
img.loadStream(*_vm->getSharedDIB().getVal(imgId));
|
||||
}
|
||||
} else {
|
||||
img.loadStream(*_vm->_currentScore->getArchive()->getResource(MKTAG('D', 'I', 'B', ' '), imgId));
|
||||
}
|
||||
|
||||
img.loadStream(*_vm->_currentScore->getArchive()->getResource(MKTAG('D', 'I', 'B', ' '), imgId));
|
||||
|
||||
uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX;
|
||||
uint32 regY = static_cast<BitmapCast *>(_sprites[i]->_cast)->regY;
|
||||
uint32 rectLeft = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.left;
|
||||
|
Loading…
x
Reference in New Issue
Block a user