diff options
Diffstat (limited to 'engines/agi/detection.cpp')
| -rw-r--r-- | engines/agi/detection.cpp | 36 | 
1 files changed, 28 insertions, 8 deletions
| diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index a0736d0cc3..5141ab761f 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -28,6 +28,7 @@  #include "engines/advancedDetector.h"  #include "common/config-manager.h"  #include "common/file.h" +#include "common/md5.h"  #include "common/savefile.h"  #include "common/textconsole.h"  #include "graphics/thumbnail.h" @@ -35,6 +36,9 @@  #include "agi/agi.h"  #include "agi/preagi.h" +#include "agi/preagi_mickey.h" +#include "agi/preagi_troll.h" +#include "agi/preagi_winnie.h"  #include "agi/wagparser.h" @@ -93,6 +97,14 @@ void AgiBase::initVersion() {  	_gameVersion = _gameDescription->version;  } +const char *AgiBase::getDiskName(uint16 id) { +	for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileName != NULL; i++) +		if (_gameDescription->desc.filesDescriptions[i].fileType == id) +			return _gameDescription->desc.filesDescriptions[i].fileName; + +	return ""; +} +  }  static const PlainGameDescriptor agiGames[] = { @@ -182,8 +194,19 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD  	switch (gd->gameType) {  	case Agi::GType_PreAGI: -		*engine = new Agi::PreAgiEngine(syst, gd); +		switch (gd->gameID) { +		case GID_MICKEY: +			*engine = new Agi::MickeyEngine(syst, gd); +			break; +		case GID_TROLL: +			*engine = new Agi::TrollEngine(syst, gd); +			break; +		case GID_WINNIE: +			*engine = new Agi::WinnieEngine(syst, gd); +			break; +		}  		break; +	case Agi::GType_V1:  	case Agi::GType_V2:  	case Agi::GType_V3:  		*engine = new Agi::AgiEngine(syst, gd); @@ -258,12 +281,7 @@ SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int sl  		char saveVersion = in->readByte();  		if (saveVersion >= 4) { -			Graphics::Surface *thumbnail = new Graphics::Surface(); -			assert(thumbnail); -			if (!Graphics::loadThumbnail(*in, *thumbnail)) { -				delete thumbnail; -				thumbnail = 0; -			} +			Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*in);  			desc.setThumbnail(thumbnail); @@ -482,7 +500,9 @@ int AgiEngine::agiDetectGame() {  	assert(_gameDescription != NULL); -	if (getVersion() <= 0x2999) { +	if (getVersion() <= 0x2001) { +		_loader = new AgiLoader_v1(this); +	} else if (getVersion() <= 0x2999) {  		_loader = new AgiLoader_v2(this);  	} else {  		_loader = new AgiLoader_v3(this); | 
