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/game/combat.h"
37 #include "mm/mm1/game/encounter.h"
38 #include "mm/mm1/maps/maps.h"
39 
40 namespace MM {
41 namespace MM1 {
42 
43 class Globals : public GameState {
44 public:
45  StringsData _strings;
46  Roster _roster;
47  Common::Array<Character *> _combatParty;
48  Character *_currCharacter = nullptr;
49  Item _currItem;
50  ItemsArray _items;
51  Maps::TownId _startingTown = Maps::SORPIGAL;
52  Maps::Maps _maps;
53  Gfx::BitmapFont _font;
54  bool _heardRumor = false;
55  Game::Encounter _encounters;
56  Game::Combat *_combat = nullptr;
57  Monsters *_monsters = nullptr;
58  Treasure _treasure;
59  byte _delay = 5;
60  int _nonCombatEffectCtr = 0, _combatEffectCtr = 0;
61  bool _minimapOn = false;
62 
63  // Console flags
64  bool _intangible = false;
65  bool _encountersOn = true;
66  bool _allSpells = false;
67 
71  void createBlankButton();
72 
73 public:
74  // Enhanced mode globals
76  Shared::Xeen::SpriteResource _confirmIcons;
77  Shared::Xeen::SpriteResource _globalSprites;
78  Shared::Xeen::SpriteResource _tileSprites;
79  Shared::Xeen::SpriteResource _escSprites;
80  Graphics::ManagedSurface _blankButton;
81  Graphics::ManagedSurface _gameBackground;
82  byte SYMBOLS[20][64];
83  XeenFont _fontNormal;
84  XeenFont _fontReduced;
85 public:
86  Globals();
87  virtual ~Globals();
88 
92  bool load(bool isEnhanced);
93 
97  Common::String operator[](const Common::String &name) const;
98 
103 };
104 
105 extern Globals *g_globals;
106 
107 #define STRING (*g_globals)
108 
109 } // namespace MM1
110 } // namespace MM
111 
112 #endif
Definition: managed_surface.h:51
Common::String operator[](const Common::String &name) const
Definition: str.h:59
void synchronize(Common::Serializer &s)
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:43
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