diff options
author | rubidium <rubidium@openttd.org> | 2011-01-22 09:53:15 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-01-22 09:53:15 +0000 |
commit | eb299736c1bcb277da1862afe95c11cb897effcf (patch) | |
tree | 3bb6bff78f066da770a367e078c569dbe8ce319a /src/newgrf_debug_gui.cpp | |
parent | 0cdb1c78cdbfce4d426441c21ef7066f1cfecf6f (diff) | |
download | openttd-eb299736c1bcb277da1862afe95c11cb897effcf.tar.xz |
(svn r21886) -Codechange: move documentation towards the code to make it more likely to be updated [n].
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r-- | src/newgrf_debug_gui.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 8504094ad..f4c3b985a 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -487,6 +487,14 @@ static const WindowDesc _newgrf_inspect_desc( _nested_newgrf_inspect_widgets, lengthof(_nested_newgrf_inspect_widgets) ); +/** + * Show the inspect window for a given feature and index. + * The index is normally an in-game location/identifier, such + * as a TileIndex or an IndustryID depending on the feature + * we want to inspect. + * @param feature The feature we want to inspect. + * @param index The index/identifier of the feature to inspect. + */ void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index) { if (!IsNewGRFInspectable(feature, index)) return; @@ -495,6 +503,14 @@ void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index) AllocateWindowDescFront<NewGRFInspectWindow>(&_newgrf_inspect_desc, wno); } +/** + * Delete inspect window for a given feature and index. + * The index is normally an in-game location/identifier, such + * as a TileIndex or an IndustryID depending on the feature + * we want to inspect. + * @param feature The feature we want to delete the window for. + * @param index The index/identifier of the feature to delete. + */ void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index) { if (feature == GSF_INVALID) return; @@ -507,6 +523,15 @@ void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index) if (w != NULL) w->ReInit(); } +/** + * Can we inspect the data given a certain feature and index. + * The index is normally an in-game location/identifier, such + * as a TileIndex or an IndustryID depending on the feature + * we want to inspect. + * @param feature The feature we want to inspect. + * @param index The index/identifier of the feature to inspect. + * @return true if there is something to show. + */ bool IsNewGRFInspectable(GrfSpecFeature feature, uint index) { const NIFeature *nif = GetFeature(GetInspectWindowNumber(feature, index)); @@ -514,6 +539,11 @@ bool IsNewGRFInspectable(GrfSpecFeature feature, uint index) return nif->helper->IsInspectable(index); } +/** + * Get the GrfSpecFeature associated with the tile. + * @param tile The tile to get the feature from. + * @return the GrfSpecFeature. + */ GrfSpecFeature GetGrfSpecFeature(TileIndex tile) { switch (GetTileType(tile)) { @@ -533,6 +563,11 @@ GrfSpecFeature GetGrfSpecFeature(TileIndex tile) } } +/** + * Get the GrfSpecFeature associated with the vehicle. + * @param type The vehicle type to get the feature from. + * @return the GrfSpecFeature. + */ GrfSpecFeature GetGrfSpecFeature(VehicleType type) { switch (type) { @@ -813,6 +848,9 @@ static const WindowDesc _sprite_aligner_desc( _nested_sprite_aligner_widgets, lengthof(_nested_sprite_aligner_widgets) ); +/** + * Show the window for aligning sprites. + */ void ShowSpriteAlignerWindow() { AllocateWindowDescFront<SpriteAlignerWindow>(&_sprite_aligner_desc, 0); |