1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Use macros from addresses.h

This commit is contained in:
adrian17
2014-08-28 17:27:48 +02:00
parent 60e90063f0
commit b6f98167c4
6 changed files with 15 additions and 15 deletions

View File

@@ -282,7 +282,7 @@ int dsound_create_primary_buffer(int a, int device, int channels, int samples, i
}
WAVEFORMATEX waveformat1, waveformat2;
RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER)->lpVtbl->GetFormat(RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER), &waveformat1, sizeof(WAVEFORMATEX), 0);
RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER)->lpVtbl->SetFormat(RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER), &RCT2_GLOBAL(0x01425B40, WAVEFORMATEX));
RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER)->lpVtbl->SetFormat(RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER), &RCT2_GLOBAL(RCT2_ADDRESS_AUDIO_INFO, WAVEFORMATEX));
RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER)->lpVtbl->GetFormat(RCT2_GLOBAL(0x009E2BA8, LPDIRECTSOUNDBUFFER), &waveformat2, sizeof(WAVEFORMATEX), 0);
return 1;
}
@@ -683,7 +683,7 @@ int sound_play_panned(int sound_id, int x)
}
RCT2_GLOBAL(0x014241BC, uint32) = 1;
sound_prepare(sound_id, &other_sound->sound, 1, RCT2_GLOBAL(0x009AAC6E, uint32));
sound_prepare(sound_id, &other_sound->sound, 1, RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, uint32));
RCT2_GLOBAL(0x014241BC, uint32) = 0;
RCT2_GLOBAL(0x014241BC, uint32) = 1;
result = sound_play(&other_sound->sound, 0, volume, pan, 0);

View File

@@ -90,7 +90,7 @@ void park_init()
RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16) = MONEY(10, 00);
RCT2_GLOBAL(RCT2_ADDRESS_PEEP_SPAWNS, sint16) = -1;
RCT2_GLOBAL(0x013573F8, sint16) = -1;
RCT2_GLOBAL(0x01357CF2, uint16) = 127;
RCT2_GLOBAL(RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES, uint16) = 127;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8) = 2;
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_CASH, uint16) = MONEY(50,00); // Cash per guest (average)

View File

@@ -139,7 +139,7 @@ void scenario_load(const char *path)
sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_CURRENT_PARK_RATING);
// Read ?
sawyercoding_read_chunk(file, (uint8*)0x01357CF2);
sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES);
// Read ?
sawyercoding_read_chunk(file, (uint8*)0x0135832C);

View File

@@ -174,7 +174,7 @@ void window_new_campaign_open(sint16 campaignType)
numApplicableRides = 0;
window_new_campaign_rides[0] = 255;
FOR_ALL_RIDES(i, ride) {
if (!(RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x03820000))
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32) & 0x03820000))
window_new_campaign_rides[numApplicableRides++] = i;
}
window_new_campaign_rides[numApplicableRides] = 255;

View File

@@ -29,7 +29,7 @@
#include "widget.h"
#include "window.h"
#define _window_new_ride_current_tab RCT2_GLOBAL(0x00F43824, uint8)
#define _window_new_ride_current_tab RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_RIDE_LIST_SELECTED_TAB, uint8)
typedef struct {
uint8 type;
@@ -374,7 +374,7 @@ static void window_new_ride_scroll_to_focused_ride(rct_window *w)
// Find row index of the focused ride type
rct_widget *listWidget = &window_new_ride_widgets[WIDX_RIDE_LIST];
int focusRideType = RCT2_ADDRESS(0x00F43825, uint16)[_window_new_ride_current_tab];
int focusRideType = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, uint16)[_window_new_ride_current_tab];
int count = 0, row = 0;
ride_list_item *listItem = (ride_list_item*)0x00F43523;
while (listItem->type != 255 || listItem->entry_index != 255) {
@@ -436,7 +436,7 @@ void window_new_ride_open()
window_new_ride_populate_list();
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(0x00F43825, sint16)[_window_new_ride_current_tab];
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, sint16)[_window_new_ride_current_tab];
if (w->new_ride.highlighted_ride_id == -1)
w->new_ride.highlighted_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
@@ -579,7 +579,7 @@ static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget
w->new_ride.selected_ride_countdown = -1;
window_new_ride_populate_list();
if (page < WINDOW_NEW_RIDE_PAGE_RESEARCH) {
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(0x00F43825, sint16)[page];
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, sint16)[page];
if (w->new_ride.highlighted_ride_id == -1)
w->new_ride.highlighted_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
}
@@ -654,7 +654,7 @@ static void window_new_ride_scrollmousedown()
if (item.type == 255 && item.entry_index == 255)
return;
RCT2_ADDRESS(0x00F43825, ride_list_item)[_window_new_ride_current_tab] = item;
RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, ride_list_item)[_window_new_ride_current_tab] = item;
w->new_ride.selected_ride_id = *((sint16*)&item);
sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2));
@@ -683,7 +683,7 @@ static void window_new_ride_scrollmouseover()
return;
w->new_ride.highlighted_ride_id = *((sint16*)&item);
RCT2_ADDRESS(0x00F43825, ride_list_item)[_window_new_ride_current_tab] = item;
RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, ride_list_item)[_window_new_ride_current_tab] = item;
window_invalidate(w);
}
@@ -715,7 +715,7 @@ static void window_new_ride_invalidate()
if (_window_new_ride_current_tab == WINDOW_NEW_RIDE_PAGE_RESEARCH) {
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
if (typeId != 0xFFFFFFFF) {
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = typeId >= 0x10000 ? 5189 : 5191;
@@ -790,7 +790,7 @@ static void window_new_ride_paint()
x = w->x + 10;
y = w->y + window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
if (typeId != 0xFFFFFFFF) {
if (typeId >= 0x10000) {
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);

View File

@@ -310,7 +310,7 @@ static void window_research_development_invalidate()
window_research_set_pressed_tab(w);
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
if (typeId != 0xFFFFFFFF) {
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = typeId >= 0x10000 ? 5189 : 5191;
@@ -377,7 +377,7 @@ static void window_research_development_paint()
x = w->x + 10;
y = w->y + window_research_development_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
int lastDevelopmentFormat;
if (typeId != 0xFFFFFFFF) {
if (typeId >= 0x10000) {