ScummVM API documentation
debugger.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 BLADERUNNER_DEBUGGER_H
23#define BLADERUNNER_DEBUGGER_H
24
25#include "bladerunner/bladerunner.h" // For BLADERUNNER_ORIGINAL_BUGS symbol
26
27#include "bladerunner/vector.h"
28
29#include "gui/debugger.h"
30
31namespace Graphics {
32struct Surface;
33}
34
35namespace BladeRunner {
36
37class BladeRunnerEngine;
38class View;
39
40enum DebuggerDrawnObjectType {
41 debuggerObjTypeUndefined = 99,
42 debuggerObjTypeActor = 0,
43 debuggerObjType3dObject = 1,
44 debuggerObjTypeItem = 2,
45 debuggerObjTypeRegionNormal = 3,
46 debuggerObjTypeRegionExit = 4,
47 debuggerObjTypeWaypointNorm = 5,
48 debuggerObjTypeWaypoingFlee = 6,
49 debuggerObjTypeWaypointCover = 7,
50 debuggerObjTypeWalkbox = 8,
51 debuggerObjTypeEffect = 9,
52 debuggerObjTypeLight = 10,
53 debuggerObjTypeFog = 11
54};
55
56class Debugger : public GUI::Debugger {
58
59 static const uint kMaxSpecificObjectsDrawnCount = 100;
60
61 struct DebuggerDrawnObject {
62 int sceneId;
63 int setId;
64 int objId;
65 DebuggerDrawnObjectType type;
66
67 DebuggerDrawnObject() : sceneId(0), setId(0), objId(0), type(debuggerObjTypeUndefined) {};
68 };
69
70 struct DebuggerPendingOuttake {
71 bool pending;
72 int outtakeId;
73 bool notLocalized;
74 int container;
75 Common::String externalFilename;
76
77 DebuggerPendingOuttake() : pending(false), outtakeId(-1), notLocalized(true), container(-1), externalFilename("") {};
78 };
79
80public:
81 bool _isDebuggerOverlay;
82
83 bool _viewActorsToggle;
84 bool _view3dObjectsToggle;
85 bool _viewItemsToggle;
86 bool _viewFogs;
87 bool _viewLights;
88 bool _viewScreenEffects;
89 bool _viewObstacles;
90 bool _viewRegionsNormalToggle;
91 bool _viewRegionsExitsToggle;
92 bool _viewUI;
93 bool _viewWaypointsNormalToggle;
94 bool _viewWaypointsFleeToggle;
95 bool _viewWaypointsCoverToggle;
96 bool _viewWalkboxes;
97 bool _viewZBuffer;
98 bool _playFullVk;
99 bool _showStatsVk;
100 bool _showMazeScore;
101 bool _showMouseClickInfo;
102 bool _useBetaCrosshairsCursor;
103 bool _useAdditiveDrawModeForMouseCursorMode0;
104 bool _useAdditiveDrawModeForMouseCursorMode1;
105 DebuggerPendingOuttake _dbgPendingOuttake;
106
108 ~Debugger() override;
109
110 bool cmdAnimation(int argc, const char **argv);
111 bool cmdHealth(int argc, const char **argv);
112// bool cmdChapter(int argc, const char **argv);
113 bool cmdDraw(int argc, const char **argv);
114 bool cmdFlag(int argc, const char **argv);
115 bool cmdGoal(int argc, const char **argv);
116 bool cmdLoop(int argc, const char **argv);
117 bool cmdPosition(int argc, const char **argv);
118 bool cmdMusic(int argc, const char** argv);
119 bool cmdSoundFX(int argc, const char** argv);
120 bool cmdSay(int argc, const char **argv);
121 bool cmdScene(int argc, const char **argv);
122 bool cmdVariable(int argc, const char **argv);
123 bool cmdClue(int argc, const char **argv);
124 bool cmdTimer(int argc, const char **argv);
125 bool cmdFriend(int argc, const char **argv);
126 bool cmdLoad(int argc, const char **argv);
127 bool cmdSave(int argc, const char **argv);
128 bool cmdOverlay(int argc, const char **argv);
129 bool cmdSubtitle(int argc, const char **argv);
130 bool cmdMazeScore(int argc, const char **argv);
131 bool cmdObject(int argc, const char **argv);
132 bool cmdItem(int argc, const char **argv);
133 bool cmdRegion(int argc, const char **argv);
134 bool cmdMouse(int argc, const char **argv);
135 bool cmdDifficulty(int argc, const char **argv);
136 bool cmdOuttake(int argc, const char** argv);
137 bool cmdPlayVqa(int argc, const char** argv);
138 bool cmdAmmo(int argc, const char** argv);
139 bool cmdCheatReport(int argc, const char** argv);
140#if BLADERUNNER_ORIGINAL_BUGS
141#else
142 bool cmdEffect(int argc, const char **argv);
143#endif // BLADERUNNER_ORIGINAL_BUGS
144 bool cmdList(int argc, const char **argv);
145 bool cmdVk(int argc, const char **argv);
146
147 Common::String getDifficultyDescription(int difficultyValue);
148 Common::String getAmmoTypeDescription(int ammoType);
149 void drawDebuggerOverlay();
150
151 void drawBBox(Vector3 start, Vector3 end, View *view, Graphics::Surface *surface, int color);
152 void drawSceneObjects();
153 void drawLights();
154 void drawFogs();
155 void drawRegions();
156 void drawWaypoints();
157 void drawWalkboxes();
158 void drawScreenEffects();
159
160 bool dbgAttemptToLoadChapterSetScene(int chapterId, int setId, int sceneId);
161 void resetPendingOuttake();
162
163private:
164 Common::Array<DebuggerDrawnObject> _specificDrawnObjectsList;
165 bool _specificActorsDrawn;
166 bool _specific3dObjectsDrawn;
167 bool _specificItemsDrawn;
168 bool _specificEffectsDrawn;
169 bool _specificLightsDrawn;
170 bool _specificFogsDrawn;
171 bool _specificRegionNormalDrawn;
172 bool _specificRegionExitsDrawn;
173 bool _specificWaypointNormalDrawn;
174 bool _specificWaypointFleeDrawn;
175 bool _specificWaypointCoverDrawn;
176 bool _specificWalkboxesDrawn;
177
178 void toggleObjectInDbgDrawList(DebuggerDrawnObject &drObj);
179 int findInDbgDrawList(DebuggerDrawnObjectType objType, int objId, int setId, int sceneId);
180 void updateTogglesForDbgDrawListInCurrentSetAndScene();
181};
182
183} // End of namespace BladeRunner
184
185#endif
Definition: bladerunner.h:113
Definition: debugger.h:56
Definition: vector.h:47
Definition: view.h:33
Definition: str.h:59
Definition: debugger.h:41
Definition: formatinfo.h:28
Definition: surface.h:67