2017-06-01 21:55:10 +02:00
|
|
|
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
2014-04-03 04:08:06 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
2016-05-04 19:24:41 +02:00
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
2014-04-03 04:08:06 +02:00
|
|
|
*
|
|
|
|
* OpenRCT2 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, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
2014-04-03 04:08:06 +02:00
|
|
|
*****************************************************************************/
|
2016-05-04 19:24:41 +02:00
|
|
|
#pragma endregion
|
2014-04-03 04:08:06 +02:00
|
|
|
|
2017-08-12 23:06:12 +02:00
|
|
|
#include <openrct2/Context.h>
|
|
|
|
#include <openrct2-ui/windows/Window.h>
|
2017-08-02 00:20:32 +02:00
|
|
|
|
2017-09-18 17:05:28 +02:00
|
|
|
#include <openrct2/interface/viewport.h>
|
|
|
|
#include <openrct2/interface/widget.h>
|
2017-11-19 20:16:36 +01:00
|
|
|
#include <openrct2/localisation/string_ids.h>
|
2017-09-18 17:05:28 +02:00
|
|
|
#include <openrct2/world/footpath.h>
|
2014-04-03 04:08:06 +02:00
|
|
|
|
2017-10-09 17:13:14 +02:00
|
|
|
static rct_widget window_main_widgets[] = {
|
2017-11-19 20:16:36 +01:00
|
|
|
{ WWT_VIEWPORT, 0, 0x0000, -1, 0x0000, -1, STR_VIEWPORT, 0xFFFF },
|
2017-06-06 23:24:18 +02:00
|
|
|
{ WIDGETS_END },
|
2014-04-03 04:08:06 +02:00
|
|
|
};
|
|
|
|
|
2015-07-10 02:39:16 +02:00
|
|
|
void window_main_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
2014-07-15 15:59:43 +02:00
|
|
|
|
2015-07-10 02:39:16 +02:00
|
|
|
static rct_window_event_list window_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,
|
2017-06-06 23:24:18 +02:00
|
|
|
window_main_paint,
|
2017-08-15 10:07:44 +02:00
|
|
|
nullptr
|
2014-07-15 18:40:05 +02:00
|
|
|
};
|
2014-07-15 15:59:43 +02:00
|
|
|
|
2014-04-03 04:08:06 +02:00
|
|
|
/**
|
2014-07-15 15:59:43 +02:00
|
|
|
* Creates the main window that holds the main viewport.
|
2014-04-03 04:08:06 +02:00
|
|
|
* rct2: 0x0066B3E8
|
|
|
|
*/
|
2017-08-12 23:06:12 +02:00
|
|
|
rct_window * window_main_open()
|
2014-04-03 04:08:06 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
window_main_widgets[0].right = context_get_width();
|
|
|
|
window_main_widgets[0].bottom = context_get_height();
|
|
|
|
rct_window * window = window_create(
|
|
|
|
0, 0,
|
|
|
|
window_main_widgets[0].right, window_main_widgets[0].bottom,
|
|
|
|
&window_main_events,
|
|
|
|
WC_MAIN_WINDOW,
|
|
|
|
WF_STICK_TO_BACK
|
|
|
|
);
|
|
|
|
window->widgets = window_main_widgets;
|
2014-04-03 04:08:06 +02:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
viewport_create(window, window->x, window->y, window->width, window->height, 0,0x0FFF,0x0FFF, 0, 0x1, -1);
|
|
|
|
window->viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
|
|
|
|
gCurrentRotation = 0;
|
|
|
|
gShowGridLinesRefCount = 0;
|
|
|
|
gShowLandRightsRefCount = 0;
|
|
|
|
gShowConstuctionRightsRefCount = 0;
|
|
|
|
gFootpathSelectedType = 0;
|
2017-08-12 23:06:12 +02:00
|
|
|
|
|
|
|
return window;
|
2014-04-21 11:27:48 +02:00
|
|
|
}
|
2014-07-15 15:59:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2015-12-11 16:38:37 +01:00
|
|
|
* rct2: 0x66CCAE
|
2014-07-15 15:59:43 +02:00
|
|
|
* This function immediately jumps to 0x00685BE1 this is the second function
|
|
|
|
* decompiled.
|
|
|
|
*/
|
2015-07-10 02:39:16 +02:00
|
|
|
void window_main_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
2014-10-09 16:55:47 +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);
|
2014-07-15 15:59:43 +02:00
|
|
|
}
|