ScummVM API documentation
compact.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 SKY_COMPACT_H
23 #define SKY_COMPACT_H
24 
25 #include "sky/sky.h"
26 #include "sky/struc.h"
27 #include "sky/skydefs.h"
28 
29 namespace Common {
30 class File;
31 }
32 
33 enum CptIds {
34  CPT_JOEY = 1,
35  CPT_FOSTER = 3,
36  CPT_TEXT_1 = 0x17,
37  CPT_TEXT_11 = 0x21,
38  CPT_MENU_BAR = 0x2E,
39  CPT_REICH_DOOR_20 = 0x30AB,
40  CPT_MOVE_LIST = 0xBD,
41  CPT_TALK_TABLE_LIST = 0xBC
42 };
43 
44 enum CptTypeIds {
45  CPT_NULL = 0,
46  COMPACT,
47  TURNTAB,
48  ANIMSEQ,
49  MISCBIN,
50  GETTOTAB,
51  ROUTEBUF,
52  MAINLIST,
53  NUM_CPT_TYPES
54 };
55 
56 namespace Sky {
57 
58 class SkyCompact {
59 public:
60  SkyCompact();
61  ~SkyCompact();
62  Compact *fetchCpt(uint16 cptId);
63  Compact *fetchCptInfo(uint16 cptId, uint16 *elems = NULL, uint16 *type = NULL, char *name = NULL, size_t nameSize = 0);
64  static uint16 getSub(Compact *cpt, uint16 mode);
65  static void setSub(Compact *cpt, uint16 mode, uint16 value);
66  static MegaSet *getMegaSet(Compact *cpt);
67  uint16 *getGrafixPtr(Compact *cpt);
68  uint16 *getTurnTable(Compact *cpt, uint16 dir);
69  void *getCompactElem(Compact *cpt, uint16 off);
70  bool cptIsId(Compact *cpt, uint16 id);
71  uint8 *createResetData(uint16 gameVersion);
72  uint16 _numSaveIds;
73  uint16 *_saveIds;
74  // - debugging functions
75  uint16 findCptId(void *cpt);
76  uint16 findCptId(const char *cptName);
77  uint16 giveNumDataLists();
78  uint16 giveDataListLen(uint16 listNum);
79  const char *nameForType(uint16 type);
80 private:
81  void checkAndFixOfficerBluntError();
82 
83  uint16 _numDataLists;
84  uint16 *_dataListLen;
85  uint16 *_rawBuf;
86  char *_asciiBuf;
87  Compact ***_compacts;
88  char ***_cptNames;
89  uint16 **_cptSizes;
90  uint16 **_cptTypes;
91  Common::File *_cptFile;
92  uint32 _resetDataPos;
93  static const char *const _typeNames[NUM_CPT_TYPES];
94 };
95 
96 } // End of namespace Sky
97 
98 #endif
Definition: struc.h:78
Definition: struc.h:59
Definition: file.h:47
Definition: algorithm.h:29
Definition: compact.h:58
Definition: autoroute.h:28