ScummVM API documentation
scene_resources.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 HOLLYWOOD_MONSTERS_SCENES_SCENE_RESOURCES_H
23#define HOLLYWOOD_MONSTERS_SCENES_SCENE_RESOURCES_H
24
25#include "common/array.h"
26#include "common/types.h"
27
28#include "hollywood/resource.h"
29
30namespace Graphics {
31class ManagedSurface;
32}
33
34namespace Hollywood {
35
36class IndexedSurfaceBuffer;
37
45public:
47
48 bool loadChunkTable(const char *archiveName);
49 bool validateChunk(const char *archiveName, const char *sceneDebugName,
50 uint index) const;
51 bool validateChunkRange(const char *archiveName, const char *sceneDebugName,
52 uint firstChunk, uint lastChunk) const;
53 bool validateRequiredChunks(const char *archiveName, const char *sceneDebugName,
54 uint requiredChunkCount, uint framebufferChunkIndex = 0) const;
55 uint32 totalChunkSize(uint firstChunk, uint lastChunk) const;
56 void allocateArena(uint32 byteCount);
57
58 bool loadFixedChunk(const char *sceneDebugName,
59 uint index, Common::Array<byte> &destination, uint fixedSize);
60 bool loadFixedChunk(const char *sceneDebugName,
61 uint index, Graphics::ManagedSurface &destination, uint fixedSize);
62 bool loadFixedChunk(const char *sceneDebugName,
63 uint index, IndexedSurfaceBuffer &destination, uint fixedSize);
64 bool loadVariableChunk(uint index, Common::Array<byte> &destination);
65 bool loadChunkTo(const char *sceneDebugName, uint index,
66 Common::Array<byte> &destination, uint32 destinationOffset);
67 bool loadArenaChunk(const char *sceneDebugName, uint index);
68 bool loadArenaChunk(const char *sceneDebugName, uint archiveIndex,
69 uint localChunkIndex);
70 bool loadArenaChunkAlias(const char *sceneDebugName, uint sourceIndex,
71 uint aliasIndex, uint targetIndex);
72
73 ResourceChunkTable _chunkTable;
74 uint32 _chunkOffsets[kResourceChunkCount];
75 uint32 _arenaCursor;
77 Common::Array<byte> _metadata;
78
79private:
80 void clearChunkOffsets();
81
82 ChunkArchive _archive;
83};
84
85} // End of namespace Hollywood
86
87#endif // HOLLYWOOD_MONSTERS_SCENES_SCENE_RESOURCES_H
Definition: managed_surface.h:51
Definition: resource.h:59
Definition: graphics.h:74
Definition: scene_resources.h:44
Definition: formatinfo.h:28
Definition: resource.h:46