ScummVM API documentation
vars.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 M4_BURGER_VARS_H
23 #define M4_BURGER_VARS_H
24 
25 #include "common/textconsole.h"
26 #include "m4/vars.h"
27 #include "m4/burger/core/release_trigger.h"
28 #include "m4/burger/core/stream_break.h"
29 #include "m4/burger/gui/gui.h"
30 #include "m4/burger/gui/gui_gizmo.h"
31 #include "m4/burger/gui/game_menu.h"
32 #include "m4/burger/flags.h"
33 #include "m4/burger/hotkeys.h"
34 #include "m4/burger/inventory.h"
35 #include "m4/burger/series_player.h"
36 #include "m4/burger/walker.h"
37 
38 namespace M4 {
39 namespace Burger {
40 
41 enum GameMode {
42  JUST_OVERVIEW = 0, INTERACTIVE_DEMO = 1, MAGAZINE_DEMO = 2, WHOLE_GAME = 3
43 };
44 
45 enum global_triggers {
46  kFIRST_GLOBAL_TRIGGER = 10000,
47 
48  // System triggers
49  kRESUME_CONVERSATION = 10001, // Yep, that's what it does!
50  kSERIES_STREAM_BREAK = 10002, // Used only by set_next_stream_break () in global.cpp
51  kSERIES_PLAY_BREAK_0 = 10003,
52  kSERIES_PLAY_BREAK_1 = 10004,
53  kSERIES_PLAY_BREAK_2 = 10005,
54  kRELEASE_TRIGGER_DIGI_CHECK = 10006, // Used only by release_trigger_digi_check() in global.cpp
55  kAdvanceTime = 10007,
56 
57  kNPC_SPEECH_STARTED = 10010, // NPC talk started
58  kNPC_SPEECH_FINISHED = 10011, // NPC talk finished
59  kWILBUR_SPEECH_STARTED = 10013,
60  kWILBURS_SPEECH_FINISHED = 10014,
61  kWILBURS_SPEECH_START = 10015,
62  kCHANGE_WILBUR_ANIMATION = 10016,
63  kAdvanceHour = 10017,
64  kSET_FACING = 10018,
65  kPOOF = 10019,
66  kSET_COMMANDS_ALLOWED = 10020,
67  kUNPOOF = 10021,
68  kAbduction = 10022,
69  kTestTimeout = 10023,
70  kTELEPORTED1 = 10024,
71  kTELEPORTED2 = 10025,
72  k10027 = 10027,
73  kBurlEntersTown = 10028,
74  kBurlGetsFed = 10029,
75  kBurlStopsEating = 10030,
76  kBurlLeavesTown = 10031,
77  kBandEntersTown = 10032,
78 
79  kCALLED_EACH_LOOP = 32764,
80 
81  kLAST_GLOBAL_TRIGGER
82 };
83 
84 class Vars : public M4::Vars {
85 private:
86  static void custom_ascii_converter_proc(char *string);
87 
88 protected:
89  void main_cold_data_init() override;
90 
91 public:
92  // These are defined as statics because they're referenced in data arrays
93  static int32 _wilbur_should;
94 public:
95  Burger::Flags _flags;
96  GameMode _executing = WHOLE_GAME;
97  GUI::GUI_Globals _gui;
98  GUI::Gizmo_Globals _gizmo;
99  GUI::Interface _interface;
100  Burger::Hotkeys _hotkeys;
101  GUI::MenuGlobals _menu;
102  SeriesPlayers _seriesPlayers;
103  ReleaseTrigger_Globals _releaseTrigger;
104  StreamBreak_Globals _streamBreak;
105  Burger::Walker _walker;
106 
107  int _wilburTerm = 2;
108  bool _menuSystemInitialized = false;
109  bool _gameMenuFromMain = false;
110  int _room902Flag = 0;
111  int _roomVal3 = 0;
112  int _flumix_should = 0;
113  int _roomVal7 = 3;
114  machine *_npcSpeech1 = nullptr;
115  machine *_npcSpeech2 = nullptr;
116  int _npcTrigger = -1;
117  int _player_facing_x = 0, _player_facing_y = 0;
118  int _player_dest_x = 0, _player_dest_y = 0;
119  int _player_trigger = 0;
120 
121 public:
122  Vars();
123  virtual ~Vars();
124 
125  M4::Interface *getInterface() override {
126  return &_interface;
127  }
128  Hotkeys *getHotkeys() override {
129  return &_hotkeys;
130  }
131  M4::Walker *getWalker() override {
132  return &_walker;
133  }
134  void initialize_game() override;
135 
136  void global_menu_system_init() override;
137 };
138 
139 extern Vars *g_vars;
140 
141 #undef _G
142 #undef _GI
143 #define _G(X) (::M4::Burger::g_vars->_##X)
144 #define _GI(X) _G(interface)._##X
145 #define _GINT() _G(interface)
146 
147 } // namespace Burger
148 } // namespace M4
149 
150 #endif
Definition: hotkeys.h:33
Definition: vars.h:84
Definition: ws_machine.h:153
Definition: gui.h:33
Definition: flags.h:554
Definition: game_menu.h:464
Definition: adv_walk.h:32
Definition: vars.h:69
Definition: adv_interface.h:32
Definition: walker.h:46
Definition: database.h:28
Definition: interface.h:36
Definition: series_player.h:65
Definition: gui_gizmo.h:41
Definition: release_trigger.h:31
Definition: stream_break.h:48