OpenTTD

newgrf_debug.h
Go to the documentation of this file.
1 /* $Id: newgrf_debug.h 25946 2013-11-07 18:17:21Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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 <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef NEWGRF_DEBUG_H
13 #define NEWGRF_DEBUG_H
14
15 #include "newgrf.h"
16 #include "core/smallvec_type.hpp"
17 #include "tile_type.h"
18 #include "vehicle_type.h"
19
21 enum NewGrfDebugSpritePickerMode {
22 SPM_NONE,
23 SPM_WAIT_CLICK,
24 SPM_REDRAW,
25 };
26
28 struct NewGrfDebugSpritePicker {
29 NewGrfDebugSpritePickerMode mode;
30 void *clicked_pixel;
31 uint32 click_time;
32 SmallVector<SpriteID, 256> sprites;
33 };
34
35 extern NewGrfDebugSpritePicker _newgrf_debug_sprite_picker;
36
37 bool IsNewGRFInspectable(GrfSpecFeature feature, uint index);
38 void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32 grfid = 0);
39 void InvalidateNewGRFInspectWindow(GrfSpecFeature feature, uint index);
40 void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index);
41
42 GrfSpecFeature GetGrfSpecFeature(TileIndex tile);
43 GrfSpecFeature GetGrfSpecFeature(VehicleType type);
44
45 void ShowSpriteAlignerWindow();
46
47 #endif /* NEWGRF_DEBUG_H */
InvalidateNewGRFInspectWindow
void InvalidateNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Invalidate the inspect window for a given feature and index.
Definition: newgrf_debug_gui.cpp:718
ShowSpriteAlignerWindow
void ShowSpriteAlignerWindow()
Show the window for aligning sprites.
Definition: newgrf_debug_gui.cpp:1096
smallvec_type.hpp
Simple vector class that allows allocating an item without the need to copy this->data needlessly...
NewGrfDebugSpritePickerMode
NewGrfDebugSpritePickerMode
Current state of spritepicker.
Definition: newgrf_debug.h:21
NewGrfDebugSpritePicker::clicked_pixel
void * clicked_pixel
Clicked pixel (pointer to blitter buffer)
Definition: newgrf_debug.h:30
SmallVector< SpriteID, 256 >
GetGrfSpecFeature
GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
Get the GrfSpecFeature associated with the tile.
Definition: newgrf_debug_gui.cpp:768
_newgrf_debug_sprite_picker
NewGrfDebugSpritePicker _newgrf_debug_sprite_picker
The sprite picker.
Definition: newgrf_debug_gui.cpp:50
GrfSpecFeature
GrfSpecFeature
Definition: newgrf.h:67
VehicleType
VehicleType
Available vehicle types.
Definition: vehicle_type.h:21
NewGrfDebugSpritePicker::click_time
uint32 click_time
Realtime tick when clicked to detect next frame.
Definition: newgrf_debug.h:31
IsNewGRFInspectable
bool IsNewGRFInspectable(GrfSpecFeature feature, uint index)
Can we inspect the data given a certain feature and index.
Definition: newgrf_debug_gui.cpp:756
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
ShowNewGRFInspectWindow
void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32 grfid=0)
Show the inspect window for a given feature and index.
Definition: newgrf_debug_gui.cpp:700
vehicle_type.h
Types related to vehicles.
NewGrfDebugSpritePicker
Spritepicker of SpriteAligner.
Definition: newgrf_debug.h:28
tile_type.h
Types related to tiles.
NewGrfDebugSpritePicker::sprites
SmallVector< SpriteID, 256 > sprites
Sprites found.
Definition: newgrf_debug.h:32
DeleteNewGRFInspectWindow
void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Delete inspect window for a given feature and index.
Definition: newgrf_debug_gui.cpp:734
NewGrfDebugSpritePicker::mode
NewGrfDebugSpritePickerMode mode
Current state.
Definition: newgrf_debug.h:29
newgrf.h
Base for the NewGRF implementation.