[Scummvm-cvs-logs] SF.net SVN: scummvm:[46053] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Nov 22 00:06:23 CET 2009


Revision: 46053
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46053&view=rev
Author:   lordhoto
Date:     2009-11-21 23:06:22 +0000 (Sat, 21 Nov 2009)

Log Message:
-----------
Cleanup: remove never used support for builtin static data in StaticResource.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/resource.h
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h	2009-11-21 23:05:25 UTC (rev 46052)
+++ scummvm/trunk/engines/kyra/resource.h	2009-11-21 23:06:22 UTC (rev 46053)
@@ -348,7 +348,7 @@
 public:
 	static const Common::String staticDataFilename() { return "KYRA.DAT"; }
 
-	StaticResource(KyraEngine_v1 *vm) : _vm(vm), _resList(), _fileLoader(0), _builtIn(0), _dataTable(0) {}
+	StaticResource(KyraEngine_v1 *vm) : _vm(vm), _resList(), _fileLoader(0), _dataTable(0) {}
 	~StaticResource() { deinit(); }
 
 	bool loadStaticResourceFile();
@@ -388,7 +388,6 @@
 	struct FileType;
 
 	bool checkResList(int id, int &type, const void *&ptr, int &size);
-	const void *checkForBuiltin(int id, int &type, int &size);
 	const FileType *getFiletype(int type);
 	const void *getData(int id, int requesttype, int &size);
 
@@ -451,13 +450,6 @@
 		kLolRawDataBe32 = 14
 	};
 
-	struct BuiltinRes {
-		int id;
-		int type;
-		int size;
-		const void *data;
-	};
-
 	struct FileType {
 		int type;
 		typedef bool (StaticResource::*LoadFunc)(Common::SeekableReadStream &stream, void *&ptr, int &size);
@@ -477,7 +469,6 @@
 	Common::List<ResData> _resList;
 
 	const FileType *_fileLoader;
-	const BuiltinRes *_builtIn;
 	const int *_dataTable;
 };
 

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2009-11-21 23:05:25 UTC (rev 46052)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2009-11-21 23:06:22 UTC (rev 46053)
@@ -514,23 +514,18 @@
 	};
 #endif // ENABLE_LOL
 
-	if (_vm->game() == GI_KYRA1) {
-		_builtIn = 0;
+	if (_vm->game() == GI_KYRA1)
 		_dataTable = kyra1StaticRes;
-	} else if (_vm->game() == GI_KYRA2) {
-		_builtIn = 0;
+	else if (_vm->game() == GI_KYRA2)
 		_dataTable = kyra2StaticRes;
-	} else if (_vm->game() == GI_KYRA3) {
-		_builtIn = 0;
+	else if (_vm->game() == GI_KYRA3)
 		_dataTable = kyra3StaticRes;
 #ifdef ENABLE_LOL
-	} else if (_vm->game() == GI_LOL) {
-		_builtIn = 0;
+	else if (_vm->game() == GI_LOL)
 		_dataTable = kLolStaticRes;
 #endif // ENABLE_LOL
-	} else {
+	else
 		error("StaticResource: Unknown game ID");
-	}
 
 	return loadStaticResourceFile();
 }
@@ -614,9 +609,6 @@
 	if (checkResList(id, type, ptr, size))
 		return true;
 
-	if (checkForBuiltin(id, type, size))
-		return true;
-
 	const GameFlags &flags = _vm->gameFlags();
 	byte game = getGameID(flags);
 	byte platform = getPlatformID(flags);
@@ -696,21 +688,6 @@
 	return false;
 }
 
-const void *StaticResource::checkForBuiltin(int id, int &type, int &size) {
-	if (!_builtIn)
-		return 0;
-
-	for (int i = 0; _builtIn[i].data; ++i) {
-		if (_builtIn[i].id == id) {
-			size = _builtIn[i].size;
-			type = _builtIn[i].type;
-			return _builtIn[i].data;
-		}
-	}
-
-	return 0;
-}
-
 const StaticResource::FileType *StaticResource::getFiletype(int type) {
 	if (!_fileLoader)
 		return 0;
@@ -734,13 +711,6 @@
 		return 0;
 	}
 
-	ptr = checkForBuiltin(id, type, size);
-	if (ptr) {
-		if (type == requesttype)
-			return ptr;
-		return 0;
-	}
-
 	if (!prefetchId(id))
 		return 0;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list