2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2004-01-08 14:10:32 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 01:34:23 +00:00
|
|
|
*
|
2004-01-08 14:10:32 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2008-01-05 12:45:14 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2004-01-08 14:10:32 +00:00
|
|
|
* GNU General Public License for more details.
|
2014-02-18 01:34:23 +00:00
|
|
|
*
|
2004-01-08 14:10:32 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-01-08 14:10:32 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-11-12 17:47:16 +00:00
|
|
|
#ifndef QUEEN_BANKMAN_H
|
|
|
|
#define QUEEN_BANKMAN_H
|
2004-01-08 14:10:32 +00:00
|
|
|
|
|
|
|
#include "common/util.h"
|
|
|
|
#include "queen/structs.h"
|
|
|
|
|
|
|
|
namespace Queen {
|
|
|
|
|
|
|
|
class Resource;
|
|
|
|
|
|
|
|
class BankManager {
|
|
|
|
public:
|
|
|
|
|
|
|
|
BankManager(Resource *res);
|
|
|
|
~BankManager();
|
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! load a bank into the specified slot
|
2004-01-08 14:10:32 +00:00
|
|
|
void load(const char *bankname, uint32 bankslot);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! unpack a frame from a loaded bank
|
2004-01-08 14:10:32 +00:00
|
|
|
void unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! unpack a frame over an existing one from a loaded bank
|
2004-01-08 14:10:32 +00:00
|
|
|
void overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! close a bank
|
2004-01-08 14:10:32 +00:00
|
|
|
void close(uint32 bankslot);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! get a reference to unpacked frame
|
2004-01-08 14:10:32 +00:00
|
|
|
BobFrame *fetchFrame(uint32 index);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! erase a frame
|
2004-01-08 14:10:32 +00:00
|
|
|
void eraseFrame(uint32 index);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! erase all unpacked frames
|
2004-01-09 13:36:37 +00:00
|
|
|
void eraseFrames(bool joe);
|
2004-01-08 14:10:32 +00:00
|
|
|
|
|
|
|
enum {
|
|
|
|
MAX_BANK_SIZE = 110,
|
|
|
|
MAX_FRAMES_NUMBER = 256,
|
|
|
|
MAX_BANKS_NUMBER = 18
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
struct PackedBank {
|
|
|
|
uint32 indexes[MAX_BANK_SIZE];
|
|
|
|
uint8 *data;
|
2007-02-21 20:27:48 +00:00
|
|
|
char name[20];
|
2004-01-08 14:10:32 +00:00
|
|
|
};
|
|
|
|
|
2004-12-31 00:25:18 +00:00
|
|
|
//! unpacked bob frames
|
2004-01-08 14:10:32 +00:00
|
|
|
BobFrame _frames[MAX_FRAMES_NUMBER];
|
|
|
|
|
|
|
|
//! banked bob frames
|
|
|
|
PackedBank _banks[MAX_BANKS_NUMBER];
|
|
|
|
|
|
|
|
Resource *_res;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Queen
|
|
|
|
|
|
|
|
#endif
|