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 "ultima/shared/std/containers.h"
26 #include "ultima/shared/std/string.h"
27 #include "ultima/ultima8/gfx/frame_id.h"
28 
29 namespace Ultima {
30 namespace Ultima8 {
31 
32 class RawArchive;
33 class MainShapeArchive;
34 class FontShapeArchive;
35 class GumpShapeArchive;
36 class ShapeArchive;
37 class Usecode;
38 class MapGlob;
39 class Shape;
40 class MusicFlex;
41 class WpnOvlayDat;
42 class NPCDat;
43 class CombatDat;
44 class FireType;
45 class ShapeFrame;
46 class WeaselDat;
47 class SoundFlex;
48 class SpeechFlex;
49 struct GameInfo;
50 
51 class GameData {
52 public:
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  Std::string translate(const Std::string &text);
108  FrameID translate(FrameID frame);
109 
110  enum ShapeFlexId {
111  OTHER = 0,
112  MAINSHAPES = 1,
113  GUMPS = 2
114  };
115 private:
116  void loadTranslation();
117  void setupTTFOverrides(const char *category, bool SJIS);
118  void setupJPOverrides();
119 
120  RawArchive *_fixed;
121  MainShapeArchive *_mainShapes;
122  Usecode *_mainUsecode;
123  Std::vector<MapGlob *> _globs;
124  FontShapeArchive *_fonts;
125  GumpShapeArchive *_gumps;
126  Shape *_mouse;
127  MusicFlex *_music;
128  WpnOvlayDat *_weaponOverlay;
129  Std::vector<NPCDat *> _npcTable;
130  Std::vector<CombatDat *> _combatData;
131  Std::vector<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: shape_archive.h:34
Definition: shape_frame.h:33
Definition: music_flex.h:31
Definition: raw_archive.h:33
Definition: main_shape_archive.h:36
Definition: game_data.h:51
Definition: wpn_ovlay_dat.h:34
Definition: detection.h:27
Definition: speech_flex.h:31
Definition: map_glob.h:38
Definition: string.h:30
Definition: usecode.h:32
Definition: fire_type.h:34
Definition: gump_shape_archive.h:33
Definition: frame_id.h:30
Definition: npc_dat.h:31
Definition: font_shape_archive.h:32
Definition: shape.h:38
Definition: sound_flex.h:42
Definition: containers.h:38
GameInfo contains detailed information about the game.
Definition: game_info.h:33
Definition: combat_dat.h:41
Definition: weasel_dat.h:34