ScummVM API documentation
gui_gizmo.h
1
2/* ScummVM - Graphic Adventure Engine
3 *
4 * ScummVM is the legal property of its developers, whose names
5 * are too numerous to list here. Please refer to the COPYRIGHT
6 * file distributed with this source distribution.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef M4_BURGER_GUI_GIZMO_H
24#define M4_BURGER_GUI_GIZMO_H
25
26#include "common/rect.h"
27#include "m4/m4_types.h"
28#include "m4/gui/gui_vmng_core.h"
29#include "m4/graphics/gr_buff.h"
30#include "m4/burger/gui/inventory.h"
31
32namespace M4 {
33namespace Burger {
34namespace GUI {
35
36#define _GIZMO(X) g_vars->_gizmo._##X
37
38struct Gizmo;
39struct GizmoItem;
40
42 bool _initialized = false;
43 bool _interface_visible = false;
44 Gizmo *_gui = nullptr;
45 RGB8 *_palette = nullptr;
46 bool _lowMemory1 = false;
47 bool _lowMemory2 = false;
48 GizmoItem *_currentItem = nullptr;
49 MemHandle _seriesHandle = nullptr;
50 int32 _celsOffset = 0;
51 int32 _palOffset = 0;
52 char *_assetName = nullptr;
53 int _spriteCount = 0;
54 M4sprite **_sprites = nullptr;
55 bool _roomFlags[15];
56
57 bool _savedFlag = false;
58 int _savedX = 0;
59 int _savedY = 0;
60
63};
64
65struct Gizmo {
66 GrBuff *_grBuff = nullptr;
67 GizmoItem *_items = nullptr;
68 void (*_fnEnter)() = nullptr;
69 void (*_fnEscape)() = nullptr;
70 EventHandler _fnEvents = nullptr;
71};
72
74 ControlStatus _state = NOTHING;
75 int _index = 0;
76 int _field8 = 0;
77 int _fieldC = 0;
78 int _field10 = 0;
79};
80
81typedef void (*GizmoItemFnSelect)();
82typedef void (*GizmoItemFnDraw)(GizmoItem *item, Gizmo *gizmo, int x, int y);
83typedef void (*GizmoItemFnFree)(GizmoItem *item);
84typedef bool (*GizmoItemFnEvents)(GizmoItem *item, int eventType, int event, int x, int y,
85 GizmoItem **currentItem);
86
87struct GizmoItem {
88 GizmoItem *_next = nullptr;
89 GizmoItem *_prior = nullptr;
90 Gizmo *_gizmo = nullptr;
91 GrBuff *_grBuff = nullptr;
92 GizmoButton *_button = nullptr;
93
94 int _id = 0;
95 Common::Rect _bounds;
96 Common::Rect _btnRect;
97 bool _hasBuffer = false;
98 GizmoItemFnSelect _select = nullptr;
99 GizmoItemFnDraw _fnDraw = nullptr;
100 GizmoItemFnFree _fnFree = nullptr;
101 GizmoItemFnEvents _fnEvents = nullptr;
102};
103
104void gizmo_anim(RGB8 *pal);
105void gizmo_initialize(RGB8 *pal);
106void gizmo_shutdown(void *v1 = nullptr, void *v2 = nullptr);
107void gizmo_digi_play(const char *name, int vol, bool &done);
108
109} // namespace GUI
110} // namespace Burger
111} // namespace M4
112
113#endif
Definition: gr_buff.h:30
Definition: database.h:28
Definition: rect.h:536
Definition: gui_gizmo.h:41
Definition: gui_gizmo.h:73
Definition: gui_gizmo.h:65
Definition: gui_gizmo.h:87
Definition: gui.h:31
Definition: m4_types.h:78