diff --git a/source.list b/source.list index db128d271b..45c14de4ce 100644 --- a/source.list +++ b/source.list @@ -393,6 +393,7 @@ widget_type.h os/windows/win32.h music/win32_m.h sound/win32_s.h +unit_conversion.h video/win32_v.h window_func.h window_gui.h diff --git a/src/strings.cpp b/src/strings.cpp index d3b04b9afb..77af0a4ab8 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -34,6 +34,7 @@ #include "smallmap_gui.h" #include "window_func.h" #include "debug.h" +#include "unit_conversion.h" #include "game/game_text.hpp" #include "network/network_content_gui.h" #include diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index 5e5e5e902a..f1dce0f2e2 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -36,17 +36,9 @@ #include "cargotype.h" #include "sortlist_type.h" #include "group.h" +#include "unit_conversion.h" #include "table/sprites.h" -extern uint ConvertSpeedToDisplaySpeed(uint speed); -extern uint ConvertDisplaySpeedToSpeed(uint speed); -extern uint ConvertWeightToDisplayWeight(uint weight); -extern uint ConvertDisplayWeightToWeight(uint weight); -extern uint ConvertPowerToDisplayPower(uint power); -extern uint ConvertDisplayPowerToPower(uint power); -extern uint ConvertForceToDisplayForce(uint force); -extern uint ConvertDisplayForceToForce(uint force); - /** Widget IDs */ enum TraceRestrictWindowWidgets { TR_WIDGET_CAPTION, diff --git a/src/unit_conversion.h b/src/unit_conversion.h new file mode 100644 index 0000000000..9dadc35872 --- /dev/null +++ b/src/unit_conversion.h @@ -0,0 +1,19 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * 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. + * 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. + * 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 . + */ + +/** @file unit_conversion.h Functions related to unit conversion. */ + +uint ConvertSpeedToDisplaySpeed(uint speed); +uint ConvertDisplaySpeedToSpeed(uint speed); +uint ConvertWeightToDisplayWeight(uint weight); +uint ConvertDisplayWeightToWeight(uint weight); +uint ConvertPowerToDisplayPower(uint power); +uint ConvertDisplayPowerToPower(uint power); +uint ConvertForceToDisplayForce(uint force); +uint ConvertDisplayForceToForce(uint force);