1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 15:54:31 +01:00

Integrate remaining globals in ride window

This commit is contained in:
Ted John
2016-09-10 18:21:05 +01:00
parent 17198cfdb2
commit f36485557d
11 changed files with 22 additions and 26 deletions

View File

@@ -262,7 +262,7 @@ void entrance_paint(uint8 direction, int height, rct_map_element* map_element){
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS,sint16) +
0x20101689;
image_id -= RCT2_GLOBAL(0x01359208, sint16);
image_id -= gMapBaseZ;
sub_98197C(image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64, get_current_rotation());
}

View File

@@ -760,7 +760,7 @@ void path_paint(uint8 direction, uint16 height, rct_map_element * map_element)
}
uint32 imageId = (SPR_HEIGHT_MARKER_BASE + height / 16) | COLOUR_GREY << 19 | 0x20000000;
imageId += get_height_marker_offset();
imageId -= RCT2_GLOBAL(0x01359208, uint16);
imageId -= gMapBaseZ;
sub_98196C(imageId, 16, 16, 1, 1, 0, height, get_current_rotation());
}

View File

@@ -1030,7 +1030,7 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
int image_id = (SPR_HEIGHT_MARKER_BASE + dx / 16) | 0x20780000;
image_id += get_height_marker_offset();
image_id -= RCT2_GLOBAL(0x01359208, uint16);
image_id -= gMapBaseZ;
sub_98196C(image_id, 16, 16, 1, 1, 0, height, rotation);
}

View File

@@ -1284,7 +1284,7 @@ private:
}
mapElement++;
}
RCT2_GLOBAL(0x01359208, uint16) = 7;
gMapBaseZ = 7;
}
void FixPaths()

View File

@@ -372,7 +372,7 @@ void S6Exporter::Export()
// rct1_water_colour
// pad_01358842
memcpy(_s6.research_items, gResearchItems, sizeof(_s6.research_items));
_s6.word_01359208 = RCT2_GLOBAL(0x01359208, uint16);
_s6.map_base_z = gMapBaseZ;
memcpy(_s6.scenario_name, gScenarioName, sizeof(_s6.scenario_name));
memcpy(_s6.scenario_description, gScenarioDetails, sizeof(_s6.scenario_description));
_s6.current_interest_rate = gBankLoanInterestRate;

View File

@@ -290,7 +290,7 @@ void S6Importer::Import()
// rct1_water_colour
// pad_01358842
memcpy(gResearchItems, _s6.research_items, sizeof(_s6.research_items));
RCT2_GLOBAL(0x01359208, uint16) = _s6.word_01359208;
gMapBaseZ = _s6.map_base_z;
memcpy(gScenarioName, _s6.scenario_name, sizeof(_s6.scenario_name));
memcpy(gScenarioDetails, _s6.scenario_description, sizeof(_s6.scenario_description));
gBankLoanInterestRate = _s6.current_interest_rate;

View File

@@ -1292,7 +1292,7 @@ void track_paint(uint8 direction, int height, rct_map_element *mapElement)
uint16 ax = RideData5[ride->type].z_offset;
uint32 ebx = 0x20381689 + (height + 8) / 16;
ebx += RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, uint16);
ebx -= RCT2_GLOBAL(0x01359208, uint16);
ebx -= gMapBaseZ;
sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, 1000, 1000, 2047, get_current_rotation());
}
}

View File

@@ -272,7 +272,7 @@ typedef struct rct_s6_data {
uint8 rct1_water_colour;
uint8 pad_01358842[2];
rct_research_item research_items[500];
uint16 word_01359208;
uint16 map_base_z;
char scenario_name[64];
char scenario_description[256];
uint8 current_interest_rate;

View File

@@ -14,7 +14,6 @@
*****************************************************************************/
#pragma endregion
#include "../addresses.h"
#include "../audio/audio.h"
#include "../cheats.h"
#include "../config.h"
@@ -5351,7 +5350,6 @@ static void window_ride_measurements_paint(rct_window *w, rct_drawpixelinfo *dpi
//therefore we set the last entry to use the no-separator format now, post-format
set_format_arg(0 + ((numTimes - 1) * 4), uint16, STR_RIDE_TIME_ENTRY);
}
RCT2_GLOBAL(0x013CE94E + (numTimes * 4), uint16) = STR_RIDE_TIME_ENTRY;
set_format_arg(0 + (numTimes * 4), uint16, 0);
set_format_arg(2 + (numTimes * 4), uint16, 0);
set_format_arg(4 + (numTimes * 4), uint16, 0);
@@ -5380,7 +5378,6 @@ static void window_ride_measurements_paint(rct_window *w, rct_drawpixelinfo *dpi
//therefore we set the last entry to use the no-separator format now, post-format
set_format_arg(0 + ((numLengths - 1) * 4), uint16, STR_RIDE_LENGTH_ENTRY);
}
RCT2_GLOBAL(0x013CE94E + (numLengths * 4), uint16) = STR_RIDE_LENGTH_ENTRY;
set_format_arg(0 + (numLengths * 4), uint16, 0);
set_format_arg(2 + (numLengths * 4), uint16, 0);
set_format_arg(4 + (numLengths * 4), uint16, 0);
@@ -5690,7 +5687,7 @@ static void window_ride_graphs_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi
int x, y, width, time, listType, colour, top, bottom, tmp;
rct_string_id stringId;
gfx_clear(dpi, RCT2_GLOBAL(0x0141FC9D, uint8) * 0x01010101);
gfx_clear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker * 0x01010101);
widget = &window_ride_graphs_widgets[WIDX_GRAPH];
listType = w->list_information_type & 0xFF;
@@ -5705,14 +5702,17 @@ static void window_ride_graphs_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi
}
// Vertical grid lines
const uint8 lightColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_light;
const uint8 darkColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_dark;
time = 0;
for (x = 0; x < dpi->x + dpi->width; x += 80) {
if (x + 80 >= dpi->x) {
gfx_fill_rect(dpi, x + 0, dpi->y, x + 0, dpi->y + dpi->height - 1, RCT2_GLOBAL(0x0141FCA0, uint8));
gfx_fill_rect(dpi, x + 16, dpi->y, x + 16, dpi->y + dpi->height - 1, RCT2_GLOBAL(0x0141FC9F, uint8));
gfx_fill_rect(dpi, x + 32, dpi->y, x + 32, dpi->y + dpi->height - 1, RCT2_GLOBAL(0x0141FC9F, uint8));
gfx_fill_rect(dpi, x + 48, dpi->y, x + 48, dpi->y + dpi->height - 1, RCT2_GLOBAL(0x0141FC9F, uint8));
gfx_fill_rect(dpi, x + 64, dpi->y, x + 64, dpi->y + dpi->height - 1, RCT2_GLOBAL(0x0141FC9F, uint8));
gfx_fill_rect(dpi, x + 0, dpi->y, x + 0, dpi->y + dpi->height - 1, lightColour);
gfx_fill_rect(dpi, x + 16, dpi->y, x + 16, dpi->y + dpi->height - 1, darkColour);
gfx_fill_rect(dpi, x + 32, dpi->y, x + 32, dpi->y + dpi->height - 1, darkColour);
gfx_fill_rect(dpi, x + 48, dpi->y, x + 48, dpi->y + dpi->height - 1, darkColour);
gfx_fill_rect(dpi, x + 64, dpi->y, x + 64, dpi->y + dpi->height - 1, darkColour);
}
time += 5;
}
@@ -5726,18 +5726,12 @@ static void window_ride_graphs_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi
// Scale modifier
if (listType == GRAPH_ALTITUDE) {
short unk = RCT2_GLOBAL(0x01359208, uint16);
yUnit -= RCT2_GLOBAL(0x01359208, uint16);
unk *= 2;
yUnit -= unk;
yUnit -= gMapBaseZ * 3;
}
for (y = widget->bottom - widget->top - 13; y >= 8; y -= yInterval, yUnit += yUnitInterval) {
// Minor / major line
colour = yUnit == 0 ?
RCT2_GLOBAL(0x0141FCA0, uint8) :
RCT2_GLOBAL(0x0141FC9F, uint8);
colour = yUnit == 0 ? lightColour : darkColour;
gfx_fill_rect(dpi, dpi->x, y, dpi->x + dpi->width - 1, y, colour);
sint16 scaled_yUnit = yUnit;

View File

@@ -87,6 +87,7 @@ sint16 gMapSizeUnits;
sint16 gMapSizeMinus2;
sint16 gMapSize;
sint16 gMapSizeMaxXY;
sint16 gMapBaseZ;
#if defined(NO_RCT2)
rct_map_element gMapElements[0x30000];
@@ -383,7 +384,7 @@ void map_init(int size)
gMapSizeMinus2 = size * 32 - 2;
gMapSize = size;
gMapSizeMaxXY = size * 32 - 33;
RCT2_GLOBAL(0x01359208, sint16) = 7;
gMapBaseZ = 7;
map_update_tile_pointers();
map_remove_out_of_range_elements();
climate_reset(CLIMATE_WARM);

View File

@@ -338,6 +338,7 @@ extern sint16 gMapSizeUnits;
extern sint16 gMapSizeMinus2;
extern sint16 gMapSize;
extern sint16 gMapSizeMaxXY;
extern sint16 gMapBaseZ;
extern uint16 gMapSelectFlags;
extern uint16 gMapSelectType;