ScummVM API documentation
debug_state.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_SCENE_H
23 #define TWINE_DEBUG_SCENE_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 #include "common/scummsys.h"
29 #include "twine/shared.h"
30 #include <cstdarg>
31 
32 namespace TwinE {
33 
34 class TwinEEngine;
35 
36 class DebugState {
37 private:
38  TwinEEngine *_engine;
39 
40  void projectBoundingBoxPoints(IVec3 *point3d, IVec3 *point3dProjected);
41  bool checkZoneType(ZoneType type) const;
42  bool displayZones();
43  bool displayActors();
44  bool displayTracks();
45 
46  struct ScenePositionsProjected {
47  IVec3 frontBottomLeftPoint;
48  IVec3 frontBottomRightPoint;
49 
50  IVec3 frontTopLeftPoint;
51  IVec3 frontTopRightPoint;
52 
53  IVec3 backBottomLeftPoint;
54  IVec3 backBottomRightPoint;
55 
56  IVec3 backTopLeftPoint;
57  IVec3 backTopRightPoint;
58 
59  IVec3 frontBottomLeftPoint2D;
60  IVec3 frontBottomRightPoint2D;
61 
62  IVec3 frontTopLeftPoint2D;
63  IVec3 frontTopRightPoint2D;
64 
65  IVec3 backBottomLeftPoint2D;
66  IVec3 backBottomRightPoint2D;
67 
68  IVec3 backTopLeftPoint2D;
69  IVec3 backTopRightPoint2D;
70  };
71 
72  ScenePositionsProjected calculateBoxPositions(const IVec3 &mins, const IVec3 &maxs);
73  bool drawBox(const ScenePositionsProjected &positions, uint8 color);
74 
76  void changeGridCamera();
77 
78 public:
79  DebugState(TwinEEngine *engine);
80  bool _showingZones = false;
81  bool _showingActors = false;
82  bool _showingTracks = false;
83  bool _showingClips = false;
84  bool _godMode = false;
85  unsigned int _typeZones = 127; // all zones on as default
86  int16 _onlyLoadActor = -1;
87  const char *_openPopup = nullptr;
88  bool _holomapFlagsWindow = false;
89  bool _gameFlagsWindow = false;
90  bool _menuTextWindow = false;
91  bool _sceneDetailsWindow = false;
92  bool _actorDetailsWindow = true;
93  bool _sceneFlagsWindow = false;
94  bool _paletteWindow = false;
95  bool _loggerWindow = false;
96  bool _frameTimeWindow = false;
97  bool _frameDataRecording = true;
98  bool _playFoundItemAnimation = false;
99 
100  bool _useFreeCamera = false;
101  bool _disableGridRendering = false;
102  TextBankId _textBankId = TextBankId::Inventory_Intro_and_Holomap;
103 
104  void renderDebugView();
105  void drawClip(const Common::Rect &rect);
106 
107  struct FrameData {
108  uint32 frameTime;
109  int32 waitMillis;
110  uint32 maxDelay;
111  };
113  FrameDataBuffer _frameData;
114 
115  void addFrameData(uint32 frameTime, int32 waitMillis, uint32 maxDelay);
116 
117  void update();
118 };
119 
120 } // namespace TwinE
121 
122 #endif
Definition: shared.h:122
Definition: rect.h:144
Definition: debug_state.h:36
Definition: twine.h:207
Definition: achievements_tables.h:27
Definition: debug_state.h:107