OpenTTD Source: src/newgrf_debug.h Source File

OpenTTD Source 15.3

newgrf_debug.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef NEWGRF_DEBUG_H
11#define NEWGRF_DEBUG_H
12
13#include "core/flatset_type.hpp"
14#include "newgrf.h"
15#include "tile_type.h"
16#include "vehicle_type.h"
17
19 enum NewGrfDebugSpritePickerMode : uint8_t {
20 SPM_NONE,
21 SPM_WAIT_CLICK,
22 SPM_REDRAW,
23};
24
26 struct NewGrfDebugSpritePicker {
27 NewGrfDebugSpritePickerMode mode;
28 void *clicked_pixel;
29 FlatSet<SpriteID> sprites;
30};
31
32extern NewGrfDebugSpritePicker _newgrf_debug_sprite_picker;
33
34bool IsNewGRFInspectable(GrfSpecFeature feature, uint index);
35void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32_t grfid = 0);
36void InvalidateNewGRFInspectWindow(GrfSpecFeature feature, uint index);
37void InvalidateNewGRFInspectWindow(GrfSpecFeature feature, ConvertibleThroughBase auto index) { InvalidateNewGRFInspectWindow(feature, index.base()); }
38void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index);
39void DeleteNewGRFInspectWindow(GrfSpecFeature feature, ConvertibleThroughBase auto index) { DeleteNewGRFInspectWindow(feature, index.base()); }
40
41 GrfSpecFeature GetGrfSpecFeature(TileIndex tile);
42 GrfSpecFeature GetGrfSpecFeature(VehicleType type);
43
44void ShowSpriteAlignerWindow();
45
46#endif /* NEWGRF_DEBUG_H */
FlatSet
Flat set implementation that uses a sorted vector for storage.
Definition flatset_type.hpp:20
ConvertibleThroughBase
A type is considered 'convertible through base()' when it has a 'base()' function that returns someth...
Definition convertible_through_base.hpp:19
flatset_type.hpp
Flat set container implementation.
newgrf.h
Base for the NewGRF implementation.
GrfSpecFeature
GrfSpecFeature
Definition newgrf.h:68
ShowNewGRFInspectWindow
void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32_t grfid=0)
Show the inspect window for a given feature and index.
Definition newgrf_debug_gui.cpp:692
ShowSpriteAlignerWindow
void ShowSpriteAlignerWindow()
Show the window for aligning sprites.
Definition newgrf_debug_gui.cpp:1202
GetGrfSpecFeature
GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
Get the GrfSpecFeature associated with the tile.
Definition newgrf_debug_gui.cpp:760
InvalidateNewGRFInspectWindow
void InvalidateNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Invalidate the inspect window for a given feature and index.
Definition newgrf_debug_gui.cpp:710
IsNewGRFInspectable
bool IsNewGRFInspectable(GrfSpecFeature feature, uint index)
Can we inspect the data given a certain feature and index.
Definition newgrf_debug_gui.cpp:748
NewGrfDebugSpritePickerMode
NewGrfDebugSpritePickerMode
Current state of spritepicker.
Definition newgrf_debug.h:19
DeleteNewGRFInspectWindow
void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Delete inspect window for a given feature and index.
Definition newgrf_debug_gui.cpp:726
_newgrf_debug_sprite_picker
NewGrfDebugSpritePicker _newgrf_debug_sprite_picker
The sprite picker.
Definition newgrf_debug_gui.cpp:53
NewGrfDebugSpritePicker
Spritepicker of SpriteAligner.
Definition newgrf_debug.h:26
NewGrfDebugSpritePicker::mode
NewGrfDebugSpritePickerMode mode
Current state.
Definition newgrf_debug.h:27
NewGrfDebugSpritePicker::clicked_pixel
void * clicked_pixel
Clicked pixel (pointer to blitter buffer)
Definition newgrf_debug.h:28
NewGrfDebugSpritePicker::sprites
FlatSet< SpriteID > sprites
Sprites found.
Definition newgrf_debug.h:29
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
tile_type.h
Types related to tiles.
vehicle_type.h
Types related to vehicles.
VehicleType
VehicleType
Available vehicle types.
Definition vehicle_type.h:22