ScummVM API documentation
debug.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 TWINE_DEBUG_H
23 #define TWINE_DEBUG_H
24 
25 #include "common/scummsys.h"
26 #include "common/rect.h"
27 
28 namespace TwinE {
29 
30 enum ButtonType {
31  NO_ACTION,
32  FREE_CAMERA,
33  CHANGE_SCENE,
34  SHOW_CELLING_GRID,
35  SHOW_ZONES,
36  SHOW_ZONE_CUBE,
37  SHOW_ZONE_CAMERA,
38  SHOW_ZONE_SCENARIC,
39  SHOW_ZONE_CELLINGGRID,
40  SHOW_ZONE_OBJECT,
41  SHOW_ZONE_TEXT,
42  SHOW_ZONE_LADDER
43 };
44 
45 enum WindowType {
46  NO_MENU,
47  FREE_CAMERA_INFO_MENU,
48  CHANGE_SCENE_INFO_MENU,
49  ZONES_MENU
50 };
51 
53  Common::Rect rect { 0, 0, 0, 0 };
54  const char *text = "";
55  int32 textLeft = 0;
56  int32 textTop = 0;
57  int32 isActive = 0;
58  int32 color = 0;
59  int32 activeColor = 0;
60  int32 submenu = 0;
61  int32 type = 0;
62 };
63 
65  Common::Rect rect { 0, 0, 0, 0 };
66  int32 alpha = 0;
67  int32 isActive = 0;
68  int32 numLines = 0;
69  const char *text[20] {0};
70  int32 numButtons = 0;
71  DebugButtonStruct debugButtons[50];
72 };
73 
74 class TwinEEngine;
75 
76 class Debug {
77 private:
78  TwinEEngine *_engine;
79 
80  DebugWindowStruct _debugWindows[10];
81  int32 _numDebugWindows = 0;
82  void debugFillButton(int32 x, int32 y, int32 width, int32 height, int8 color);
83  void debugDrawButton(const Common::Rect &rect, const char *text, int32 textLeft, int32 textTop, int32 isActive, int8 color);
84  void debugDrawWindowButtons(int32 w);
85  void debugDrawWindow(int32 w);
86  int32 debugTypeUseMenu(int32 type);
87  void debugResetButtonsState();
88  void debugRefreshButtons(int32 type);
89  void debugDrawWindows();
90  void debugResetButton(int32 type);
91  void debugRedrawScreen();
92  int32 debugGetActionsState(int32 type);
93  void debugSetActions(int32 type);
94  void debugAddButton(int32 window, const Common::Rect &rect, const char *text, int32 textLeft, int32 textTop, int32 isActive, int32 color, int32 activeColor, int32 submenu, int32 type);
95  void debugAddWindowText(int32 window, const char *text);
96  void debugAddWindow(const Common::Rect &rect, int32 alpha, int32 isActive);
97  void debugLeftMenu();
98  int32 debugProcessButton(int32 x, int32 y);
99  void debugPlasmaWindow(const char *text, int32 color);
100  void debugProcessWindow();
101 
102 public:
103  Debug(TwinEEngine *engine) : _engine(engine) {}
104  void processDebug();
105 };
106 
107 } // namespace TwinE
108 
109 #endif
Definition: debug.h:52
Definition: rect.h:144
Definition: debug.h:76
Definition: twine.h:200
Definition: achievements_tables.h:27
Definition: debug.h:64