ScummVM API documentation
globals.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 MM1_GLOBALS_H
23 #define MM1_GLOBALS_H
24 
25 #include "common/serializer.h"
26 #include "graphics/font.h"
27 #include "mm/shared/utils/strings_data.h"
28 #include "mm/shared/utils/xeen_font.h"
29 #include "mm/xeen/sprites.h"
30 #include "mm/mm1/data/game_state.h"
31 #include "mm/mm1/data/items.h"
32 #include "mm/mm1/data/monsters.h"
33 #include "mm/mm1/data/roster.h"
34 #include "mm/mm1/data/treasure.h"
35 #include "mm/mm1/gfx/bitmap_font.h"
36 #include "mm/mm1/gfx/symbols.h"
37 #include "mm/mm1/game/combat.h"
38 #include "mm/mm1/game/encounter.h"
39 #include "mm/mm1/maps/maps.h"
40 
41 namespace MM {
42 namespace MM1 {
43 
44 class Globals : public GameState {
45 public:
46  StringsData _strings;
47  Roster _roster;
48  Common::Array<Character *> _combatParty;
49  Character *_currCharacter = nullptr;
50  Item _currItem;
51  ItemsArray _items;
52  Maps::TownId _startingTown = Maps::SORPIGAL;
53  Maps::Maps _maps;
54  Gfx::BitmapFont _font;
55  bool _heardRumor = false;
56  Game::Encounter _encounters;
57  Game::Combat *_combat = nullptr;
58  Monsters *_monsters = nullptr;
59  Treasure _treasure;
60  byte _delay = 5;
61  int _nonCombatEffectCtr = 0, _combatEffectCtr = 0;
62  bool _minimapOn = false;
63 
64  // Console flags
65  bool _intangible = false;
66  bool _encountersOn = true;
67  bool _allSpells = false;
68 
72  void createBlankButton();
73 
74 public:
75  // Enhanced mode globals
77  Shared::Xeen::SpriteResource _confirmIcons;
78  Shared::Xeen::SpriteResource _globalSprites;
79  Shared::Xeen::SpriteResource _tileSprites;
80  Shared::Xeen::SpriteResource _escSprites;
81  Graphics::ManagedSurface _blankButton;
82  Graphics::ManagedSurface _gameBackground;
83  Gfx::Symbols _symbols;
84  XeenFont _fontNormal;
85  XeenFont _fontReduced;
86 public:
87  Globals();
88  virtual ~Globals();
89 
93  bool load(bool isEnhanced);
94 
98  Common::String operator[](const Common::String &name) const;
99 
104 };
105 
106 extern Globals *g_globals;
107 
108 #define STRING (*g_globals)
109 
110 } // namespace MM1
111 } // namespace MM
112 
113 #endif
Definition: managed_surface.h:51
Common::String operator[](const Common::String &name) const
Definition: str.h:59
void synchronize(Common::Serializer &s)
Definition: symbols.h:35
Definition: array.h:52
bool load(bool isEnhanced)
Definition: sprites.h:52
Definition: serializer.h:79
Definition: game_state.h:40
Definition: monsters.h:111
Definition: encounter.h:40
Definition: globals.h:44
Definition: maps.h:56
Definition: items.h:107
Definition: detection.h:27
Definition: items.h:98
Definition: character.h:432
Definition: treasure.h:38
Definition: roster.h:35
Definition: combat.h:36
void createBlankButton()
Definition: xeen_font.h:35
Definition: strings_data.h:30
Definition: bitmap_font.h:32