ScummVM API documentation
totfile.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  * This file is dual-licensed.
22  * In addition to the GPLv3 license mentioned above, this code is also
23  * licensed under LGPL 2.1. See LICENSES/COPYING.LGPL file for the
24  * full text of the license.
25  *
26  */
27 
28 #ifndef GOB_TOTFILE_H
29 #define GOB_TOTFILE_H
30 
31 #include "common/str.h"
32 
33 namespace Common {
34 class SeekableReadStream;
35 }
36 
37 namespace Gob {
38 
39 class TOTFile {
40 public:
41  enum Function {
42  kFunctionStart = 0,
43  kFunctionCenter = 13
44  };
45 
46  struct Properties {
47  uint8 versionMajor;
48  uint8 versionMinor;
49  uint32 variablesCount;
50  uint32 textsOffset;
51  uint32 resourcesOffset;
52  uint16 animDataSize;
53  uint8 imFileNumber;
54  uint8 exFileNumber;
55  uint8 communHandling;
56  uint16 functions[14];
57  uint32 scriptEnd;
58  uint32 textsSize;
59  uint32 resourcesSize;
60  };
61 
62  TOTFile(GobEngine *vm);
63  ~TOTFile();
64 
65  bool load(const Common::String &fileName);
66  void unload();
67 
68  Common::SeekableReadStream *getStream() const;
69  bool getProperties(Properties &props) const;
70 
71  static Common::String createFileName(const Common::String &base, bool &isLOM);
72  static Common::String getFileBase(const Common::String &fileName);
73 
74 private:
75  GobEngine *_vm;
76 
78 
79  byte _header[128];
80 };
81 
82 } // End of namespace Gob
83 
84 #endif // GOB_TOTFILE_H
Definition: gob.h:163
Definition: str.h:59
Definition: stream.h:745
Definition: anifile.h:40
Definition: algorithm.h:29
Definition: totfile.h:46
Definition: totfile.h:39