mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
Cleanup: remove never used support for builtin static data in StaticResource.
svn-id: r46053
This commit is contained in:
parent
77fda6cf93
commit
d167197a52
@ -348,7 +348,7 @@ class StaticResource {
|
||||
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 @@ private:
|
||||
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 @@ private:
|
||||
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 @@ private:
|
||||
Common::List<ResData> _resList;
|
||||
|
||||
const FileType *_fileLoader;
|
||||
const BuiltinRes *_builtIn;
|
||||
const int *_dataTable;
|
||||
};
|
||||
|
||||
|
@ -514,23 +514,18 @@ bool StaticResource::init() {
|
||||
};
|
||||
#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 @@ bool StaticResource::prefetchId(int id) {
|
||||
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 @@ bool StaticResource::checkResList(int id, int &type, const void *&ptr, int &size
|
||||
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 @@ const void *StaticResource::getData(int id, int requesttype, int &size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ptr = checkForBuiltin(id, type, size);
|
||||
if (ptr) {
|
||||
if (type == requesttype)
|
||||
return ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!prefetchId(id))
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user