ScummVM API documentation
context.h
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef LINGODEC_CONTEXT_H
8 #define LINGODEC_CONTEXT_H
9 
10 #include "common/array.h"
11 #include "common/stablemap.h"
12 
13 namespace Common {
14 class SeekableReadStream;
15 }
16 
17 namespace LingoDec {
18 
19 class ChunkResolver;
20 struct Script;
21 struct ScriptContextMapEntry;
22 struct ScriptNames;
23 
24 /* ScriptContext */
25 
26 struct ScriptContext {
27  int32 unknown0;
28  int32 unknown1;
29  uint32 entryCount;
30  uint32 entryCount2;
31  uint16 entriesOffset;
32  int16 unknown2;
33  int32 unknown3;
34  int32 unknown4;
35  int32 unknown5;
36  int32 lnamSectionID;
37  uint16 validCount;
38  uint16 flags;
39  int16 freePointer;
40 
41  unsigned int version;
42  ChunkResolver *resolver;
43  ScriptNames *lnam;
46 
47  ScriptContext(unsigned int version_, ChunkResolver *resolver_) : version(version_),
48  resolver(resolver_),
49  lnam(nullptr) {}
50 
51  void read(Common::SeekableReadStream &stream);
52  bool validName(int id) const;
53  Common::String getName(int id) const;
54  void parseScripts();
55 };
56 
57 /* ScriptContextMapEntry */
58 
60  int32 unknown0;
61  int32 sectionID;
62  uint16 unknown1;
63  uint16 unknown2;
64 
65  void read(Common::SeekableReadStream &stream);
66 };
67 
68 } // namespace LingoDec
69 
70 #endif // LINGODEC_CONTEXT_H
Definition: names.h:44
Definition: str.h:59
Definition: array.h:52
Definition: cast.h:33
Definition: stream.h:745
Definition: stablemap.h:43
Definition: context.h:59
Definition: algorithm.h:29
Definition: resolver.h:15
Definition: context.h:26