ScummVM API documentation
hqr.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef TWINE_RESOURCES_HQR_H
23#define TWINE_RESOURCES_HQR_H
24
25#include "common/scummsys.h"
26#include "common/stream.h"
27#include "graphics/palette.h"
28#include "twine/shared.h"
29
30namespace TwinE {
31
32class TwinEEngine;
33
39namespace HQR {
40
41
49int32 getEntry(uint8 *ptr, const char *filename, int32 index);
50inline int32 getEntry(uint8 *ptr, const TwineResource &resource) {
51 return getEntry(ptr, resource.hqr, resource.index);
52}
53
60int32 entrySize(const char *filename, int32 index);
61inline int32 entrySize(const TwineResource &resource) {
62 return entrySize(resource.hqr, resource.index);
63}
64
70int32 numEntries(const char *filename);
71
80int32 getAllocEntry(uint8 **ptr, const char *filename, int32 index);
81inline int32 getAllocEntry(uint8 **ptr, const TwineResource &resource) {
82 return getAllocEntry(ptr, resource.hqr, resource.index);
83}
84
88bool dumpEntry(const char *filename, int32 index, const char *targetFileName);
89inline bool dumpEntry(const TwineResource &resource, const char *targetFileName) {
90 return dumpEntry(resource.hqr, resource.index, targetFileName);
91}
92
100int32 getVoxEntry(uint8 *ptr, const char *filename, int32 index, int32 hiddenIndex);
109int32 getAllocVoxEntry(uint8 **ptr, const char *filename, int32 index, int32 hiddenIndex);
110
111bool getPaletteEntry(Graphics::Palette &palette, const char *filename, int32 index);
112inline bool getPaletteEntry(Graphics::Palette &palette, const TwineResource &resource) {
113 return getPaletteEntry(palette, resource.hqr, resource.index);
114}
115
116Common::SeekableReadStream *makeReadStream(const char *filename, int index);
117inline Common::SeekableReadStream *makeReadStream(const TwineResource &resource) {
118 return makeReadStream(resource.hqr, resource.index);
119}
120} // namespace HQR
121
122} // namespace TwinE
123
124#endif
Definition: stream.h:745
Simple class for handling a palette data.
Definition: palette.h:61
bool dumpEntry(const char *filename, int32 index, const char *targetFileName)
Helper method to dump the content of the given hqr index to a file.
int32 getAllocEntry(uint8 **ptr, const char *filename, int32 index)
int32 getVoxEntry(uint8 *ptr, const char *filename, int32 index, int32 hiddenIndex)
int32 entrySize(const char *filename, int32 index)
int32 getEntry(uint8 *ptr, const char *filename, int32 index)
int32 getAllocVoxEntry(uint8 **ptr, const char *filename, int32 index, int32 hiddenIndex)
int32 numEntries(const char *filename)
Definition: shared.h:689