mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix compile issues. Add new structs
This commit is contained in:
parent
f700e560ca
commit
0c3844787b
13
src/window.c
13
src/window.c
|
@ -27,6 +27,7 @@
|
|||
#include "widget.h"
|
||||
#include "window.h"
|
||||
#include "viewport.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#define RCT2_FIRST_WINDOW (RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_LIST, rct_window))
|
||||
#define RCT2_LAST_WINDOW (RCT2_GLOBAL(RCT2_ADDRESS_NEW_WINDOW_PTR, rct_window*) - 1)
|
||||
|
@ -395,10 +396,10 @@ rct_window *window_create(int x, int y, int width, int height, uint32 *event_han
|
|||
w->pressed_widgets = 0;
|
||||
w->var_020 = 0;
|
||||
w->var_480 = 0;
|
||||
w->var_482 = 0;
|
||||
w->var_484 = 0;
|
||||
w->var_486 = 0;
|
||||
w->var_488 = 0;
|
||||
w->focus.coordinate.viewport_target_x = 0;
|
||||
w->focus.coordinate.viewport_target_y = 0;
|
||||
w->focus.coordinate.viewport_target_z = 0;
|
||||
w->focus.coordinate.viewport_target_rotation = 0;
|
||||
w->page = 0;
|
||||
w->var_48C = 0;
|
||||
w->frame_no = 0;
|
||||
|
@ -895,10 +896,10 @@ void window_scroll_to_viewport(rct_window *w)
|
|||
int x, y, z;
|
||||
rct_window *mainWindow;
|
||||
// In original checked to make sure x and y were not -1 as well.
|
||||
if (w->viewport == NULL || w->focus.sprite.viewport_target_sprite_id == -1)
|
||||
if (w->viewport == NULL || w->focus.coordinate.viewport_target_y == -1)
|
||||
return;
|
||||
|
||||
if (w->focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK) {
|
||||
if (w->focus.sprite.type & VIEWPORT_FOCUS_TYPE_SPRITE) {
|
||||
rct_sprite *sprite = &(g_sprite_list[w->focus.sprite.viewport_target_sprite_id]);
|
||||
x = sprite->unknown.x;
|
||||
y = sprite->unknown.y;
|
||||
|
|
43
src/window.h
43
src/window.h
|
@ -94,34 +94,57 @@ typedef struct {
|
|||
} rct_scroll;
|
||||
|
||||
// Type is viewport_target_y & 0x8000 == 0
|
||||
typedef struct coordinate_focus{
|
||||
typedef struct{
|
||||
sint16 viewport_target_x; //0x482
|
||||
sint16 viewport_target_y; //0x484 & VIEWPORT_FOCUS_Y_MASK
|
||||
sint16 viewport_target_z; //0x486
|
||||
uint8 viewport_target_rotation;//0x488
|
||||
uint8 pad_489;
|
||||
}
|
||||
} coordinate_focus;
|
||||
|
||||
// Type is viewport_target_sprite_id & 0x80000000 != 0
|
||||
typedef struct sprite_focus{
|
||||
typedef struct{
|
||||
uint16 viewport_target_sprite_id; //0x482
|
||||
uint8 pad_484;
|
||||
uint8 type; //0x485 & VIEWPORT_FOCUS_TYPE_MASK
|
||||
uint32 pad_486;
|
||||
}
|
||||
} sprite_focus;
|
||||
|
||||
#define VIEWPORT_FOCUS_TYPE_MASK 0x80
|
||||
#define VIEWPORT_FOCUS_TYPE_MASK 0xC0
|
||||
enum{
|
||||
VIEWPORT_FOCUS_TYPE_COORDINATE = (1<<6),
|
||||
VIEWPORT_FOCUS_TYPE_SPRITE = (1<<7)
|
||||
};
|
||||
#define VIEWPORT_FOCUS_Y_MASK 0x3FFF;
|
||||
|
||||
/**
|
||||
* Viewport focus structure.
|
||||
* size: 0x8
|
||||
*/
|
||||
union{
|
||||
typedef union{
|
||||
sprite_focus sprite;
|
||||
coordinate_focus coordinate;
|
||||
} viewport_focus;
|
||||
|
||||
typedef struct{
|
||||
uint16 no_weeks; //0x482
|
||||
uint16 ride_id; //0x484
|
||||
uint32 pad_486;
|
||||
} campaign_variables;
|
||||
|
||||
typedef struct{
|
||||
uint16 selected_ride_id; //0x482
|
||||
uint16 pad_484;
|
||||
uint16 pad_486;
|
||||
uint16 selected_ride_countdown; //488
|
||||
} new_ride_variables;
|
||||
|
||||
typedef struct{
|
||||
uint16 var_482;
|
||||
uint16 var_484;
|
||||
uint16 var_486;
|
||||
uint16 var_488;
|
||||
} news_variables;
|
||||
/**
|
||||
* Window structure
|
||||
* size: 0x4C0
|
||||
|
@ -152,7 +175,13 @@ typedef struct rct_window {
|
|||
sint16 pad_47C;
|
||||
sint16 pad_47E;
|
||||
sint16 var_480;
|
||||
viewport_focus focus; // 0x482 viewport focus
|
||||
union{
|
||||
viewport_focus focus;
|
||||
campaign_variables campaign;
|
||||
new_ride_variables new_ride;
|
||||
news_variables news;
|
||||
};
|
||||
//viewport_focus focus; // 0x482 viewport focus
|
||||
sint16 page; // 0x48A
|
||||
sint16 var_48C;
|
||||
sint16 frame_no; // 0x48E updated every tic for motion in windows sprites
|
||||
|
|
|
@ -165,10 +165,10 @@ void window_new_campaign_open(int campaignType)
|
|||
w->var_480 = campaignType;
|
||||
|
||||
// Number of weeks
|
||||
w->var_482 = 2;
|
||||
w->campaign.no_weeks = 2;
|
||||
|
||||
// Currently selected ride
|
||||
w->var_484 = SELECTED_RIDE_UNDEFINED;
|
||||
w->campaign.ride_id = SELECTED_RIDE_UNDEFINED;
|
||||
|
||||
// Get all applicable rides
|
||||
numApplicableRides = 0;
|
||||
|
@ -234,7 +234,7 @@ static void window_new_campaign_mouseup()
|
|||
break;
|
||||
case WIDX_START_BUTTON:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_START_MARKETING_CAMPAIGN;
|
||||
game_do_command(0, (w->var_482 << 8) | 1, 0, (w->var_484 << 8) | w->var_480, GAME_COMMAND_START_MARKETING_CAMPAIGN, 0, 0);
|
||||
game_do_command(0, (w->campaign.no_weeks<< 8) | 1, 0, (w->campaign.ride_id << 8) | w->var_480, GAME_COMMAND_START_MARKETING_CAMPAIGN, 0, 0);
|
||||
window_close(w);
|
||||
break;
|
||||
}
|
||||
|
@ -305,11 +305,11 @@ static void window_new_campaign_mousedown(int widgetIndex, rct_window *w, rct_wi
|
|||
}
|
||||
break;
|
||||
case WIDX_WEEKS_INCREASE_BUTTON:
|
||||
w->var_482 = min(w->var_482 + 1, 6);
|
||||
w->campaign.no_weeks = min(w->campaign.no_weeks + 1, 6);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_WEEKS_DECREASE_BUTTON:
|
||||
w->var_482 = max(w->var_482 - 1, 2);
|
||||
w->campaign.no_weeks = max(w->campaign.no_weeks - 1, 2);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
|
@ -333,9 +333,9 @@ static void window_new_campaign_dropdown()
|
|||
rct_string_id itemStringId = (uint16)gDropdownItemsArgs[dropdownIndex] - 2016;
|
||||
if (itemStringId >= 32)
|
||||
itemStringId -= 96;
|
||||
w->var_484 = itemStringId;
|
||||
w->campaign.ride_id = itemStringId;
|
||||
} else {
|
||||
w->var_484 = window_new_campaign_rides[dropdownIndex];
|
||||
w->campaign.ride_id = window_new_campaign_rides[dropdownIndex];
|
||||
}
|
||||
|
||||
window_invalidate(w);
|
||||
|
@ -362,8 +362,8 @@ static void window_new_campaign_invalidate()
|
|||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type = WWT_DROPDOWN;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WWT_DROPDOWN_BUTTON;
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].image = STR_MARKETING_RIDE;
|
||||
if (w->var_484 != SELECTED_RIDE_UNDEFINED) {
|
||||
rct_ride *ride = GET_RIDE(w->var_484);
|
||||
if (w->campaign.ride_id != SELECTED_RIDE_UNDEFINED) {
|
||||
rct_ride *ride = GET_RIDE(w->campaign.ride_id);
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].image = ride->var_04A;
|
||||
RCT2_GLOBAL(0x013CE952, uint32) = ride->var_04C;
|
||||
}
|
||||
|
@ -373,8 +373,8 @@ static void window_new_campaign_invalidate()
|
|||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type = WWT_DROPDOWN;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WWT_DROPDOWN_BUTTON;
|
||||
window_new_campaign_widgets[WIDX_RIDE_LABEL].image = STR_MARKETING_ITEM;
|
||||
if (w->var_484 != SELECTED_RIDE_UNDEFINED) {
|
||||
rct_string_id itemStringId = w->var_484 + 2016;
|
||||
if (w->campaign.ride_id != SELECTED_RIDE_UNDEFINED) {
|
||||
rct_string_id itemStringId = w->campaign.ride_id + 2016;
|
||||
if (itemStringId >= 2048)
|
||||
itemStringId += 96;
|
||||
window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].image = itemStringId;
|
||||
|
@ -383,11 +383,11 @@ static void window_new_campaign_invalidate()
|
|||
}
|
||||
|
||||
// Set current number of weeks spinner
|
||||
window_new_campaign_widgets[WIDX_WEEKS_SPINNER].image = (STR_MARKETING_1_WEEK - 1) + w->var_482;
|
||||
window_new_campaign_widgets[WIDX_WEEKS_SPINNER].image = (STR_MARKETING_1_WEEK - 1) + w->campaign.no_weeks;
|
||||
|
||||
// Enable / disable start button based on ride dropdown
|
||||
w->disabled_widgets &= ~(1 << WIDX_START_BUTTON);
|
||||
if (window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type == WWT_DROPDOWN && w->var_484 == SELECTED_RIDE_UNDEFINED)
|
||||
if (window_new_campaign_widgets[WIDX_RIDE_DROPDOWN].type == WWT_DROPDOWN && w->campaign.ride_id == SELECTED_RIDE_UNDEFINED)
|
||||
w->disabled_widgets |= 1 << WIDX_START_BUTTON;
|
||||
}
|
||||
|
||||
|
@ -414,6 +414,6 @@ static void window_new_campaign_paint()
|
|||
y += 13;
|
||||
|
||||
// Total price
|
||||
money32 totalPrice = AdvertisingCampaignPricePerWeek[w->var_480] * w->var_482;
|
||||
money32 totalPrice = AdvertisingCampaignPricePerWeek[w->var_480] * w->campaign.no_weeks;
|
||||
gfx_draw_string_left(dpi, STR_MARKETING_TOTAL_COST, &totalPrice, 0, x, y);
|
||||
}
|
|
@ -432,15 +432,15 @@ void window_new_ride_open()
|
|||
w->colours[1] = 26;
|
||||
w->colours[2] = 26;
|
||||
w->var_480 = -1;
|
||||
w->var_482 = -1;
|
||||
w->new_ride.selected_ride_id = -1;
|
||||
_lastTrackDesignCountRideType.type = 255;
|
||||
_lastTrackDesignCountRideType.entry_index = 255;
|
||||
|
||||
window_new_ride_populate_list();
|
||||
|
||||
w->var_482 = RCT2_ADDRESS(0x00F43825, sint16)[_window_new_ride_current_tab];
|
||||
if (w->var_482 == -1)
|
||||
w->var_482 = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
w->new_ride.selected_ride_id = RCT2_ADDRESS(0x00F43825, sint16)[_window_new_ride_current_tab];
|
||||
if (w->new_ride.selected_ride_id == -1)
|
||||
w->new_ride.selected_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
|
||||
w->width = 1;
|
||||
window_new_ride_refresh_widget_sizing(w);
|
||||
|
@ -577,13 +577,13 @@ static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget
|
|||
|
||||
_window_new_ride_current_tab = page;
|
||||
w->frame_no = 0;
|
||||
w->var_482 = -1;
|
||||
w->new_ride.selected_ride_id = -1;
|
||||
w->var_480 = -1;
|
||||
window_new_ride_populate_list();
|
||||
if (page < WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
w->var_482 = RCT2_ADDRESS(0x00F43825, sint16)[page];
|
||||
if (w->var_482 == -1)
|
||||
w->var_482 = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
w->new_ride.selected_ride_id = RCT2_ADDRESS(0x00F43825, sint16)[page];
|
||||
if (w->new_ride.selected_ride_id == -1)
|
||||
w->new_ride.selected_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
}
|
||||
|
||||
window_new_ride_refresh_widget_sizing(w);
|
||||
|
@ -603,7 +603,7 @@ static void window_new_ride_update(rct_window *w)
|
|||
|
||||
widget_invalidate(w->classification, w->number, WIDX_TAB_1 + _window_new_ride_current_tab);
|
||||
|
||||
if (w->var_480 != -1 && w->var_488-- == 0)
|
||||
if (w->var_480 != -1 && w->new_ride.selected_ride_countdown-- == 0)
|
||||
window_new_ride_select(w);
|
||||
}
|
||||
|
||||
|
@ -645,13 +645,14 @@ static void window_new_ride_scrollmousedown()
|
|||
{
|
||||
short x, y;
|
||||
rct_window *w;
|
||||
ride_list_item item;
|
||||
|
||||
window_scrollmouse_get_registers(w, x, y);
|
||||
|
||||
if (RCT2_GLOBAL(0x009DEA6E, uint8) != 0)
|
||||
return;
|
||||
|
||||
ride_list_item item = window_new_ride_scroll_get_ride_list_item_at(w, x, y);
|
||||
item = window_new_ride_scroll_get_ride_list_item_at(w, x, y);
|
||||
if (item.type == 255 && item.entry_index == 255)
|
||||
return;
|
||||
|
||||
|
@ -659,7 +660,7 @@ static void window_new_ride_scrollmousedown()
|
|||
w->var_480 = *((sint16*)&item);
|
||||
|
||||
sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2));
|
||||
w->var_488 = 8;
|
||||
w->new_ride.selected_ride_countdown = 8;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
|
@ -671,17 +672,18 @@ static void window_new_ride_scrollmouseover()
|
|||
{
|
||||
short x, y;
|
||||
rct_window *w;
|
||||
ride_list_item item;
|
||||
|
||||
window_scrollmouse_get_registers(w, x, y);
|
||||
|
||||
if (w->var_480 != -1)
|
||||
return;
|
||||
|
||||
ride_list_item item = window_new_ride_scroll_get_ride_list_item_at(w, x, y);
|
||||
if (w->var_482 == *((sint16*)&item))
|
||||
item = window_new_ride_scroll_get_ride_list_item_at(w, x, y);
|
||||
if (w->new_ride.selected_ride_id == *((sint16*)&item))
|
||||
return;
|
||||
|
||||
w->var_482 = *((sint16*)&item);
|
||||
w->new_ride.selected_ride_id = *((sint16*)&item);
|
||||
RCT2_ADDRESS(0x00F43825, ride_list_item)[_window_new_ride_current_tab] = item;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
@ -737,7 +739,7 @@ static void window_new_ride_paint()
|
|||
window_new_ride_draw_tab_images(dpi, w);
|
||||
|
||||
if (_window_new_ride_current_tab != WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
ride_list_item item = *((ride_list_item*)&w->var_482);
|
||||
ride_list_item item = *((ride_list_item*)&w->new_ride.selected_ride_id);
|
||||
if (item.type == 255 && item.entry_index == 255)
|
||||
return;
|
||||
|
||||
|
@ -827,15 +829,16 @@ static void window_new_ride_scrollpaint()
|
|||
int y = 1;
|
||||
ride_list_item *listItem = (ride_list_item*)0x00F43523;
|
||||
while (listItem->type != 255 || listItem->entry_index != 255) {
|
||||
uint8 *rideEntry;
|
||||
// Draw flat button rectangle
|
||||
int flags = 0;
|
||||
if (w->var_480 == *((sint16*)listItem))
|
||||
flags |= 0x20;
|
||||
if (w->var_482 == *((sint16*)listItem) || flags != 0)
|
||||
if (w->new_ride.selected_ride_id == *((sint16*)listItem) || flags != 0)
|
||||
gfx_fill_rect_inset(dpi, x, y, x + 115, y + 115, w->colours[1], 0x80 | flags);
|
||||
|
||||
// Draw ride image
|
||||
uint8 *rideEntry = rideEntries[listItem->entry_index];
|
||||
rideEntry = rideEntries[listItem->entry_index];
|
||||
int unk = RCT2_GLOBAL(rideEntry + 4, uint32);
|
||||
if (listItem->type != RCT2_GLOBAL(rideEntry + 12, uint8)) {
|
||||
unk++;
|
||||
|
|
|
@ -146,7 +146,7 @@ static void window_news_update(rct_window *w)
|
|||
|
||||
if (w->var_480 == -1)
|
||||
return;
|
||||
if (--w->var_484 != 0)
|
||||
if (--w->news.var_484 != 0)
|
||||
return;
|
||||
|
||||
window_invalidate(w);
|
||||
|
@ -162,10 +162,11 @@ static void window_news_update(rct_window *w)
|
|||
if (j == 0) {
|
||||
if (newsItems[i].flags & 1)
|
||||
return;
|
||||
if (w->var_482 == 1) {
|
||||
if (w->news.var_482 == 1) {
|
||||
news_item_open_subject(newsItems[i].type, newsItems[i].assoc);
|
||||
return;
|
||||
} else if (w->var_482 > 1) {
|
||||
}
|
||||
else if (w->news.var_482 > 1) {
|
||||
news_item_get_subject_location(newsItems[i].type, newsItems[i].assoc, &x, &y, &z);
|
||||
if (x != SPRITE_LOCATION_NULL)
|
||||
if ((w = window_get_main()) != NULL)
|
||||
|
@ -251,8 +252,8 @@ static void window_news_scrollmousedown()
|
|||
|
||||
if (buttonIndex != 0) {
|
||||
w->var_480 = i - 11;
|
||||
w->var_482 = buttonIndex;
|
||||
w->var_484 = 4;
|
||||
w->news.var_482 = buttonIndex;
|
||||
w->news.var_484 = 4;
|
||||
window_invalidate(w);
|
||||
sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2));
|
||||
}
|
||||
|
@ -330,7 +331,7 @@ static void window_news_scrollpaint()
|
|||
press = 0;
|
||||
if (w->var_480 != -1) {
|
||||
newsItem2 = &newsItems[11 + w->var_480];
|
||||
if (newsItem == newsItem2 && w->var_482 == 1)
|
||||
if (newsItem == newsItem2 && w->news.var_482 == 1)
|
||||
press = 0x20;
|
||||
}
|
||||
gfx_fill_rect_inset(dpi, x, yy, x + 23, yy + 23, w->colours[2], press);
|
||||
|
@ -371,7 +372,7 @@ static void window_news_scrollpaint()
|
|||
press = 0;
|
||||
if (w->var_480 != -1) {
|
||||
newsItem2 = &newsItems[11 + w->var_480];
|
||||
if (newsItem == newsItem2 && w->var_482 == 2)
|
||||
if (newsItem == newsItem2 && w->news.var_482 == 2)
|
||||
press = 0x20;
|
||||
}
|
||||
gfx_fill_rect_inset(dpi, x, yy, x + 23, yy + 23, w->colours[2], press);
|
||||
|
|
|
@ -593,7 +593,7 @@ rct_window *window_park_open()
|
|||
w->enabled_widgets = window_park_page_enabled_widgets[WINDOW_PARK_PAGE_ENTRANCE];
|
||||
w->number = 0;
|
||||
w->page = WINDOW_PARK_PAGE_ENTRANCE;
|
||||
w->var_482 = 0;
|
||||
w->focus.coordinate.viewport_target_y = 0;
|
||||
w->frame_no = 0;
|
||||
w->list_information_type = -1;
|
||||
w->var_48C = -1;
|
||||
|
@ -619,8 +619,8 @@ void window_park_entrance_open()
|
|||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
window->focus.coordinate.viewport_target_y = -1;
|
||||
window->focus.coordinate.viewport_target_x = -1;
|
||||
}
|
||||
|
||||
window->page = WINDOW_PARK_PAGE_ENTRANCE;
|
||||
|
@ -1021,10 +1021,11 @@ static void window_park_init_viewport(rct_window *w)
|
|||
// Call invalidate event
|
||||
RCT2_CALLPROC_X(w->event_handlers[WE_INVALIDATE], 0, 0, 0, 0, (int)w, 0, 0);
|
||||
|
||||
w->var_482 = x;
|
||||
w->var_484 = y;
|
||||
w->var_486 = z;
|
||||
w->var_488 = r << 8;
|
||||
w->focus.coordinate.viewport_target_x = x;
|
||||
w->focus.coordinate.viewport_target_y = y;
|
||||
w->focus.sprite.type |= VIEWPORT_FOCUS_TYPE_COORDINATE;
|
||||
w->focus.coordinate.viewport_target_z = z;
|
||||
w->focus.coordinate.viewport_target_rotation = r;
|
||||
|
||||
if (zr != 0xFFFF) {
|
||||
// Create viewport
|
||||
|
@ -1036,11 +1037,11 @@ static void window_park_init_viewport(rct_window *w)
|
|||
w->y + viewportWidget->top + 1,
|
||||
(viewportWidget->right - viewportWidget->left) - 2,
|
||||
(viewportWidget->bottom - viewportWidget->top) - 2,
|
||||
zr&0xFF,
|
||||
r,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
xy&0xC0000000 >> 30,
|
||||
w->focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK,
|
||||
-1
|
||||
);
|
||||
w->flags |= (1 << 2);
|
||||
|
@ -1068,8 +1069,8 @@ void window_park_rating_open()
|
|||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
window->focus.coordinate.viewport_target_x = -1;
|
||||
window->focus.coordinate.viewport_target_y = -1;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
|
@ -1202,8 +1203,8 @@ void window_park_guests_open()
|
|||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
window->focus.coordinate.viewport_target_x = -1;
|
||||
window->focus.coordinate.viewport_target_y = -1;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
|
@ -1608,8 +1609,8 @@ void window_park_objective_open()
|
|||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
window->focus.coordinate.viewport_target_x = -1;
|
||||
window->focus.coordinate.viewport_target_y = -1;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
|
@ -1771,8 +1772,8 @@ void window_park_awards_open()
|
|||
window = window_bring_to_front_by_id(WC_PARK_INFORMATION, 0);
|
||||
if (window == NULL) {
|
||||
window = window_park_open();
|
||||
window->var_482 = -1;
|
||||
window->var_484 = -1;
|
||||
window->focus.coordinate.viewport_target_x = -1;
|
||||
window->focus.coordinate.viewport_target_y = -1;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3))
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "string_ids.h"
|
||||
#include "sprite.h"
|
||||
#include "sprites.h"
|
||||
#include "viewport.h"
|
||||
#include "widget.h"
|
||||
#include "window.h"
|
||||
#include "window_dropdown.h"
|
||||
|
@ -85,6 +86,8 @@ rct_widget *window_peep_page_widgets[] = {
|
|||
window_peep_overview_widgets
|
||||
};
|
||||
|
||||
void window_peep_set_page(rct_window* w, int page);
|
||||
|
||||
void window_peep_close();
|
||||
void window_peep_resize();
|
||||
void window_peep_overview_mouse_up(int widgetIndex, rct_window* w, rct_widget* widget);
|
||||
|
@ -153,8 +156,8 @@ uint32 window_peep_page_enabled_widgets[] = {
|
|||
(1 << WIDX_TAB_3) |
|
||||
(1 << WIDX_TAB_4) |
|
||||
(1 << WIDX_TAB_5) |
|
||||
(1 << WIDX_TAB_6) |
|
||||
(1 << WIDX_?),
|
||||
(1 << WIDX_TAB_6), //|
|
||||
//(1 << WIDX_?),
|
||||
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
|
@ -201,7 +204,7 @@ void window_peep_open(rct_peep* peep){
|
|||
window->enabled_widgets = window_peep_page_enabled_widgets[0];
|
||||
window->number = peep->sprite_index;
|
||||
window->page = 0;
|
||||
window->var_482 = 0;
|
||||
window->focus.coordinate.viewport_target_y = 0;
|
||||
window->frame_no = 0;
|
||||
window->list_information_type = 0;
|
||||
window->var_492 = 0;
|
||||
|
@ -217,7 +220,7 @@ void window_peep_open(rct_peep* peep){
|
|||
window->colours[0] = 1;
|
||||
window->colours[1] = 15;
|
||||
window->colours[2] = 15;
|
||||
window->var_482 = -1;
|
||||
window->focus.coordinate.viewport_target_y = -1;
|
||||
}
|
||||
|
||||
window->page = 0;
|
||||
|
@ -254,7 +257,7 @@ void window_peep_resize(){
|
|||
window_get_register(w);
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x6987a6);
|
||||
RCT2_CALLPROC_EBPSAFE(w->eventhandler[WE_INVALIDATE]);
|
||||
RCT2_CALLPROC_EBPSAFE(w->event_handlers[WE_INVALIDATE]);
|
||||
|
||||
window_invalidate_by_id(0xA97,w->number);
|
||||
|
||||
|
@ -288,7 +291,7 @@ void window_peep_resize(){
|
|||
if (view){
|
||||
if ((w->width - 30) == view->width){
|
||||
if ((w->height - 72) == view->height){
|
||||
RCT2_CALLPROC_X(0x0069883C, 0, 0, 0, 0, (int)window, 0, 0);
|
||||
RCT2_CALLPROC_X(0x0069883C, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -298,7 +301,7 @@ void window_peep_resize(){
|
|||
view->view_width = view->width / zoom_amount;
|
||||
view->view_height = view->height / zoom_amount;
|
||||
}
|
||||
RCT2_CALLPROC_X(0x0069883C, 0, 0, 0, 0, (int)window, 0, 0);
|
||||
RCT2_CALLPROC_X(0x0069883C, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
}
|
||||
|
||||
/* rct2: 0x00696A06 */
|
||||
|
@ -307,13 +310,13 @@ void window_peep_overview_mouse_up(int widgetIndex, rct_window* w, rct_widget* w
|
|||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_TAB1:
|
||||
case WIDX_TAB2:
|
||||
case WIDX_TAB3:
|
||||
case WIDX_TAB4:
|
||||
case WIDX_TAB5:
|
||||
case WIDX_TAB6:
|
||||
window_peep_set_page(w, widgetIndex - WIDX_TAB1);
|
||||
case WIDX_TAB_1:
|
||||
case WIDX_TAB_2:
|
||||
case WIDX_TAB_3:
|
||||
case WIDX_TAB_4:
|
||||
case WIDX_TAB_5:
|
||||
case WIDX_TAB_6:
|
||||
window_peep_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
case WIDX_RENAME:
|
||||
//696ba6
|
||||
|
|
|
@ -186,7 +186,7 @@ rct_window* sub_6BEF1B(rct_peep* peep)
|
|||
w->enabled_widgets = RCT2_GLOBAL(0x9929B0, uint32);
|
||||
w->number = peep->sprite_index;
|
||||
w->page = 0;
|
||||
w->var_482 = 0;
|
||||
w->focus.coordinate.viewport_target_y = 0;
|
||||
w->frame_no = 0;
|
||||
|
||||
RCT2_GLOBAL((int*)w + 0x496, uint16) = 0; // missing, var_494 should perhaps be uint16?
|
||||
|
|
Loading…
Reference in New Issue