mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Convert rct_window to opaque pointer
This commit is contained in:
committed by
Aaron van Geffen
parent
4c956def67
commit
aa0933d08a
@@ -301,6 +301,7 @@
|
||||
C67B28152002D67A00109C93 /* Widget.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28122002D67900109C93 /* Widget.h */; };
|
||||
C67B28162002D67A00109C93 /* Window.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28132002D67900109C93 /* Window.h */; };
|
||||
C67B28172002D67A00109C93 /* Viewport.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28142002D67900109C93 /* Viewport.h */; };
|
||||
C67B28192002D7F200109C93 /* Window_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C67B28182002D7F200109C93 /* Window_internal.h */; };
|
||||
C67CCD661FBBCFDB004FAE4C /* EditorBottomToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C67CCD651FBBCFDB004FAE4C /* EditorBottomToolbar.cpp */; };
|
||||
C67CCD681FBBD138004FAE4C /* EditorMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C67CCD671FBBD137004FAE4C /* EditorMain.cpp */; };
|
||||
C68313C61FDB4EBA006DB3D8 /* input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C68313C51FDB4EBA006DB3D8 /* input.cpp */; };
|
||||
@@ -989,6 +990,7 @@
|
||||
C67B28122002D67900109C93 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = "<group>"; };
|
||||
C67B28132002D67900109C93 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window.h; sourceTree = "<group>"; };
|
||||
C67B28142002D67900109C93 /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = "<group>"; };
|
||||
C67B28182002D7F200109C93 /* Window_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Window_internal.h; sourceTree = "<group>"; };
|
||||
C67CCD651FBBCFDB004FAE4C /* EditorBottomToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorBottomToolbar.cpp; sourceTree = "<group>"; };
|
||||
C67CCD671FBBD137004FAE4C /* EditorMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorMain.cpp; sourceTree = "<group>"; };
|
||||
C68313C51FDB4EBA006DB3D8 /* input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = input.cpp; sourceTree = "<group>"; };
|
||||
@@ -2047,6 +2049,7 @@
|
||||
4C7B53EE200143C200A52E21 /* ViewportInteraction.cpp */,
|
||||
4C7B53EF200143C200A52E21 /* Widget.cpp */,
|
||||
4C7B53F0200143C200A52E21 /* Widget.h */,
|
||||
C67B28182002D7F200109C93 /* Window_internal.h */,
|
||||
4C7B53F1200143C200A52E21 /* Window.cpp */,
|
||||
4C7B53F2200143C200A52E21 /* Window.h */,
|
||||
);
|
||||
@@ -2769,6 +2772,7 @@
|
||||
C67B28152002D67A00109C93 /* Widget.h in Headers */,
|
||||
C6352B951F477032006CCEE3 /* RideCreateAction.hpp in Headers */,
|
||||
C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */,
|
||||
C67B28192002D7F200109C93 /* Window_internal.h in Headers */,
|
||||
C6352B971F477032006CCEE3 /* SetParkEntranceFeeAction.hpp in Headers */,
|
||||
C6352B861F477022006CCEE3 /* Endianness.h in Headers */,
|
||||
C6352B941F477032006CCEE3 /* PlaceParkEntranceAction.hpp in Headers */,
|
||||
|
||||
@@ -17,3 +17,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <openrct2/interface/Window.h>
|
||||
#include <openrct2/interface/Window_internal.h>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#pragma endregion
|
||||
|
||||
#include "../interface/Window.h"
|
||||
#include "../interface/Window_internal.h"
|
||||
#include "../world/Climate.h"
|
||||
#include "Drawing.h"
|
||||
#include "../config/Config.h"
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "Colour.h"
|
||||
#include "Viewport.h"
|
||||
#include "Window.h"
|
||||
#include "Window_internal.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "../world/LargeScenery.h"
|
||||
#include "../world/Sprite.h"
|
||||
#include "Viewport.h"
|
||||
#include "Window_internal.h"
|
||||
#include "../Context.h"
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "../Context.h"
|
||||
#include "Widget.h"
|
||||
#include "Window.h"
|
||||
#include "Window_internal.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);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "Viewport.h"
|
||||
#include "Widget.h"
|
||||
#include "Window.h"
|
||||
#include "Window_internal.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -242,85 +242,7 @@ typedef struct error_variables {
|
||||
uint16 var_480;
|
||||
} error_variables;
|
||||
|
||||
/**
|
||||
* Window structure
|
||||
* size: 0x4C0
|
||||
*/
|
||||
typedef struct rct_window {
|
||||
rct_window_event_list* event_handlers; // 0x000
|
||||
rct_viewport* viewport; // 0x004
|
||||
uint64 enabled_widgets; // 0x008
|
||||
uint64 disabled_widgets; // 0x010
|
||||
uint64 pressed_widgets; // 0x018
|
||||
uint64 hold_down_widgets; // 0x020
|
||||
rct_widget* widgets; // 0x028
|
||||
sint16 x; // 0x02C
|
||||
sint16 y; // 0x02E
|
||||
sint16 width; // 0x030
|
||||
sint16 height; // 0x032
|
||||
sint16 min_width; // 0x034
|
||||
sint16 max_width; // 0x036
|
||||
sint16 min_height; // 0x038
|
||||
sint16 max_height; // 0x03A
|
||||
rct_windownumber number; // 0x03C
|
||||
uint16 flags; // 0x03E
|
||||
rct_scroll scrolls[3]; // 0x040
|
||||
uint8 list_item_positions[1024];// 0x076
|
||||
uint16 no_list_items; // 0x476 0 for no items
|
||||
sint16 pad_478;
|
||||
sint16 selected_list_item; // 0x47A -1 for none selected
|
||||
sint16 pad_47C;
|
||||
sint16 pad_47E;
|
||||
union {
|
||||
coordinate_focus viewport_focus_coordinates;
|
||||
sprite_focus viewport_focus_sprite;
|
||||
campaign_variables campaign;
|
||||
new_ride_variables new_ride;
|
||||
news_variables news;
|
||||
map_variables map;
|
||||
ride_variables ride;
|
||||
scenery_variables scenery;
|
||||
track_list_variables track_list;
|
||||
error_variables error;
|
||||
};
|
||||
sint16 page; // 0x48A
|
||||
union {
|
||||
sint16 picked_peep_old_x; // 0x48C staff/guest window: peep x gets set to 0x8000 on pickup, this is the old value
|
||||
sint16 vehicleIndex; // 0x48C Ride window: selected car when setting vehicle colours
|
||||
sint16 numberOfStaff; // 0x48C Used in park window.
|
||||
sint16 var_48C;
|
||||
};
|
||||
uint16 frame_no; // 0x48E updated every tic for motion in windows sprites
|
||||
uint16 list_information_type; // 0x490 0 for none, Used as current position of marquee in window_peep
|
||||
union {
|
||||
sint16 picked_peep_frame; // 0x492 Animation frame of picked peep in staff window and guest window
|
||||
sint16 var_492;
|
||||
};
|
||||
union { // 0x494
|
||||
uint32 highlighted_item;
|
||||
uint16 ride_colour;
|
||||
rct_research_item* research_item;
|
||||
rct_object_entry* object_entry;
|
||||
const scenario_index_entry* highlighted_scenario;
|
||||
struct {
|
||||
uint16 var_494;
|
||||
uint16 var_496;
|
||||
};
|
||||
};
|
||||
uint8 var_498[0x14];
|
||||
sint16 selected_tab; // 0x4AC
|
||||
sint16 var_4AE;
|
||||
uint16 viewport_target_sprite; // 0x4B0 viewport target sprite
|
||||
sint16 saved_view_x; // 0x4B2
|
||||
sint16 saved_view_y; // 0x4B4
|
||||
rct_windowclass classification; // 0x4B6
|
||||
uint8 pad_4B7;
|
||||
sint8 var_4B8;
|
||||
sint8 var_4B9;
|
||||
uint8 colours[6]; // 0x4BA
|
||||
uint8 visibility; // VISIBILITY_CACHE
|
||||
uint16 viewport_smart_follow_sprite; // Smart following of sprites. Handles setting viewport target sprite etc
|
||||
} rct_window;
|
||||
typedef struct rct_window rct_window;
|
||||
|
||||
#define RCT_WINDOW_RIGHT(w) (w->x + w->width)
|
||||
#define RCT_WINDOW_BOTTOM(w) (w->y + w->height)
|
||||
@@ -627,13 +549,6 @@ typedef void (*close_callback)();
|
||||
#define WINDOW_LIMIT_MAX 64
|
||||
#define WINDOW_LIMIT_RESERVED 4 // Used to reserve room for the main viewport, toolbars, etc.
|
||||
|
||||
// rct2: 0x01420078
|
||||
extern rct_window g_window_list[WINDOW_LIMIT_MAX + WINDOW_LIMIT_RESERVED];
|
||||
|
||||
extern rct_window * gWindowFirst;
|
||||
extern rct_window * gWindowNextSlot;
|
||||
extern rct_window * gWindowAudioExclusive;
|
||||
|
||||
extern uint16 gWindowUpdateTicks;
|
||||
extern uint8 gToolbarDirtyFlags;
|
||||
extern uint16 gWindowMapFlashingFlags;
|
||||
@@ -713,6 +628,8 @@ void window_close_construction_windows();
|
||||
|
||||
void window_update_viewport_ride_music();
|
||||
|
||||
rct_viewport * window_get_viewport(rct_window * window);
|
||||
|
||||
// Open window functions
|
||||
void window_relocate_windows(sint32 width, sint32 height);
|
||||
void window_resize_gui(sint32 width, sint32 height);
|
||||
|
||||
111
src/openrct2/interface/Window_internal.h
Normal file
111
src/openrct2/interface/Window_internal.h
Normal file
@@ -0,0 +1,111 @@
|
||||
#pragma region Copyright (c) 2014-2018 OpenRCT2 Developers
|
||||
/*****************************************************************************
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* A full copy of the GNU General Public License can be found in licence.txt
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#ifndef _WINDOW2_H_
|
||||
#define _WINDOW2_H_
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
/**
|
||||
* Window structure
|
||||
* size: 0x4C0
|
||||
*/
|
||||
struct rct_window {
|
||||
rct_window_event_list* event_handlers; // 0x000
|
||||
rct_viewport* viewport; // 0x004
|
||||
uint64 enabled_widgets; // 0x008
|
||||
uint64 disabled_widgets; // 0x010
|
||||
uint64 pressed_widgets; // 0x018
|
||||
uint64 hold_down_widgets; // 0x020
|
||||
rct_widget* widgets; // 0x028
|
||||
sint16 x; // 0x02C
|
||||
sint16 y; // 0x02E
|
||||
sint16 width; // 0x030
|
||||
sint16 height; // 0x032
|
||||
sint16 min_width; // 0x034
|
||||
sint16 max_width; // 0x036
|
||||
sint16 min_height; // 0x038
|
||||
sint16 max_height; // 0x03A
|
||||
rct_windownumber number; // 0x03C
|
||||
uint16 flags; // 0x03E
|
||||
rct_scroll scrolls[3]; // 0x040
|
||||
uint8 list_item_positions[1024];// 0x076
|
||||
uint16 no_list_items; // 0x476 0 for no items
|
||||
sint16 pad_478;
|
||||
sint16 selected_list_item; // 0x47A -1 for none selected
|
||||
sint16 pad_47C;
|
||||
sint16 pad_47E;
|
||||
union {
|
||||
coordinate_focus viewport_focus_coordinates;
|
||||
sprite_focus viewport_focus_sprite;
|
||||
campaign_variables campaign;
|
||||
new_ride_variables new_ride;
|
||||
news_variables news;
|
||||
map_variables map;
|
||||
ride_variables ride;
|
||||
scenery_variables scenery;
|
||||
track_list_variables track_list;
|
||||
error_variables error;
|
||||
};
|
||||
sint16 page; // 0x48A
|
||||
union {
|
||||
sint16 picked_peep_old_x; // 0x48C staff/guest window: peep x gets set to 0x8000 on pickup, this is the old value
|
||||
sint16 vehicleIndex; // 0x48C Ride window: selected car when setting vehicle colours
|
||||
sint16 numberOfStaff; // 0x48C Used in park window.
|
||||
sint16 var_48C;
|
||||
};
|
||||
uint16 frame_no; // 0x48E updated every tic for motion in windows sprites
|
||||
uint16 list_information_type; // 0x490 0 for none, Used as current position of marquee in window_peep
|
||||
union {
|
||||
sint16 picked_peep_frame; // 0x492 Animation frame of picked peep in staff window and guest window
|
||||
sint16 var_492;
|
||||
};
|
||||
union { // 0x494
|
||||
uint32 highlighted_item;
|
||||
uint16 ride_colour;
|
||||
rct_research_item* research_item;
|
||||
rct_object_entry* object_entry;
|
||||
const scenario_index_entry* highlighted_scenario;
|
||||
struct {
|
||||
uint16 var_494;
|
||||
uint16 var_496;
|
||||
};
|
||||
};
|
||||
uint8 var_498[0x14];
|
||||
sint16 selected_tab; // 0x4AC
|
||||
sint16 var_4AE;
|
||||
uint16 viewport_target_sprite; // 0x4B0 viewport target sprite
|
||||
sint16 saved_view_x; // 0x4B2
|
||||
sint16 saved_view_y; // 0x4B4
|
||||
rct_windowclass classification; // 0x4B6
|
||||
uint8 pad_4B7;
|
||||
sint8 var_4B8;
|
||||
sint8 var_4B9;
|
||||
uint8 colours[6]; // 0x4BA
|
||||
uint8 visibility; // VISIBILITY_CACHE
|
||||
uint16 viewport_smart_follow_sprite; // Smart following of sprites. Handles setting viewport target sprite etc
|
||||
};
|
||||
|
||||
// rct2: 0x01420078
|
||||
extern rct_window g_window_list[WINDOW_LIMIT_MAX + WINDOW_LIMIT_RESERVED];
|
||||
|
||||
extern rct_window * gWindowFirst;
|
||||
extern rct_window * gWindowNextSlot;
|
||||
extern rct_window * gWindowAudioExclusive;
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "../Game.h"
|
||||
#include "../interface/Viewport.h"
|
||||
#include "../interface/Window.h"
|
||||
#include "../interface/Window_internal.h"
|
||||
#include "../management/NewsItem.h"
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/Scenery.h"
|
||||
|
||||
Reference in New Issue
Block a user