ScummVM API documentation
resources.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 ACCESS_RESOURCES_H
23 #define ACCESS_RESOURCES_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/language.h"
28 #include "common/path.h"
29 #include "common/rect.h"
30 #include "common/str-array.h"
31 #include "common/stream.h"
32 
33 namespace Access {
34 
35 extern const byte INITIAL_PALETTE[18 * 3];
36 
37 extern const int INVCOORDS[][4];
38 
39 class AccessEngine;
40 
41 class Resources {
42  struct DATEntry {
43  byte _gameId;
44  byte _discType;
45  byte _demoType;
46  Common::Language _language;
47  uint _fileOffset;
48  };
49  struct DeathEntry {
50  byte _screenId;
51  Common::String _msg;
52  };
53  struct InventoryEntry {
54  Common::String _desc;
55  int _combo[4];
56  };
57 protected:
58  struct RoomEntry {
59  Common::String _desc;
60  Common::Point _travelPos;
61  Common::Array<byte> _data;
62  };
63 
64  AccessEngine *_vm;
65  Common::Array<DATEntry> _datIndex;
66 
70  uint findEntry(byte gameId, byte discType, byte demoType, Common::Language language);
71 
75  virtual void load(Common::SeekableReadStream &s);
76 public:
82  Common::String CANT_GET_THERE;
83 public:
84  Resources(AccessEngine *vm) : _vm(vm) {}
85  virtual ~Resources() {}
86  static Resources *init(AccessEngine *vm);
87 
91  bool load(Common::U32String &errorMessage);
92 
96  virtual const byte *getCursor(int num) const = 0;
97 
102  virtual int getCursorWidth(int num) const { return 16; }
103 
108  virtual int getCursorHeight(int num) const { return 16; }
109 
113  virtual const char *getEgoName() const = 0;
114 
118  virtual int getRMouse(int i, int j) const = 0;
119 
124  virtual int inButtonXRange(int x) const = 0;
125 
131  virtual const char *getGeneralMessage(int command) const;
132 };
133 
134 } // End of namespace Access
135 
136 #endif /* ACCESS_RESOURCES_H */
Definition: resources.h:41
Definition: str.h:59
Definition: access.h:141
virtual int inButtonXRange(int x) const =0
Definition: stream.h:745
virtual const byte * getCursor(int num) const =0
uint findEntry(byte gameId, byte discType, byte demoType, Common::Language language)
Definition: ustr.h:57
virtual const char * getEgoName() const =0
Definition: rect.h:144
virtual int getCursorHeight(int num) const
Definition: resources.h:108
Definition: resources.h:58
virtual void load(Common::SeekableReadStream &s)
virtual int getRMouse(int i, int j) const =0
Definition: access.h:62
virtual int getCursorWidth(int num) const
Definition: resources.h:102
virtual const char * getGeneralMessage(int command) const
Language
Definition: language.h:45