diff options
author | Gregory Montoir | 2004-01-11 14:11:36 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-11 14:11:36 +0000 |
commit | 6dc8407297fc11301c8abe6c7e0801f046567449 (patch) | |
tree | 9ab212394c1443e14f8d6dcf4cffb1c18c136035 /queen/bankman.cpp | |
parent | f2874733b0cee77307ef7abd59af9b5c4ac43c9f (diff) | |
download | scummvm-rg350-6dc8407297fc11301c8abe6c7e0801f046567449.tar.gz scummvm-rg350-6dc8407297fc11301c8abe6c7e0801f046567449.tar.bz2 scummvm-rg350-6dc8407297fc11301c8abe6c7e0801f046567449.zip |
cleanup
svn-id: r12318
Diffstat (limited to 'queen/bankman.cpp')
-rw-r--r-- | queen/bankman.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/queen/bankman.cpp b/queen/bankman.cpp index 827a273c01..236573b664 100644 --- a/queen/bankman.cpp +++ b/queen/bankman.cpp @@ -26,14 +26,12 @@ namespace Queen { - BankManager::BankManager(Resource *res) : _res(res) { memset(_frames, 0, sizeof(_frames)); memset(_banks, 0, sizeof(_banks)); } - BankManager::~BankManager() { for(uint32 i = 0; i < MAX_BANKS_NUMBER; ++i) { close(i); @@ -41,20 +39,15 @@ BankManager::~BankManager() { eraseFrames(true); } - void BankManager::load(const char *bankname, uint32 bankslot) { close(bankslot); _banks[bankslot].data = _res->loadFile(bankname); - if (!_banks[bankslot].data) { - error("Unable to open bank '%s'", bankname); - } int16 entries = (int16)READ_LE_UINT16(_banks[bankslot].data); if (entries < 0 || entries >= MAX_BANK_SIZE) { error("Maximum bank size exceeded or negative bank size : %d", entries); } - debug(9, "BankManager::load(%s, %d) - entries = %d", bankname, bankslot, entries); uint32 offset = 2; @@ -68,11 +61,9 @@ void BankManager::load(const char *bankname, uint32 bankslot) { } } - void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { debug(9, "BankManager::unpack(%d, %d, %d)", srcframe, dstframe, bankslot); - if (!_banks[bankslot].data) - error("BankManager::unpack() _banks[bankslot].data is NULL!"); + assert(_banks[bankslot].data != NULL); BobFrame *pbf = &_frames[dstframe]; uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe]; @@ -87,11 +78,9 @@ void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { memcpy(pbf->data, p + 8, size); } - void BankManager::overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { debug(9, "BankManager::overpack(%d, %d, %d)", srcframe, dstframe, bankslot); - if (!_banks[bankslot].data) - error("BankManager::overpack() _banks[bankslot].data is NULL!"); + assert(_banks[bankslot].data != NULL); uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe]; uint16 src_w = READ_LE_UINT16(p + 0); @@ -106,14 +95,12 @@ void BankManager::overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { } } - void BankManager::close(uint32 bankslot) { debug(9, "BankManager::close(%d)", bankslot); delete[] _banks[bankslot].data; memset(&_banks[bankslot], 0, sizeof(_banks[bankslot])); } - BobFrame *BankManager::fetchFrame(uint32 index) { debug(9, "BankManager::fetchFrame(%d)", index); if (index >= MAX_FRAMES_NUMBER) { @@ -122,7 +109,6 @@ BobFrame *BankManager::fetchFrame(uint32 index) { return &_frames[index]; } - void BankManager::eraseFrame(uint32 index) { debug(9, "BankManager::eraseFrame(%d)", index); BobFrame *pbf = &_frames[index]; @@ -130,7 +116,6 @@ void BankManager::eraseFrame(uint32 index) { memset(pbf, 0, sizeof(BobFrame)); } - void BankManager::eraseFrames(bool joe) { uint32 i = 0; if (!joe) { @@ -142,5 +127,4 @@ void BankManager::eraseFrames(bool joe) { } } - } // End of namespace Queen |