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