mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use `GET_RIDE_ENTRY` macro to get ride entry
This commit is contained in:
parent
6eadf824ea
commit
ddab3a1b74
|
@ -290,7 +290,6 @@ static void window_new_ride_populate_list()
|
||||||
|
|
||||||
uint8 currentCategory = _window_new_ride_current_tab;
|
uint8 currentCategory = _window_new_ride_current_tab;
|
||||||
ride_list_item *nextListItem = (ride_list_item*)0x00F43523;
|
ride_list_item *nextListItem = (ride_list_item*)0x00F43523;
|
||||||
rct_ride_type **rideEntries = (rct_ride_type**)RCT2_ADDRESS_RIDE_ENTRIES;
|
|
||||||
|
|
||||||
// For each ride type in the view order list
|
// For each ride type in the view order list
|
||||||
for (i = 0; i < countof(RideTypeViewOrder); i++) {
|
for (i = 0; i < countof(RideTypeViewOrder); i++) {
|
||||||
|
@ -326,7 +325,7 @@ static void window_new_ride_populate_list()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Ride entries
|
// Ride entries
|
||||||
rct_ride_type *rideEntry = rideEntries[rideEntryIndex];
|
rct_ride_type *rideEntry = GET_RIDE_ENTRY(rideEntryIndex);
|
||||||
|
|
||||||
// Check if ride is in this category
|
// Check if ride is in this category
|
||||||
if (!gConfigInterface.select_by_track_type && (currentCategory != rideEntry->category[0] && currentCategory != rideEntry->category[1]))
|
if (!gConfigInterface.select_by_track_type && (currentCategory != rideEntry->category[0] && currentCategory != rideEntry->category[1]))
|
||||||
|
@ -773,8 +772,6 @@ static void window_new_ride_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||||
*/
|
*/
|
||||||
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex)
|
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int scrollIndex)
|
||||||
{
|
{
|
||||||
rct_ride_type **rideEntries = (rct_ride_type**)RCT2_ADDRESS_RIDE_ENTRIES;
|
|
||||||
|
|
||||||
if (_window_new_ride_current_tab == WINDOW_NEW_RIDE_PAGE_RESEARCH)
|
if (_window_new_ride_current_tab == WINDOW_NEW_RIDE_PAGE_RESEARCH)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -793,7 +790,7 @@ static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, i
|
||||||
gfx_fill_rect_inset(dpi, x, y, x + 115, y + 115, w->colours[1], 0x80 | flags);
|
gfx_fill_rect_inset(dpi, x, y, x + 115, y + 115, w->colours[1], 0x80 | flags);
|
||||||
|
|
||||||
// Draw ride image with feathered border
|
// Draw ride image with feathered border
|
||||||
rideEntry = rideEntries[listItem->entry_index];
|
rideEntry = GET_RIDE_ENTRY(listItem->entry_index);
|
||||||
int image_id = rideEntry->images_offset;
|
int image_id = rideEntry->images_offset;
|
||||||
if (listItem->type != rideEntry->ride_type[0]) {
|
if (listItem->type != rideEntry->ride_type[0]) {
|
||||||
image_id++;
|
image_id++;
|
||||||
|
@ -863,8 +860,7 @@ static int get_num_track_designs(ride_list_item item)
|
||||||
*/
|
*/
|
||||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width)
|
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width)
|
||||||
{
|
{
|
||||||
rct_ride_type **rideEntries = (rct_ride_type**)RCT2_ADDRESS_RIDE_ENTRIES;
|
rct_ride_type *rideEntry = GET_RIDE_ENTRY(item.entry_index);
|
||||||
rct_ride_type *rideEntry = rideEntries[item.entry_index];
|
|
||||||
|
|
||||||
// Ride name and description
|
// Ride name and description
|
||||||
rct_string_id rideName = rideEntry->name;
|
rct_string_id rideName = rideEntry->name;
|
||||||
|
|
|
@ -350,7 +350,7 @@ void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dp
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != RESEARCH_STAGE_DESIGNING) {
|
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != RESEARCH_STAGE_DESIGNING) {
|
||||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
|
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
|
||||||
if (typeId >= 0x10000) {
|
if (typeId >= 0x10000) {
|
||||||
rct_ride_type *rideEntry = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_ENTRIES + (typeId & 0xFF) * 4, rct_ride_type*);
|
rct_ride_type *rideEntry = GET_RIDE_ENTRY(typeId & 0xFF);
|
||||||
stringId = (rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) ?
|
stringId = (rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) ?
|
||||||
rideEntry->name :
|
rideEntry->name :
|
||||||
((typeId >> 8) & 0xFF) + 2;
|
((typeId >> 8) & 0xFF) + 2;
|
||||||
|
@ -388,7 +388,7 @@ void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dp
|
||||||
int lastDevelopmentFormat;
|
int lastDevelopmentFormat;
|
||||||
if (typeId != 0xFFFFFFFF) {
|
if (typeId != 0xFFFFFFFF) {
|
||||||
if (typeId >= 0x10000) {
|
if (typeId >= 0x10000) {
|
||||||
rct_ride_type *rideEntry = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_ENTRIES + (typeId & 0xFF) * 4, rct_ride_type*);
|
rct_ride_type *rideEntry = GET_RIDE_ENTRY(typeId & 0xFF);
|
||||||
stringId = (rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) ?
|
stringId = (rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME) ?
|
||||||
rideEntry->name :
|
rideEntry->name :
|
||||||
((typeId >> 8) & 0xFF) + 2;
|
((typeId >> 8) & 0xFF) + 2;
|
||||||
|
|
Loading…
Reference in New Issue