2016-05-04 19:24:41 +02:00
|
|
|
/*****************************************************************************
|
2019-03-17 08:16:15 +01:00
|
|
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-05-04 19:24:41 +02:00
|
|
|
*****************************************************************************/
|
2014-11-23 17:28:23 +01:00
|
|
|
|
2018-01-03 00:13:37 +01:00
|
|
|
#include <openrct2-ui/interface/Viewport.h>
|
|
|
|
#include <openrct2-ui/interface/Widget.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2-ui/windows/Window.h>
|
|
|
|
#include <openrct2/Context.h>
|
2018-01-06 18:32:25 +01:00
|
|
|
#include <openrct2/localisation/StringIds.h>
|
2018-01-11 10:59:26 +01:00
|
|
|
#include <openrct2/world/Footpath.h>
|
2019-03-09 13:29:33 +01:00
|
|
|
#include <openrct2/world/Sprite.h>
|
2014-11-23 17:28:23 +01:00
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
static void window_editor_main_paint(rct_window* w, rct_drawpixelinfo* dpi);
|
2015-07-10 02:39:16 +02:00
|
|
|
|
|
|
|
static rct_window_event_list window_editor_main_events = {
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
2018-06-22 23:21:44 +02:00
|
|
|
window_editor_main_paint, // 0x0066FC97, // window_editor_main_paint,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr,
|
2014-11-23 17:28:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static rct_widget window_editor_main_widgets[] = {
|
2017-11-19 20:16:36 +01:00
|
|
|
{ WWT_VIEWPORT, 0, 0, -1, 0, -1, STR_VIEWPORT, 0xFFFF },
|
2017-06-06 23:24:18 +02:00
|
|
|
{ WIDGETS_END },
|
2014-11-23 17:28:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2018-06-22 23:21:44 +02:00
|
|
|
* Creates the main editor window that holds the main viewport.
|
|
|
|
* rct2: 0x0066EF38
|
|
|
|
*/
|
|
|
|
rct_window* window_editor_main_open()
|
2014-11-23 17:28:23 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_editor_main_widgets[0].right = context_get_width();
|
|
|
|
window_editor_main_widgets[0].bottom = context_get_height();
|
2018-06-22 23:21:44 +02:00
|
|
|
rct_window* window = window_create(
|
2019-10-19 13:07:03 +02:00
|
|
|
ScreenCoordsXY(0, 0), window_editor_main_widgets[0].right, window_editor_main_widgets[0].bottom,
|
|
|
|
&window_editor_main_events, WC_MAIN_WINDOW, WF_STICK_TO_BACK);
|
2017-06-06 23:24:18 +02:00
|
|
|
window->widgets = window_editor_main_widgets;
|
2014-11-23 17:28:23 +01:00
|
|
|
|
2020-03-01 20:32:35 +01:00
|
|
|
viewport_create(window, window->windowPos, window->width, window->height, 0, { 0x0FFF, 0x0FFF, 0 }, 0x1, SPRITE_INDEX_NULL);
|
2017-06-06 23:24:18 +02:00
|
|
|
window->viewport->flags |= 0x0400;
|
2014-11-23 17:28:23 +01:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
gCurrentRotation = 0;
|
|
|
|
gShowGridLinesRefCount = 0;
|
|
|
|
gShowLandRightsRefCount = 0;
|
|
|
|
gShowConstuctionRightsRefCount = 0;
|
|
|
|
gFootpathSelectedType = 0;
|
2014-11-23 17:28:23 +01:00
|
|
|
|
2017-11-11 02:57:45 +01:00
|
|
|
context_open_window(WC_TOP_TOOLBAR);
|
2017-11-15 02:29:34 +01:00
|
|
|
context_open_window_view(WV_EDITOR_BOTTOM_TOOLBAR);
|
2017-01-23 13:55:59 +01:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return window_get_main();
|
2014-11-23 17:28:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-06-22 23:21:44 +02:00
|
|
|
*
|
|
|
|
* rct2: 0x0066FC97
|
|
|
|
* This function immediately jumps to 0x00685BE1
|
|
|
|
*/
|
|
|
|
static void window_editor_main_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
2015-07-10 02:39:16 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
viewport_render(dpi, w->viewport, dpi->x, dpi->y, dpi->x + dpi->width, dpi->y + dpi->height);
|
2015-12-21 05:03:37 +01:00
|
|
|
}
|