aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/resource.h11
-rw-r--r--engines/kyra/staticres.cpp40
2 files changed, 6 insertions, 45 deletions
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 4c66c1852d..294cb932f7 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -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;
};
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 9a693533be..918df6fc7d 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -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;