mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove old config compatibility
Note: This will stop paths from showing the correct height markers when in original drawing mode.
This commit is contained in:
parent
54612789f6
commit
8d5a553c0a
|
@ -40,16 +40,6 @@
|
||||||
|
|
||||||
#pragma region Memory locations
|
#pragma region Memory locations
|
||||||
|
|
||||||
#define RCT2_ADDRESS_CONFIG_FLAGS 0x009AAC74
|
|
||||||
|
|
||||||
#define RCT2_ADDRESS_CONFIG_METRIC 0x009AAC78
|
|
||||||
#define RCT2_ADDRESS_CONFIG_TEMPERATURE 0x009AAC79
|
|
||||||
#define RCT2_ADDRESS_CONFIG_KEYBOARD_SHORTCUTS 0x009AAC7A
|
|
||||||
#define RCT2_ADDRESS_CONFIG_EDGE_SCROLLING 0x009AACBA
|
|
||||||
#define RCT2_ADDRESS_CONFIG_CURRENCY 0x009AACBB
|
|
||||||
#define RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS 0x009AACBD
|
|
||||||
#define RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER 0x009AACBF
|
|
||||||
|
|
||||||
#define RCT2_ADDRESS_VIEWPORT_PAINT_BITS_PTR 0x009AC118
|
#define RCT2_ADDRESS_VIEWPORT_PAINT_BITS_PTR 0x009AC118
|
||||||
#define RCT2_ADDRESS_VIEWPORT_PAINT_X 0x009AC11C
|
#define RCT2_ADDRESS_VIEWPORT_PAINT_X 0x009AC11C
|
||||||
#define RCT2_ADDRESS_VIEWPORT_PAINT_Y 0x009AC11E
|
#define RCT2_ADDRESS_VIEWPORT_PAINT_Y 0x009AC11E
|
||||||
|
@ -158,6 +148,14 @@
|
||||||
#define RCT2_ADDRESS_EASTEREGG_NAMES 0x00988C20
|
#define RCT2_ADDRESS_EASTEREGG_NAMES 0x00988C20
|
||||||
#define RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS 0x009A9804
|
#define RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS 0x009A9804
|
||||||
#define RCT2_ADDRESS_APP_PATH 0x009AA214
|
#define RCT2_ADDRESS_APP_PATH 0x009AA214
|
||||||
|
#define RCT2_ADDRESS_CONFIG_FLAGS 0x009AAC74
|
||||||
|
#define RCT2_ADDRESS_CONFIG_METRIC 0x009AAC78
|
||||||
|
#define RCT2_ADDRESS_CONFIG_TEMPERATURE 0x009AAC79
|
||||||
|
#define RCT2_ADDRESS_CONFIG_KEYBOARD_SHORTCUTS 0x009AAC7A
|
||||||
|
#define RCT2_ADDRESS_CONFIG_EDGE_SCROLLING 0x009AACBA
|
||||||
|
#define RCT2_ADDRESS_CONFIG_CURRENCY 0x009AACBB
|
||||||
|
#define RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS 0x009AACBD
|
||||||
|
#define RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER 0x009AACBF
|
||||||
#define RCT2_ADDRESS_APP_PATH_SLASH 0x009AB4D9
|
#define RCT2_ADDRESS_APP_PATH_SLASH 0x009AB4D9
|
||||||
#define RCT2_ADDRESS_SAVED_GAMES_PATH 0x009AB5DA
|
#define RCT2_ADDRESS_SAVED_GAMES_PATH 0x009AB5DA
|
||||||
#define RCT2_ADDRESS_SCENARIOS_PATH 0x009AB6E9
|
#define RCT2_ADDRESS_SCENARIOS_PATH 0x009AB6E9
|
||||||
|
|
|
@ -340,13 +340,6 @@ static exitcode_t HandleCommandSetRCT2(CommandLineArgEnumerator * enumerator)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update RCT2 path in config
|
// Update RCT2 path in config
|
||||||
|
|
||||||
// TODO remove this when we get rid of config_apply_to_old_addresses
|
|
||||||
if (!openrct2_setup_rct2_segment()) {
|
|
||||||
Console::Error::WriteLine("Unable to load RCT2 data sector");
|
|
||||||
return EXITCODE_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
config_set_defaults();
|
config_set_defaults();
|
||||||
config_open_default();
|
config_open_default();
|
||||||
String::DiscardDuplicate(&gConfigGeneral.game_path, path);
|
String::DiscardDuplicate(&gConfigGeneral.game_path, path);
|
||||||
|
|
36
src/config.c
36
src/config.c
|
@ -345,8 +345,6 @@ static void config_write_enum(SDL_RWops *file, uint8 type, value_union *value, c
|
||||||
static void utf8_skip_whitespace(utf8 **outch);
|
static void utf8_skip_whitespace(utf8 **outch);
|
||||||
static void utf8_skip_non_whitespace(utf8 **outch);
|
static void utf8_skip_non_whitespace(utf8 **outch);
|
||||||
|
|
||||||
void config_apply_to_old_addresses();
|
|
||||||
|
|
||||||
static int rwopsreadc(SDL_RWops *file)
|
static int rwopsreadc(SDL_RWops *file)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
@ -480,7 +478,6 @@ bool config_open_default()
|
||||||
|
|
||||||
config_get_default_path(path);
|
config_get_default_path(path);
|
||||||
if (config_open(path)) {
|
if (config_open(path)) {
|
||||||
config_apply_to_old_addresses();
|
|
||||||
currency_load_custom_currency_config();
|
currency_load_custom_currency_config();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -494,7 +491,6 @@ bool config_save_default()
|
||||||
|
|
||||||
config_get_default_path(path);
|
config_get_default_path(path);
|
||||||
if (config_save(path)) {
|
if (config_save(path)) {
|
||||||
config_apply_to_old_addresses();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,38 +958,6 @@ bool config_find_or_browse_install_directory()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma region Obsolete
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Any code not implemented in OpenRCT2 will still uses the old configuration option addresses. This function copies all the
|
|
||||||
* OpenRCT2 configuration options to those addresses until the process is no longer necessary.
|
|
||||||
*/
|
|
||||||
void config_apply_to_old_addresses()
|
|
||||||
{
|
|
||||||
#if !defined(NO_RCT2)
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, sint8) = gConfigGeneral.edge_scrolling;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, sint8) = gConfigGeneral.currency_format;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = gConfigGeneral.measurement_format;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = gConfigGeneral.temperature_format;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8) = gConfigGeneral.construction_marker_colour;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = get_height_marker_offset();
|
|
||||||
|
|
||||||
int configFlags = 0;
|
|
||||||
if (gConfigGeneral.always_show_gridlines)
|
|
||||||
configFlags |= CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES;
|
|
||||||
if (!gConfigGeneral.landscape_smoothing)
|
|
||||||
configFlags |= CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE;
|
|
||||||
if (gConfigGeneral.show_height_as_units)
|
|
||||||
configFlags |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS;
|
|
||||||
if (gConfigGeneral.save_plugin_data)
|
|
||||||
configFlags |= CONFIG_FLAG_SAVE_PLUGIN_DATA;
|
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) = configFlags;
|
|
||||||
#endif // !defined(NO_RCT2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma endregion
|
|
||||||
|
|
||||||
#pragma region Shortcuts
|
#pragma region Shortcuts
|
||||||
|
|
||||||
#define SHIFT 0x100
|
#define SHIFT 0x100
|
||||||
|
|
|
@ -257,11 +257,7 @@ void entrance_paint(uint8 direction, int height, rct_map_element* map_element){
|
||||||
if (RCT2_ADDRESS(0x0097B974, uint8)[ebx] & 0xF){
|
if (RCT2_ADDRESS(0x0097B974, uint8)[ebx] & 0xF){
|
||||||
|
|
||||||
int z = map_element->base_height * 8 + 3;
|
int z = map_element->base_height * 8 + 3;
|
||||||
uint32 image_id =
|
uint32 image_id = 0x20101689 + get_height_marker_offset() + (z / 16);
|
||||||
z / 16 +
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS,sint16) +
|
|
||||||
0x20101689;
|
|
||||||
|
|
||||||
image_id -= gMapBaseZ;
|
image_id -= gMapBaseZ;
|
||||||
|
|
||||||
sub_98197C(image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64, get_current_rotation());
|
sub_98197C(image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64, get_current_rotation());
|
||||||
|
|
|
@ -1295,7 +1295,7 @@ void track_paint(uint8 direction, int height, rct_map_element *mapElement)
|
||||||
if (TrackHeightMarkerPositions[trackType] & (1 << trackSequence)) {
|
if (TrackHeightMarkerPositions[trackType] & (1 << trackSequence)) {
|
||||||
uint16 ax = RideData5[ride->type].z_offset;
|
uint16 ax = RideData5[ride->type].z_offset;
|
||||||
uint32 ebx = 0x20381689 + (height + 8) / 16;
|
uint32 ebx = 0x20381689 + (height + 8) / 16;
|
||||||
ebx += RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, uint16);
|
ebx += get_height_marker_offset();
|
||||||
ebx -= gMapBaseZ;
|
ebx -= gMapBaseZ;
|
||||||
sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, 1000, 1000, 2047, get_current_rotation());
|
sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, 1000, 1000, 2047, get_current_rotation());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue