Refactor widget.c to C++

This commit is contained in:
Ted John 2018-01-05 23:56:37 +00:00 committed by Michael Steenbeek
parent f18595a1c1
commit 83d1b6eb8f
80 changed files with 102 additions and 132 deletions

View File

@ -25,7 +25,7 @@
#include <openrct2/interface/Screenshot.h>
#include <openrct2/interface/Chat.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/interface/window.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/network.h>

View File

@ -28,7 +28,7 @@
#include <openrct2/interface/Chat.h>
#include <openrct2/interface/Console.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/interface/window.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/platform/platform.h>

View File

@ -17,7 +17,7 @@
#include <openrct2-ui/interface/Dropdown.h>
#include <openrct2/world/Map.h>
#include <openrct2-ui/interface/LandTool.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/interface/window.h>
static uint16 toolSizeSpriteIndices[] =

View File

@ -18,7 +18,7 @@
#include <openrct2/Context.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/Game.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/world/scenery.h>
#include <openrct2-ui/interface/Dropdown.h>
#include <openrct2/sprites.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/core/Memory.hpp>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/platform/platform.h>
#include <openrct2/util/Util.h>

View File

@ -21,7 +21,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/util/Util.h>

View File

@ -18,7 +18,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/core/Math.hpp>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/scenery.h>
#include <openrct2-ui/interface/LandTool.h>

View File

@ -18,7 +18,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/util/Util.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -17,7 +17,7 @@
#include <openrct2/Context.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/paint/tile_element/TileElement.h>
#include <openrct2/paint/Paint.h>

View File

@ -15,7 +15,7 @@
#pragma endregion
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/windows/Intent.h>

View File

@ -18,7 +18,7 @@
#include <openrct2/core/Util.hpp>
#include <openrct2/core/Math.hpp>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -27,7 +27,7 @@
#include <openrct2/sprites.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/windows/Intent.h>
#include <openrct2/world/scenery.h>

View File

@ -23,7 +23,7 @@
#include <openrct2/Editor.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/management/Research.h>
#include <openrct2/sprites.h>

View File

@ -18,7 +18,7 @@
#include <openrct2/Context.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/world/footpath.h>

View File

@ -26,7 +26,7 @@
#include <openrct2/Editor.h>
#include <openrct2/EditorObjectSelectionSession.h>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/object/ObjectManager.h>
#include <openrct2/object/ObjectRepository.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/Context.h>
#include <openrct2/core/Util.hpp>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/OpenRCT2.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/Editor.h>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/sprites.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/audio/audio.h>
#include <openrct2/drawing/Font.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
enum {

View File

@ -20,7 +20,7 @@
#include <openrct2/Context.h>
#include <openrct2/Game.h>
#include <openrct2-ui/interface/Graph.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/ride/ride_data.h>

View File

@ -22,7 +22,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/object/ObjectLimits.h>
#include <openrct2/sprites.h>

View File

@ -22,7 +22,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/management/NewsItem.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/management/Marketing.h>
#include <openrct2/network/network.h>

View File

@ -18,7 +18,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -22,7 +22,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/audio/audio.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/platform/platform.h>
#include <openrct2/sprites.h>

View File

@ -18,7 +18,7 @@
#include <openrct2/core/Math.hpp>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2-ui/interface/Dropdown.h>
#include <openrct2-ui/interface/LandTool.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2-ui/interface/LandTool.h>

View File

@ -27,7 +27,7 @@
#include <openrct2/core/Guard.hpp>
#include <openrct2/Editor.h>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/platform/platform.h>
#include <openrct2/util/Util.h>

View File

@ -18,7 +18,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/world/footpath.h>

View File

@ -24,7 +24,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/ride/Track.h>
#include <openrct2/world/Entrance.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/util/Util.h>
#include <openrct2/world/MapGen.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -19,7 +19,7 @@
#include <openrct2/Context.h>
#include <openrct2/Input.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
static rct_widget window_map_tooltip_widgets[] = {

View File

@ -22,7 +22,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/ride/Track.h>
#include <openrct2/sprites.h>

View File

@ -18,7 +18,7 @@
#include <openrct2/network/network.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/util/Util.h>

View File

@ -19,7 +19,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
enum WINDOW_MUSIC_CREDITS_WIDGET_IDX {
WIDX_BACKGROUND,

View File

@ -16,7 +16,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/network.h>
#include <openrct2/util/Util.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/Game.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/ride/Ride.h>
#include <openrct2/ride/ride_data.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -27,7 +27,7 @@
#include <openrct2/Context.h>
#include <openrct2/audio/audio.h>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/management/NewsItem.h>
#include <openrct2/object/ObjectLimits.h>

View File

@ -24,7 +24,7 @@
#include <openrct2/world/sprite.h>
#include <openrct2/peep/Staff.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
enum WINDOW_NEWS_WIDGET_IDX {
WIDX_BACKGROUND,

View File

@ -18,7 +18,7 @@
#include <openrct2/core/Util.hpp>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>

View File

@ -17,7 +17,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/core/Memory.hpp>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/object/ObjectManager.h>
#include <openrct2/platform/platform.h>

View File

@ -38,7 +38,7 @@
#include <openrct2/audio/audio.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Currency.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Language.h>

View File

@ -26,7 +26,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/management/Award.h>
#include <openrct2/util/Util.h>
#include <openrct2/world/Entrance.h>

View File

@ -23,7 +23,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/util/Util.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -18,7 +18,7 @@
#include <openrct2/Game.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/management/NewsItem.h>
#include <openrct2/sprites.h>
#include <openrct2/world/scenery.h>

View File

@ -28,7 +28,7 @@
#include <openrct2/Input.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>

View File

@ -25,7 +25,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/network.h>
#include <openrct2/ride/Ride.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/core/Util.hpp>
#include <openrct2/Game.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/network.h>
#include <openrct2/sprites.h>

View File

@ -24,7 +24,7 @@
#include <openrct2/audio/audio.h>
#include <openrct2/Game.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
WIDX_BACKGROUND,

View File

@ -21,7 +21,7 @@
#include <openrct2/core/Math.hpp>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/network.h>
#include <openrct2/object/ObjectList.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/Context.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/network/http.h>
#include <openrct2/sprites.h>

View File

@ -23,7 +23,7 @@
#include <openrct2/interface/Chat.h>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>

View File

@ -19,7 +19,7 @@
#include <openrct2-ui/input/KeyboardShortcuts.h>
#include <openrct2/interface/window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#define WW 250

View File

@ -18,7 +18,7 @@
#include <openrct2-ui/input/KeyboardShortcuts.h>
#include "Window.h"
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#define WW 420

View File

@ -21,7 +21,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/world/LargeScenery.h>
#include <openrct2/world/scenery.h>
#include <openrct2/world/Wall.h>

View File

@ -22,7 +22,7 @@
#include <openrct2/Game.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/peep/Staff.h>
#include <openrct2/sprites.h>

View File

@ -16,7 +16,7 @@
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Game.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#define WW 200

View File

@ -24,7 +24,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/peep/Staff.h>
#include <openrct2/sprites.h>

View File

@ -28,7 +28,7 @@
#include <openrct2/core/Math.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/core/Util.hpp>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -22,7 +22,7 @@
#include <openrct2/core/Util.hpp>
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/localisation/StringIds.h>
#include <openrct2/ride/ride_data.h>

View File

@ -24,7 +24,7 @@
#include <openrct2/core/Util.hpp>
#include <openrct2/interface/themes.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/scenario/ScenarioRepository.h>
#include <openrct2/scenario/ScenarioSources.h>
#include <openrct2/localisation/Localisation.h>

View File

@ -29,7 +29,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/util/Util.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/sprites.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/Intro.h>
enum WINDOW_TITLE_EXIT_WIDGET_IDX {

View File

@ -18,7 +18,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
static rct_widget window_title_logo_widgets[] = {
{ WIDGETS_END },

View File

@ -22,7 +22,7 @@
#include <openrct2/Editor.h>
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2-ui/interface/Dropdown.h>

View File

@ -20,7 +20,7 @@
#include <openrct2/Intro.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
enum WINDOW_TITLE_OPTIONS_WIDGET_IDX {
WIDX_OPTIONS,

View File

@ -24,7 +24,7 @@
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/interface/themes.h>
#include <openrct2/util/Util.h>

View File

@ -18,7 +18,7 @@
#include <openrct2/core/Math.hpp>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/Input.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
enum {

View File

@ -29,7 +29,7 @@
#include <openrct2/interface/Console.h>
#include <openrct2/interface/Screenshot.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/network/network.h>
#include <openrct2/network/twitch.h>
#include <openrct2/OpenRCT2.h>

View File

@ -19,7 +19,7 @@
#include <openrct2/core/Math.hpp>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>

View File

@ -24,7 +24,7 @@
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/ride/Track.h>
#include <openrct2/ride/TrackData.h>

View File

@ -23,7 +23,7 @@
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/IDrawingEngine.h>
#include <openrct2/Editor.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/OpenRCT2.h>
#include <openrct2/rct1.h>

View File

@ -17,7 +17,7 @@
#include <openrct2/config/Config.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/localisation/Localisation.h>

View File

@ -21,7 +21,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#define INITIAL_WIDTH 500
#define INITIAL_HEIGHT 350

View File

@ -18,7 +18,7 @@
#include <openrct2/core/Math.hpp>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/interface/widget.h>
#include <openrct2/interface/Widget.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2-ui/interface/LandTool.h>

View File

@ -26,7 +26,7 @@
#include "Input.h"
#include "interface/Screenshot.h"
#include "interface/Viewport.h"
#include "interface/widget.h"
#include "interface/Widget.h"
#include "interface/window.h"
#include "localisation/Localisation.h"
#include "management/Finance.h"

View File

@ -14,17 +14,17 @@
*****************************************************************************/
#pragma endregion
#include <algorithm>
#include <cmath>
#include "../drawing/Drawing.h"
#include "../Input.h"
#include "../sprites.h"
#include "widget.h"
#include "window.h"
#include "../platform/platform.h"
#include "../localisation/Localisation.h"
#include "../util/Util.h"
#include "../Context.h"
#include <math.h>
#include "Widget.h"
#include "window.h"
static void widget_frame_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_resize_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
@ -35,7 +35,6 @@ static void widget_text_button(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
static void widget_text_unknown(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_text(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_text_inset(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_text_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_groupbox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex);
@ -72,13 +71,13 @@ void widget_scroll_update_thumbs(rct_window *w, rct_widgetindex widget_index)
x = (x * view_size) / scroll->h_right;
x += 11;
view_size += 10;
scroll->h_thumb_right = min(x, view_size);
scroll->h_thumb_right = std::min(x, view_size);
if(scroll->h_thumb_right - scroll->h_thumb_left < 20) {
double barPosition = (scroll->h_thumb_right * 1.0) / view_size;
scroll->h_thumb_left = (uint16) lround(scroll->h_thumb_left - (20 * barPosition));
scroll->h_thumb_right = (uint16) lround(scroll->h_thumb_right + (20 * (1 - barPosition)));
scroll->h_thumb_left = (uint16)std::lround(scroll->h_thumb_left - (20 * barPosition));
scroll->h_thumb_right = (uint16)std::lround(scroll->h_thumb_right + (20 * (1 - barPosition)));
}
}
@ -99,13 +98,13 @@ void widget_scroll_update_thumbs(rct_window *w, rct_widgetindex widget_index)
y = (y * view_size) / scroll->v_bottom;
y += 11;
view_size += 10;
scroll->v_thumb_bottom = min(y, view_size);
scroll->v_thumb_bottom = std::min(y, view_size);
if(scroll->v_thumb_bottom - scroll->v_thumb_top < 20) {
double barPosition = (scroll->v_thumb_bottom * 1.0) / view_size;
scroll->v_thumb_top = (uint16) lround(scroll->v_thumb_top - (20 * barPosition));
scroll->v_thumb_bottom = (uint16) lround(scroll->v_thumb_bottom + (20 * (1 - barPosition)));
scroll->v_thumb_top = (uint16)std::lround(scroll->v_thumb_top - (20 * barPosition));
scroll->v_thumb_bottom = (uint16)std::lround(scroll->v_thumb_bottom + (20 * (1 - barPosition)));
}
}
@ -269,7 +268,7 @@ static void widget_button_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
// Get the colour
uint8 colour = w->colours[widget->colour];
if (widget->image == -2) {
if ((sint32)widget->image == -2) {
// Draw border with no fill
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press | INSET_RECT_FLAG_FILL_NONE);
return;
@ -290,7 +289,7 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetind
// Get the widget
rct_widget *widget = &w->widgets[widgetIndex];
if (widget->image == -1)
if ((sint32)widget->image == -1)
return;
// Draw widgets that aren't explicitly disabled.
@ -345,7 +344,7 @@ static void widget_flat_button_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_w
// Check if the button is pressed down
if (widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex)) {
if (widget->image == -2) {
if ((sint32)widget->image == -2) {
// Draw border with no fill
gfx_fill_rect_inset(dpi, l, t, r, b, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE);
return;
@ -486,35 +485,6 @@ static void widget_text_inset(rct_drawpixelinfo *dpi, rct_window *w, rct_widgeti
widget_text(dpi, w, widgetIndex);
}
/**
*
* rct2: 0x006EC1A6
*/
static void widget_text_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex)
{
// Get the widget
rct_widget *widget = &w->widgets[widgetIndex];
// Resolve the absolute ltrb
sint32 l = w->x + widget->left + 5;
sint32 t = w->y + widget->top;
sint32 r = w->x + widget->right;
sint32 b = w->y + widget->bottom;
// Get the colour
uint8 colour = w->colours[widget->colour];
sint32 press = 0;
if (widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex))
press |= INSET_RECT_FLAG_BORDER_INSET;
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press);
// TODO
gfx_fill_rect(dpi, l, t, r, b, colour);
}
/**
*
* rct2: 0x006EB535
@ -654,7 +624,7 @@ static void widget_closebox_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
return;
l = w->x + (widget->left + widget->right) / 2 - 1;
t = w->y + max(widget->top, (widget->top + widget->bottom) / 2 - 5);
t = w->y + std::max<sint32>(widget->top, (widget->top + widget->bottom) / 2 - 5);
if (widget_is_disabled(w, widgetIndex))
colour |= COLOUR_FLAG_INSET;
@ -754,10 +724,10 @@ static void widget_scroll_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widget
rct_drawpixelinfo scroll_dpi = *dpi;
// Clip the scroll dpi against the outer dpi
sint32 cl = max(dpi->x, l);
sint32 ct = max(dpi->y, t);
sint32 cr = min(dpi->x + dpi->width, r);
sint32 cb = min(dpi->y + dpi->height, b);
sint32 cl = std::max<sint32>(dpi->x, l);
sint32 ct = std::max<sint32>(dpi->y, t);
sint32 cr = std::min<sint32>(dpi->x + dpi->width, r);
sint32 cb = std::min<sint32>(dpi->y + dpi->height, b);
// Set the respective dpi attributes
scroll_dpi.x = cl - l + scroll->h_left;
@ -790,8 +760,8 @@ static void widget_hscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, s
// Thumb
gfx_fill_rect_inset(dpi,
max(l + 10, l + scroll->h_thumb_left - 1), t,
min(r - 10, l + scroll->h_thumb_right - 1), b,
std::max(l + 10, l + scroll->h_thumb_left - 1), t,
std::min(r - 10, l + scroll->h_thumb_right - 1), b,
colour, ((scroll->flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
// Right button
@ -816,8 +786,8 @@ static void widget_vscrollbar_draw(rct_drawpixelinfo *dpi, rct_scroll *scroll, s
// Thumb
gfx_fill_rect_inset(dpi,
l, max(t + 10, t + scroll->v_thumb_top - 1),
r, min(b - 10, t + scroll->v_thumb_bottom - 1),
l, std::max(t + 10, t + scroll->v_thumb_top - 1),
r, std::min(b - 10, t + scroll->v_thumb_bottom - 1),
colour, ((scroll->flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
// Down button
@ -1109,7 +1079,7 @@ static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
// Make a copy of the string for measuring the width.
char temp_string[TEXT_INPUT_SIZE] = { 0 };
memcpy(temp_string, wrapped_string, min(string_length, gTextInput->SelectionStart));
memcpy(temp_string, wrapped_string, std::min(string_length, gTextInput->SelectionStart));
sint32 cur_x = l + gfx_get_string_width(temp_string) + 3;
sint32 width = 6;
@ -1118,7 +1088,7 @@ static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
// of the character that the cursor is under.
temp_string[1] = '\0';
temp_string[0] = gTextBoxInput[gTextInput->SelectionStart];
width = max(gfx_get_string_width(temp_string) - 2, 4);
width = std::max(gfx_get_string_width(temp_string) - 2, 4);
}
if (gTextBoxFrameNo <= 15){

View File

@ -31,7 +31,7 @@
#include "../world/Map.h"
#include "../world/sprite.h"
#include "Viewport.h"
#include "widget.h"
#include "Widget.h"
#include "window.h"
#define RCT2_FIRST_WINDOW (g_window_list)