ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
30 namespace TwinE {
31 
32 class TwinEEngine;
33 
39 namespace HQR {
40 
41 
49 int32 getEntry(uint8 *ptr, const char *filename, int32 index);
50 inline int32 getEntry(uint8 *ptr, const TwineResource &resource) {
51  return getEntry(ptr, resource.hqr, resource.index);
52 }
53 
60 int32 entrySize(const char *filename, int32 index);
61 inline int32 entrySize(const TwineResource &resource) {
62  return entrySize(resource.hqr, resource.index);
63 }
64 
70 int32 numEntries(const char *filename);
71 
80 int32 getAllocEntry(uint8 **ptr, const char *filename, int32 index);
81 inline int32 getAllocEntry(uint8 **ptr, const TwineResource &resource) {
82  return getAllocEntry(ptr, resource.hqr, resource.index);
83 }
84 
88 bool dumpEntry(const char *filename, int32 index, const char *targetFileName);
89 inline bool dumpEntry(const TwineResource &resource, const char *targetFileName) {
90  return dumpEntry(resource.hqr, resource.index, targetFileName);
91 }
92 
100 int32 getVoxEntry(uint8 *ptr, const char *filename, int32 index, int32 hiddenIndex);
109 int32 getAllocVoxEntry(uint8 **ptr, const char *filename, int32 index, int32 hiddenIndex);
110 
111 bool getPaletteEntry(Graphics::Palette &palette, const char *filename, int32 index);
112 inline bool getPaletteEntry(Graphics::Palette &palette, const TwineResource &resource) {
113  return getPaletteEntry(palette, resource.hqr, resource.index);
114 }
115 
116 Common::SeekableReadStream *makeReadStream(const char *filename, int index);
117 inline Common::SeekableReadStream *makeReadStream(const TwineResource &resource) {
118  return makeReadStream(resource.hqr, resource.index);
119 }
120 } // namespace HQR
121 
122 } // namespace TwinE
123 
124 #endif
int32 getAllocVoxEntry(uint8 **ptr, const char *filename, int32 index, int32 hiddenIndex)
int32 getAllocEntry(uint8 **ptr, const char *filename, int32 index)
int32 entrySize(const char *filename, int32 index)
Definition: stream.h:745
bool dumpEntry(const char *filename, int32 index, const char *targetFileName)
Helper method to dump the content of the given hqr index to a file.
Definition: shared.h:687
int32 getEntry(uint8 *ptr, const char *filename, int32 index)
Definition: achievements_tables.h:27
Simple class for handling a palette data.
Definition: palette.h:51
int32 getVoxEntry(uint8 *ptr, const char *filename, int32 index, int32 hiddenIndex)
int32 numEntries(const char *filename)