diff options
| author | Matthew Hoops | 2010-11-19 21:25:36 +0000 | 
|---|---|---|
| committer | Matthew Hoops | 2010-11-19 21:25:36 +0000 | 
| commit | 7fb352e38a8dcfb8a980c60d15b071ad1a427386 (patch) | |
| tree | 4970ac0fec0bdce750a85e7a30dbeefa39c6bd61 /engines/mohawk/riven.cpp | |
| parent | 199a1c761960f1928d8ce80d607f6eedadc67957 (diff) | |
| download | scummvm-rg350-7fb352e38a8dcfb8a980c60d15b071ad1a427386.tar.gz scummvm-rg350-7fb352e38a8dcfb8a980c60d15b071ad1a427386.tar.bz2 scummvm-rg350-7fb352e38a8dcfb8a980c60d15b071ad1a427386.zip  | |
MOHAWK: Implement an image cache system
This should greatly improve the performance in Myst (especially Myst ME, which uses the slow JPEG decoder). This should also slightly improve the Riven performance; the sliders now work a bit better.
svn-id: r54388
Diffstat (limited to 'engines/mohawk/riven.cpp')
| -rw-r--r-- | engines/mohawk/riven.cpp | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index f2f4a42f0e..6e292a1a0e 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -264,6 +264,9 @@ void MohawkEngine_Riven::changeToStack(uint16 n) {  	_video->stopVideos();  	_video->clearMLST(); +	// Clear the graphics cache; images aren't used across stack boundaries +	_gfx->clearCache(); +  	// Clear the old stack files out  	for (uint32 i = 0; i < _mhk.size(); i++)  		delete _mhk[i]; @@ -317,6 +320,10 @@ void MohawkEngine_Riven::changeToCard(uint16 dest) {  	_curCard = dest;  	debug (1, "Changing to card %d", _curCard); +	// Clear the graphics cache (images typically aren't used +	// on different cards). +	_gfx->clearCache(); +  	if (!(getFeatures() & GF_DEMO)) {  		for (byte i = 0; i < 13; i++)  			if (_curStack == rivenSpecialChange[i].startStack && _curCard == matchRMAPToCard(rivenSpecialChange[i].startCardRMAP)) {  | 
