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