diff options
author | Robert Göffringmann | 2004-12-16 06:10:11 +0000 |
---|---|---|
committer | Robert Göffringmann | 2004-12-16 06:10:11 +0000 |
commit | adbe2b8c49111e0d80a3a9e2890e7817e48ec60c (patch) | |
tree | 490892e959dda93c2b93561ac8ae1a7697587d51 /sky/compact.cpp | |
parent | e7f44ab3db1e47f01c719cb01b7fe76301d45b0e (diff) | |
download | scummvm-rg350-adbe2b8c49111e0d80a3a9e2890e7817e48ec60c.tar.gz scummvm-rg350-adbe2b8c49111e0d80a3a9e2890e7817e48ec60c.tar.bz2 scummvm-rg350-adbe2b8c49111e0d80a3a9e2890e7817e48ec60c.zip |
added some debugging functions
svn-id: r16074
Diffstat (limited to 'sky/compact.cpp')
-rw-r--r-- | sky/compact.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sky/compact.cpp b/sky/compact.cpp index 3b2eee59aa..46e9c11c34 100644 --- a/sky/compact.cpp +++ b/sky/compact.cpp @@ -406,4 +406,38 @@ uint8 *SkyCompact::createResetData(uint16 gameVersion) { error("Unable to find reset data for Beneath a Steel Sky Version 0.0%03d", gameVersion); } +// - debugging functions + +uint16 SkyCompact::findCptId(void *cpt) { + for (uint16 listCnt = 0; listCnt < _numDataLists; listCnt++) + for (uint16 elemCnt = 0; elemCnt < _dataListLen[listCnt]; elemCnt++) + if (_compacts[listCnt][elemCnt] == cpt) + return (listCnt << 12) | elemCnt; + // not found + debug(1, "Id for Compact %p wasn't found!", cpt); + return 0; +} + +uint16 SkyCompact::findCptId(const char *cptName) { + for (uint16 listCnt = 0; listCnt < _numDataLists; listCnt++) + for (uint16 elemCnt = 0; elemCnt < _dataListLen[listCnt]; elemCnt++) + if (_cptNames[listCnt][elemCnt] != 0) + if (scumm_stricmp(cptName, _cptNames[listCnt][elemCnt]) == 0) + return (listCnt << 12) | elemCnt; + // not found + debug(1, "Id for Compact %s wasn't found!", cptName); + return 0; +} + +uint16 SkyCompact::giveNumDataLists(void) { + return _numDataLists; +} + +uint16 SkyCompact::giveDataListLen(uint16 listNum) { + if (listNum >= _numDataLists) // list doesn't exist + return 0; + else + return _dataListLen[listNum]; +} + } // End of namespace Sky |