ScummVM API documentation
resource.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 /*
23  * This code is based on Labyrinth of Time code with assistance of
24  *
25  * Copyright (c) 1993 Terra Nova Development
26  * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
27  *
28  */
29 
30 #ifndef LAB_RESOURCE_H
31 #define LAB_RESOURCE_H
32 
33 namespace Lab {
34 
35 struct ViewData;
36 
37 enum StaticText {
38  kTextLowerFloor,
39  kTextMiddleFloor,
40  kTextUpperFloor,
41  kTextMedMazeFloor,
42  kTextHedgeMazeFloor,
43  kTextSurMazeFloor,
44  kTextCarnivalFloor,
45 
46  kTextSurmazeMessage,
47 
48  kTextFacingNorth,
49  kTextFacingEast,
50  kTextFacingSouth,
51  kTextFacingWest,
52 
53  kTextkLampOn,
54 
55  kTextTurnLeft,
56  kTextTurnRight,
57  kTextGoForward,
58  kTextNoPath,
59  kTextTakeItem,
60  kTextSave,
61  kTextLoad,
62  kTextBookmark,
63  kTextPersonal,
64  kTextDisk,
65  kTextSaveBook,
66  kTextRestoreBook,
67  kTextSaveFlash,
68  kTextRestoreFlash,
69  kTextSaveDisk,
70  kTextRestoreDisk,
71  kTextNoDiskInDrive,
72  kTextWriteProtected,
73  kTextSelectDisk,
74  kTextFormatFloppy,
75  kTextFormatting,
76 
77  kTextNothing,
78  kTextUseOnWhat,
79  kTextTakeWhat,
80  kTextMoveWhat,
81  kTextOpenWhat,
82  kTextCloseWhat,
83  kTextLookWhat,
84 
85  kTextUseMap,
86  kTextUseJournal,
87  kTextTurnkLampOn,
88  kTextTurnLampOff,
89  kTextUseWhiskey,
90  kTextUsePith,
91  kTextUseHelmet
92 };
93 
94 class Resource {
95 public:
96  Resource(LabEngine *vm);
97  ~Resource() {}
98 
99  Common::File *openDataFile(const Common::String filename, uint32 fileHeader = 0);
100  void readRoomData(const Common::String fileName);
101  InventoryData *readInventory(const Common::String fileName);
102  void readViews(uint16 roomNum);
103  TextFont *getFont(const Common::String fileName);
104  Common::String getText(const Common::String fileName);
105  Common::String getStaticText(byte index) const { return _staticText[index]; }
106 
107 private:
108  LabEngine *_vm;
109  Common::String readString(Common::File *file);
110  Common::Array<int16> readConditions(Common::File *file);
111  void readRule(Common::File *file, RuleList &rules);
112  void readAction(Common::File *file, ActionList &action);
113  void readCloseUps(uint16 depth, Common::File *file, CloseDataList &close);
114  void readView(Common::File *file, ViewDataList &view);
115  void readStaticText();
116  Common::Path translateFileName(const Common::String &filename);
117 
118  Common::String _staticText[48];
119 };
120 
121 } // End of namespace Lab
122 
123 #endif // LAB_RESOURCE_H
Definition: str.h:59
Definition: path.h:52
Definition: processroom.h:175
Definition: anim.h:33
Definition: file.h:47
Definition: lab.h:119
Definition: resource.h:94
Definition: dispman.h:38