ScummVM API documentation
game_data.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 ULTIMA8_GAMES_GAMEDATA_H
23#define ULTIMA8_GAMES_GAMEDATA_H
24
25#include "common/array.h"
26#include "common/str.h"
27#include "ultima/ultima8/gfx/frame_id.h"
28
29namespace Ultima {
30namespace Ultima8 {
31
32class RawArchive;
33class MainShapeArchive;
34class FontShapeArchive;
35class GumpShapeArchive;
36class ShapeArchive;
37class Usecode;
38class MapGlob;
39class Shape;
40class MusicFlex;
41class WpnOvlayDat;
42class NPCDat;
43class CombatDat;
44class FireType;
45class ShapeFrame;
46class WeaselDat;
47class SoundFlex;
48class SpeechFlex;
49struct GameInfo;
50
51class GameData {
52public:
53 GameData(GameInfo *gameinfo);
54 ~GameData();
55
56 static GameData *get_instance() {
57 return _gameData;
58 }
59
60 void loadU8Data();
61 void loadRemorseData();
62 void setupFontOverrides();
63
64 Usecode *getMainUsecode() const {
65 return _mainUsecode;
66 }
67 MainShapeArchive *getMainShapes() const {
68 return _mainShapes;
69 }
70 RawArchive *getFixed() const {
71 return _fixed;
72 }
73 MapGlob *getGlob(uint32 glob) const;
74 FontShapeArchive *getFonts() const {
75 return _fonts;
76 }
77 GumpShapeArchive *getGumps() const {
78 return _gumps;
79 }
80 Shape *getMouse() const {
81 return _mouse;
82 }
83 MusicFlex *getMusic() const {
84 return _music;
85 }
86 WpnOvlayDat *getWeaponOverlay() const {
87 return _weaponOverlay;
88 }
89 SoundFlex *getSoundFlex() const {
90 return _soundFlex;
91 }
92 SpeechFlex *getSpeechFlex(uint32 shapenum);
93
94 ShapeArchive *getShapeFlex(uint16 flexId) const;
95 Shape *getShape(FrameID frameid) const;
96 const ShapeFrame *getFrame(FrameID frameid) const;
97
98 const NPCDat *getNPCData(uint16 entry) const;
99 const NPCDat *getNPCDataForShape(uint16 shapeno) const;
100
101 const CombatDat *getCombatDat(uint16 entry) const;
102
103 const FireType *getFireType(uint16 type) const;
104
105 const WeaselDat *getWeaselDat(uint16 level) const;
106
107 Common::String translate(const Common::String &text);
108 FrameID translate(FrameID frame);
109
110 enum ShapeFlexId {
111 OTHER = 0,
112 MAINSHAPES = 1,
113 GUMPS = 2
114 };
115private:
116 void loadTranslation();
117 void setupTTFOverrides(const char *category, bool SJIS);
118 void setupJPOverrides();
119
120 RawArchive *_fixed;
121 MainShapeArchive *_mainShapes;
122 Usecode *_mainUsecode;
124 FontShapeArchive *_fonts;
125 GumpShapeArchive *_gumps;
126 Shape *_mouse;
127 MusicFlex *_music;
128 WpnOvlayDat *_weaponOverlay;
129 Common::Array<NPCDat *> _npcTable;
130 Common::Array<CombatDat *> _combatData;
131 Common::Array<WeaselDat *> _weaselData;
132
133 SoundFlex *_soundFlex;
135 GameInfo *_gameInfo;
136
137 static GameData *_gameData;
138};
139
140#define _TL_(x) (GameData::get_instance()->translate(x))
141#define _TL_SHP_(x) (GameData::get_instance()->translate(x))
142
143} // End of namespace Ultima8
144} // End of namespace Ultima
145
146#endif
Definition: array.h:52
Definition: str.h:59
Definition: combat_dat.h:41
Definition: fire_type.h:34
Definition: font_shape_archive.h:32
Definition: game_data.h:51
Definition: gump_shape_archive.h:31
Definition: main_shape_archive.h:36
Definition: map_glob.h:42
Definition: music_flex.h:31
Definition: npc_dat.h:31
Definition: raw_archive.h:33
Definition: shape_archive.h:34
Definition: shape_frame.h:33
Definition: shape.h:36
Definition: sound_flex.h:43
Definition: speech_flex.h:30
Definition: usecode.h:34
Definition: weasel_dat.h:34
Definition: wpn_ovlay_dat.h:34
Definition: frame_id.h:30
GameInfo contains detailed information about the game.
Definition: game_info.h:38