2018-10-22 07:21:27 +11: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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
2020-02-05 23:18:42 +11:00
|
|
|
#ifndef DRAGONS_BIGFILE_H
|
|
|
|
#define DRAGONS_BIGFILE_H
|
2018-10-22 07:21:27 +11:00
|
|
|
|
2018-11-07 22:27:05 +11:00
|
|
|
#include "common/file.h"
|
|
|
|
|
2018-10-22 07:21:27 +11:00
|
|
|
namespace Dragons {
|
|
|
|
|
2020-02-08 23:43:58 +11:00
|
|
|
class DragonsEngine;
|
|
|
|
|
|
|
|
#define DRAGONS_BIGFILE_TOTAL_FILES 576
|
|
|
|
|
|
|
|
struct FileInfo {
|
|
|
|
Common::String filename;
|
|
|
|
uint32 offset;
|
|
|
|
uint32 size;
|
|
|
|
FileInfo() {
|
|
|
|
offset = 0;
|
|
|
|
size = 0;
|
|
|
|
filename = "";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-11-07 22:27:05 +11:00
|
|
|
class BigfileArchive {
|
|
|
|
private:
|
2020-02-08 23:43:58 +11:00
|
|
|
DragonsEngine *_vm;
|
2018-11-07 22:27:05 +11:00
|
|
|
Common::File *_fd;
|
2020-02-08 23:43:58 +11:00
|
|
|
FileInfo _fileInfoTbl[DRAGONS_BIGFILE_TOTAL_FILES];
|
2020-02-07 17:01:19 +01:00
|
|
|
|
2018-11-07 22:27:05 +11:00
|
|
|
public:
|
2020-02-08 23:43:58 +11:00
|
|
|
BigfileArchive(DragonsEngine *vm, const char *filename);
|
2018-11-07 22:27:05 +11:00
|
|
|
virtual ~BigfileArchive();
|
2018-10-22 07:21:27 +11:00
|
|
|
|
2018-11-07 22:27:05 +11:00
|
|
|
byte *load(const char *filename, uint32 &dataSize);
|
2019-12-20 23:02:10 +11:00
|
|
|
bool doesFileExist(const char *filename);
|
2020-02-08 23:43:58 +11:00
|
|
|
|
|
|
|
private:
|
|
|
|
void loadFileInfoTbl();
|
|
|
|
uint32 getResourceId(const char *filename);
|
2018-10-22 07:21:27 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace dragons
|
|
|
|
|
2020-02-05 23:18:42 +11:00
|
|
|
#endif //DRAGONS_BIGFILE_H
|