1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Partially integrate 0x0141E9DB

This commit is contained in:
Marijn van der Werf
2016-09-14 19:36:46 +02:00
committed by Ted John
parent c9fd1e66ef
commit f28c35712f
5 changed files with 16 additions and 6 deletions

View File

@@ -34,6 +34,7 @@
#include "../supports.h"
#ifdef NO_RCT2
uint8 g141E9DB;
rct_xy16 gPaintMapPosition;
bool gDidPassSurface;
rct_map_element * gSurfaceElement;
@@ -63,7 +64,7 @@ void map_element_paint_setup(int x, int y)
) {
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_force_set_general_support_height(-1, 0);
RCT2_GLOBAL(0x0141E9DB, uint8) = 0;
g141E9DB = 0;
RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF;
sub_68B3FB(x, y);
@@ -87,7 +88,7 @@ void sub_68B2B7(int x, int y)
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_force_set_general_support_height(-1, 0);
RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF;
RCT2_GLOBAL(0x0141E9DB, uint8) = 2;
g141E9DB = G141E9DB_FLAG_2;
sub_68B3FB(x, y);
} else {

View File

@@ -67,7 +67,14 @@ typedef struct tunnel_entry {
uint8 type;
} tunnel_entry;
enum
{
G141E9DB_FLAG_1 = 1,
G141E9DB_FLAG_2 = 2,
};
#ifdef NO_RCT2
extern uint8 g141E9DB;
extern rct_xy16 gPaintMapPosition;
extern bool gDidPassSurface;
extern rct_map_element * gSurfaceElement;
@@ -77,6 +84,7 @@ extern tunnel_entry gRightTunnels[65];
extern uint8 gRightTunnelCount;
extern uint8 gVerticalTunnelHeight;
#else
#define g141E9DB RCT2_GLOBAL(0x0141E9DB, uint8)
#define gPaintMapPosition RCT2_GLOBAL(0x009DE574, rct_xy16)
#define gDidPassSurface RCT2_GLOBAL(0x009DE57C, bool)
#define gSurfaceElement RCT2_GLOBAL(0x009E3250, rct_map_element *)

View File

@@ -1506,7 +1506,7 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
}
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_TERRAIN;
RCT2_GLOBAL(0x0141E9DB, uint8) |= 1;
g141E9DB |= G141E9DB_FLAG_1;
switch (surfaceShape) {
default:

View File

@@ -18,6 +18,7 @@
#include "../interface/viewport.h"
#include "../paint/paint.h"
#include "supports.h"
#include "map_element/map_element.h"
/** rct2: 0x0097AF20, 0x0097AF21 */
const rct_xy8 loc_97AF20[] = {
@@ -345,7 +346,7 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin
return false;
}
if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 1)) {
if (!(g141E9DB & G141E9DB_FLAG_1)) {
return false;
}
@@ -496,7 +497,7 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int
return false;
}
if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 1)) {
if (!(g141E9DB & G141E9DB_FLAG_1)) {
return false;
}

View File

@@ -422,7 +422,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d
bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height)
{
if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 3)) {
if (!(g141E9DB & (G141E9DB_FLAG_1 | G141E9DB_FLAG_2))) {
return false;
}