ScummVM API documentation
handle.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 * Graphics Memory Manager data structures
21 */
22
23#ifndef TINSEL_HANDLE_H
24#define TINSEL_HANDLE_H
25
26#include "common/path.h"
27#include "tinsel/dw.h" // new data types
28
29namespace Common {
30class File;
31}
32
33namespace Tinsel {
34
35struct FONT;
36struct MEMHANDLE;
37struct PALETTE;
38struct IMAGE;
39struct ACTORDATA;
40struct PROCESS_STRUC;
41
42class Handle {
43public:
44 Handle();
45 virtual ~Handle();
46
51
52 FONT *GetFont(SCNHANDLE offset);
53 uint32 GetFontCharacterCount(const byte *fontData) const;
54 PALETTE *GetPalette(SCNHANDLE offset);
55 const IMAGE *GetImage(SCNHANDLE offset);
56 void SetImagePalette(SCNHANDLE offset, SCNHANDLE palHandle);
57 SCNHANDLE GetFontImageHandle(SCNHANDLE offset);
58 const ACTORDATA *GetActorData(SCNHANDLE offset, uint32 count);
59 const PROCESS_STRUC *GetProcessData(SCNHANDLE offset, uint32 count);
60 byte *LockMem(SCNHANDLE offset);
61
62 void LockScene(SCNHANDLE offset);
63 void UnlockScene(SCNHANDLE offset);
64
65 bool IsCdPlayHandle(SCNHANDLE offset);
66
67 void TouchMem(SCNHANDLE offset);
68
69 // Called at scene startup
70 void SetCdPlaySceneDetails(const char *fileName);
71
72 // Called at game startup
73 void SetCdPlayHandle(int fileNum);
74
75 void LoadExtraGraphData(
76 SCNHANDLE start, // Handle of start of range
77 SCNHANDLE next); // Handle of end of range + 1
78
79 int CdNumber(SCNHANDLE offset);
80
81 // Used for skipping DW1 introduction
82 SCNHANDLE GetDw1TitleSceneHandle() { return _dw1TitleSceneHandle; }
83
84 // Noir
85 SCNHANDLE FindLanguageSceneHandle(const char *fileName);
86
87#ifdef BODGE
88 bool ValidHandle(SCNHANDLE offset);
89#endif
90
91 // Used by debugger
92 int GetSceneCount();
93 Common::String GetSceneName(int index);
94
95private:
96 void LoadFile(MEMHANDLE *pH); // load a memory block as a file
97 void OpenCDGraphFile();
98 void LoadCDGraphData(MEMHANDLE *pH);
99
100 // handle table gets loaded from index file at runtime
101 MEMHANDLE *_handleTable;
102
103 // number of handles in the handle table
104 uint _numHandles;
105
106 uint32 _cdPlayHandle;
107
108 SCNHANDLE _cdBaseHandle, _cdTopHandle;
109 Common::File *_cdGraphStream;
110
111 Common::Path _szCdPlayFile;
112
113 SCNHANDLE _dw1TitleSceneHandle;
114};
115
116} // End of namespace Tinsel
117
118#endif // TINSEL_HANDLE_H
Definition: file.h:47
Definition: path.h:52
Definition: str.h:59
Definition: handle.h:42
void SetupHandleTable()
Definition: algorithm.h:29
Definition: actors.h:36
uint32 SCNHANDLE
Definition: dw.h:31
Definition: actors.h:81
Definition: text.h:53
Definition: object.h:59
Definition: palette.h:62
Definition: sched.h:35