mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +01:00
Merge branch 'develop' of https://github.com/OpenRCT2/OpenRCT2 into develop
This commit is contained in:
@@ -16,10 +16,9 @@
|
||||
|
||||
#include "../drawing/drawing.h"
|
||||
#include "colour.h"
|
||||
#include "../addresses.h"
|
||||
|
||||
rct_colour_map_a *ColourMapA = RCT2_ADDRESS(0x0141FC44, rct_colour_map_a);
|
||||
rct_colour_map_b *ColourMapB = RCT2_ADDRESS(0x0141FD44, rct_colour_map_b);
|
||||
rct_colour_map_a ColourMapA[32] = { 0 };
|
||||
rct_colour_map_b ColourMapB[32] = { 0 };
|
||||
|
||||
void colours_init_maps()
|
||||
{
|
||||
|
||||
@@ -73,8 +73,6 @@ enum {
|
||||
|
||||
#define NUM_COLOURS 32
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
typedef struct rct_colour_map_a {
|
||||
uint8 darkest;
|
||||
uint8 darker;
|
||||
@@ -85,7 +83,6 @@ typedef struct rct_colour_map_a {
|
||||
uint8 lighter;
|
||||
uint8 lightest;
|
||||
} rct_colour_map_a;
|
||||
assert_struct_size(rct_colour_map_a, 8);
|
||||
|
||||
typedef struct rct_colour_map_b {
|
||||
uint8 a;
|
||||
@@ -97,12 +94,9 @@ typedef struct rct_colour_map_b {
|
||||
uint8 g;
|
||||
uint8 h;
|
||||
} rct_colour_map_b;
|
||||
assert_struct_size(rct_colour_map_b, 8);
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
extern rct_colour_map_a *ColourMapA;
|
||||
extern rct_colour_map_b *ColourMapB;
|
||||
extern rct_colour_map_a ColourMapA[32];
|
||||
extern rct_colour_map_b ColourMapB[32];
|
||||
|
||||
void colours_init_maps();
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "../supports.h"
|
||||
|
||||
#ifdef NO_RCT2
|
||||
rct_xy16 gPaintMapPosition;
|
||||
bool gDidPassSurface;
|
||||
rct_map_element * gSurfaceElement;
|
||||
tunnel_entry gLeftTunnels[65];
|
||||
@@ -153,8 +154,8 @@ static void sub_68B3FB(int x, int y)
|
||||
|
||||
RCT2_GLOBAL(0x9DE56A, uint16_t) = x;
|
||||
RCT2_GLOBAL(0x9DE56E, uint16_t) = y;
|
||||
RCT2_GLOBAL(0x9DE574, uint16_t) = x;
|
||||
RCT2_GLOBAL(0x9DE576, uint16_t) = y;
|
||||
gPaintMapPosition.x = x;
|
||||
gPaintMapPosition.y = y;
|
||||
|
||||
rct_map_element* map_element = map_get_first_element_at(x >> 5, y >> 5);
|
||||
uint8 rotation = get_current_rotation();
|
||||
@@ -235,7 +236,7 @@ static void sub_68B3FB(int x, int y)
|
||||
int direction = (map_element->type + rotation) & MAP_ELEMENT_DIRECTION_MASK;
|
||||
int height = map_element->base_height * 8;
|
||||
|
||||
uint32_t dword_9DE574 = RCT2_GLOBAL(0x9DE574, uint32_t);
|
||||
rct_xy16 dword_9DE574 = gPaintMapPosition;
|
||||
g_currently_drawn_item = map_element;
|
||||
//setup the painting of for example: the underground, signs, rides, scenery, etc.
|
||||
switch (map_element_get_type(map_element))
|
||||
@@ -274,7 +275,7 @@ static void sub_68B3FB(int x, int y)
|
||||
// An undefined map element is most likely a corrupt element inserted by 8 cars' MOM feature to skip drawing of all elements after it.
|
||||
return;
|
||||
}
|
||||
RCT2_GLOBAL(0x9DE574, uint32_t) = dword_9DE574;
|
||||
gPaintMapPosition = dword_9DE574;
|
||||
} while (!map_element_is_last_for_tile(map_element++));
|
||||
|
||||
if (!gShowSupportSegmentHeights) {
|
||||
|
||||
@@ -68,6 +68,7 @@ typedef struct tunnel_entry {
|
||||
} tunnel_entry;
|
||||
|
||||
#ifdef NO_RCT2
|
||||
extern rct_xy16 gPaintMapPosition;
|
||||
extern bool gDidPassSurface;
|
||||
extern rct_map_element * gSurfaceElement;
|
||||
extern tunnel_entry gLeftTunnels[65];
|
||||
@@ -76,6 +77,7 @@ extern tunnel_entry gRightTunnels[65];
|
||||
extern uint8 gRightTunnelCount;
|
||||
extern uint8 gVerticalTunnelHeight;
|
||||
#else
|
||||
#define gPaintMapPosition RCT2_GLOBAL(0x009DE574, rct_xy16)
|
||||
#define gDidPassSurface RCT2_GLOBAL(0x009DE57C, bool)
|
||||
#define gSurfaceElement RCT2_GLOBAL(0x009E3250, rct_map_element *)
|
||||
#define gLeftTunnels RCT2_ADDRESS(0x009E3138, tunnel_entry)
|
||||
|
||||
@@ -167,8 +167,8 @@ static paint_struct * sub_9819_c(uint32 image_id, rct_xyz16 offset, rct_xyz16 bo
|
||||
ps->var_20 = NULL;
|
||||
ps->sprite_type = gPaintInteractionType;
|
||||
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
||||
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
||||
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
||||
ps->map_x = gPaintMapPosition.x;
|
||||
ps->map_y = gPaintMapPosition.y;
|
||||
ps->mapElement = g_currently_drawn_item;
|
||||
|
||||
return ps;
|
||||
@@ -288,8 +288,8 @@ paint_struct * sub_98196C(
|
||||
ps->var_20 = NULL;
|
||||
ps->sprite_type = gPaintInteractionType;
|
||||
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
||||
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
||||
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
||||
ps->map_x = gPaintMapPosition.x;
|
||||
ps->map_y = gPaintMapPosition.y;
|
||||
ps->mapElement = g_currently_drawn_item;
|
||||
|
||||
g_ps_F1AD28 = ps;
|
||||
|
||||
@@ -610,7 +610,7 @@ bool staff_is_patrol_area_set(int staffIndex, int x, int y)
|
||||
int peepOffset = staffIndex * 128;
|
||||
int offset = (x | y) >> 5;
|
||||
int bitIndex = (x | y) & 0x1F;
|
||||
return gStaffPatrolAreas[peepOffset + offset] & (1 << bitIndex);
|
||||
return gStaffPatrolAreas[peepOffset + offset] & (((uint32)1) << bitIndex);
|
||||
}
|
||||
|
||||
void staff_set_patrol_area(int staffIndex, int x, int y, bool value)
|
||||
|
||||
@@ -59,7 +59,7 @@ static void paint_circus_show(uint8 rideIndex, uint8 trackSequence, uint8 direct
|
||||
rct_ride * ride = get_ride(rideIndex);
|
||||
rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)};
|
||||
|
||||
wooden_a_supports_paint_setup((direction & 1), 0, height, RCT2_GLOBAL(0x00F441A0, uint32_t), NULL);
|
||||
wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL);
|
||||
|
||||
track_paint_util_paint_floor(edges, gTrackColours[SCHEME_TRACK], height, floorSpritesCork, get_current_rotation());
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ static void paint_crooked_house(uint8 rideIndex, uint8 trackSequence, uint8 dire
|
||||
rct_ride * ride = get_ride(rideIndex);
|
||||
rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)};
|
||||
|
||||
wooden_a_supports_paint_setup((direction & 1), 0, height, RCT2_GLOBAL(0x00F441A0, uint32_t), NULL);
|
||||
wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL);
|
||||
|
||||
track_paint_util_paint_floor(edges, gTrackColours[SCHEME_TRACK], height, floorSpritesCork, get_current_rotation());
|
||||
|
||||
|
||||
@@ -695,6 +695,9 @@ static int server_compare(const void *a, const void *b)
|
||||
|
||||
static void sort_servers()
|
||||
{
|
||||
if (_serverEntries == NULL) {
|
||||
return;
|
||||
}
|
||||
qsort(_serverEntries, _numServerEntries, sizeof(server_entry), server_compare);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user